VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgWindowLineInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
16 
17 #include <osg/Vec2>
18 #include <osg/Vec4>
19 #include <osg/Matrix>
20 
21 namespace makVrv
22 {
23  class DtDe;
24  class DtSegmentedLine;
25 
30  {
31  public:
34 
36  virtual ~DtOsgWindowLineInstance();
37 
39  virtual void setVertex(unsigned int vertex, double x, double y );
40 
42  virtual void removeVertex(unsigned int vertex );
43 
45  virtual void setColor(float r, float g, float b, float a);
46 
48  virtual void setStipplePattern(unsigned int stipplePattern);
49 
51  virtual void setWidth(unsigned int width);
52 
55  virtual void setStyleSegments( const std::vector<double>& segmentPercentages );
56 
58  virtual void setSegmentColor(unsigned int index, float r, float g, float b, float a);
59 
62  virtual void setSegmentStartColor(unsigned int index, float r, float g,
63  float b, float a);
64 
67  virtual void setSegmentEndColor(unsigned int index, float r, float g,
68  float b, float a);
69 
71  virtual void setSegmentLightningStyle(unsigned int index, bool enableLightningStyle);
72 
74  virtual void setSegmentStartArrow(unsigned int index, bool enableStartArrow);
75 
77  virtual void setSegmentEndArrow(unsigned int index, bool enableEndArrow);
78 
80  virtual void setSegmentStipplePattern(unsigned int index, unsigned int stippleScale, unsigned int stipplePattern);
81 
83  virtual void setSegmentWidth(unsigned int index, unsigned int width);
84 
86  virtual void setVisible(bool isVisible);
87 
89  virtual void update();
90 
93  virtual void setTransform( DtMatrix3<double> transform);
94 
96  virtual void setScale( double x, double y );
97  protected:
98 
100  virtual void resizeSegmentAttributes( int size );
101 
103  virtual void createLineIfNecessary();
104 
106  virtual void updateSegments();
107 
109  virtual void updateGeometry();
110 
112  virtual void generateSegment( int segmentIndex, const osg::Vec2& startPoint,
113  const osg::Vec2& endPoint, const osg::Vec2& segmentAxis,
114  const osg::Vec2& segmentPerpendicular );
115 
118  {
119  unsigned int width;
121  bool endArrow;
122  bool lightning;
123  unsigned int stipplePattern;
124  unsigned int stipplePatternScale;
125  osg::Vec4 color[2];
128  int startColorRange[2];
129  int blendColorRange[2];
130  int endColorRange[2];
133  };
134 
136  virtual void setupColorRanges( SegmentAttributes* segmentAttributes );
137 
140  virtual void setLineSegmentColors( unsigned int vtx,
141  SegmentAttributes* segmentAttributes );
142 
144  virtual void setClipBox( DtVector2<double> bottomLeftLocation, DtVector2<double> topRightLocation );
145 
146 
147  protected:
148 
150 
151  typedef std::vector<SegmentAttributes> SegmentAttributesVector;
152  typedef std::vector<osg::Vec2> Points;
153 
154  // These are the points as set by the model
156 
157  // These are the actual vertices, which may be different if style segments are used
159 
161 
163 
164  osg::Vec4 myColor;
165  float myWidth;
166  unsigned int myStipplePattern;
167  std::vector<double> mySegmentPercentages;
168 
169  bool myVisible;
172 
173  osg::Matrix myTransform;
174  double myXScale;
175  double myYScale;
177  osg::Vec2 myClipBoxTopRight;
178  };
179 }
Contains makVrv::DtWindowLineInstance class.
bool lightning
Definition: DtOsgWindowLineInstance.h:122
bool myGeometryDirty
Definition: DtOsgWindowLineInstance.h:170
Contains makVrv::DtRgbColorInterpolator class declaration.
osg::Vec2 myClipBoxTopRight
Definition: DtOsgWindowLineInstance.h:177
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtSegmentedLine * myLine
Definition: DtOsgWindowLineInstance.h:162
vrvGraphics implementation of a 2D Line
Definition: DtOsgWindowLineInstance.h:29
bool colorRangesSetup
Definition: DtOsgWindowLineInstance.h:132
voidpf void uLong size
Definition: ioapi.h:39
unsigned int myStipplePattern
Definition: DtOsgWindowLineInstance.h:166
std::vector< osg::Vec2 > Points
Definition: DtOsgWindowLineInstance.h:152
bool myVisible
Definition: DtOsgWindowLineInstance.h:169
Points myVertices
Definition: DtOsgWindowLineInstance.h:158
osg::Vec2 myClipBoxBottomLeft
Definition: DtOsgWindowLineInstance.h:176
double myXScale
Definition: DtOsgWindowLineInstance.h:174
osg::Vec4 myColor
Definition: DtOsgWindowLineInstance.h:164
int segmentStartVertex
Definition: DtOsgWindowLineInstance.h:126
SegmentAttributesVector mySegmentAttributes
Definition: DtOsgWindowLineInstance.h:160
unsigned int width
Definition: DtOsgWindowLineInstance.h:119
bool startArrow
Definition: DtOsgWindowLineInstance.h:120
unsigned int stipplePatternScale
Definition: DtOsgWindowLineInstance.h:124
float myWidth
Definition: DtOsgWindowLineInstance.h:165
DtRgbColorInterpolator interpolator
Definition: DtOsgWindowLineInstance.h:131
bool endArrow
Definition: DtOsgWindowLineInstance.h:121
Points myPoints
Definition: DtOsgWindowLineInstance.h:155
osg::Matrix myTransform
Definition: DtOsgWindowLineInstance.h:173
unsigned int stipplePattern
Definition: DtOsgWindowLineInstance.h:123
Definition: DtRgbColorInterpolator.h:21
int segmentEndVertex
Definition: DtOsgWindowLineInstance.h:127
Interface for a DtWindowLineInstance - an attachable model instance that draws a 2D line...
Definition: DtWindowLineInstance.h:27
DtDe & myDe
Definition: DtOsgWindowLineInstance.h:149
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
bool mySegmentsDirty
Definition: DtOsgWindowLineInstance.h:171
A convex polygon drawn using lines.
Definition: DtSegmentedLine.h:24
std::vector< double > mySegmentPercentages
Definition: DtOsgWindowLineInstance.h:167
double myYScale
Definition: DtOsgWindowLineInstance.h:175
std::vector< SegmentAttributes > SegmentAttributesVector
Definition: DtOsgWindowLineInstance.h:151
Attributes describing one segment in a segmented line.
Definition: DtOsgWindowLineInstance.h:117

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)