VR-Forces 4.10 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  class DtChannelManager;
26  class DtChannel;
27 
32  {
33  public:
36 
38  virtual ~DtOsgWindowLineInstance();
39 
41  virtual void setVertex(unsigned int vertex, double x, double y );
42 
44  virtual void removeVertex(unsigned int vertex );
45 
47  virtual void setColor(float r, float g, float b, float a);
48 
50  virtual void setStipplePattern(unsigned int stipplePattern);
51 
53  virtual void setWidth(unsigned int width);
54 
57  virtual void setStyleSegments( const std::vector<double>& segmentPercentages );
58 
60  virtual void setSegmentColor(unsigned int index, float r, float g, float b, float a);
61 
64  virtual void setSegmentStartColor(unsigned int index, float r, float g,
65  float b, float a);
66 
69  virtual void setSegmentEndColor(unsigned int index, float r, float g,
70  float b, float a);
71 
73  virtual void setSegmentLightningStyle(unsigned int index, bool enableLightningStyle);
74 
76  virtual void setSegmentStartArrow(unsigned int index, bool enableStartArrow);
77 
79  virtual void setSegmentEndArrow(unsigned int index, bool enableEndArrow);
80 
82  virtual void setSegmentStipplePattern(unsigned int index, unsigned int stippleScale, unsigned int stipplePattern);
83 
85  virtual void setSegmentWidth(unsigned int index, unsigned int width);
86 
88  virtual void setVisible(bool isVisible);
89 
91  virtual void update();
92 
95  virtual void setTransform( DtMatrix3<double> transform);
96 
98  virtual void createLine();
99 
101  virtual void setClipBox( DtVector2<double> bottomLeftLocation, DtVector2<double> topRightLocation );
102 
105  virtual void setGroup( int groupId );
106  protected:
107 
109  virtual void resizeSegmentAttributes( int size );
110 
112  virtual void updateSegments();
113 
115  virtual void updateGeometry();
116 
118  virtual void generateSegment( int segmentIndex, const osg::Vec2& startPoint,
119  const osg::Vec2& endPoint, const osg::Vec2& segmentAxis,
120  const osg::Vec2& segmentPerpendicular );
121 
124  {
125  unsigned int width;
127  bool endArrow;
128  bool lightning;
129  unsigned int stipplePattern;
130  unsigned int stipplePatternScale;
131  osg::Vec4 color[2];
134  int startColorRange[2];
135  int blendColorRange[2];
136  int endColorRange[2];
139  };
140 
142  virtual void setupColorRanges( SegmentAttributes* segmentAttributes );
143 
146  virtual void setLineSegmentColors( unsigned int vtx,
147  SegmentAttributes* segmentAttributes );
148 
153  virtual void setChannelOverlay( std::string displayName,
154  std::string windowName, std::string channelName );
155 
157  virtual void slot_channelToBeDestroyed(DtChannelManager*, DtChannel*);
158 
159  protected:
160 
162 
163  typedef std::vector<SegmentAttributes> SegmentAttributesVector;
164  typedef std::vector<osg::Vec2> Points;
165 
166  // These are the points as set by the model
168 
169  // These are the actual vertices, which may be different if style segments are used
171 
173 
175 
176  osg::Vec4 myColor;
177  float myWidth;
178  unsigned int myStipplePattern;
179  unsigned int myGroup;
180  std::vector<double> mySegmentPercentages;
184  bool myVisible;
185  osg::Matrix myTransform;
187  osg::Vec2 myClipBoxTopRight;
188  std::string myDisplayName;
189  std::string myWindowName;
190  std::string myChannelName;
191  };
192 
195  {
196  public:
199 
202  virtual DtWindowLineInstance* create();
203  };
204 }
Contains makVrv::DtWindowLineInstance class.
bool lightning
Definition: DtOsgWindowLineInstance.h:128
bool myGeometryDirty
Definition: DtOsgWindowLineInstance.h:181
Contains makVrv::DtRgbColorInterpolator class declaration.
osg::Vec2 myClipBoxTopRight
Definition: DtOsgWindowLineInstance.h:187
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtSegmentedLine * myLine
Definition: DtOsgWindowLineInstance.h:174
OSG Implementation of a DtWindowLineInstance.
Definition: DtOsgWindowLineInstance.h:31
bool colorRangesSetup
Definition: DtOsgWindowLineInstance.h:138
voidpf void uLong size
Definition: ioapi.h:39
unsigned int myStipplePattern
Definition: DtOsgWindowLineInstance.h:178
std::vector< osg::Vec2 > Points
Definition: DtOsgWindowLineInstance.h:164
unsigned int myGroup
Definition: DtOsgWindowLineInstance.h:179
bool myVisible
Definition: DtOsgWindowLineInstance.h:184
bool myUseChannelOverlay
Definition: DtOsgWindowLineInstance.h:183
Creator for DtOsgWindowLineInstance.
Definition: DtOsgWindowLineInstance.h:194
Points myVertices
Definition: DtOsgWindowLineInstance.h:170
Creator for DtWindowLineInstance, will throw if you create on it.
Definition: DtWindowLineInstance.h:114
osg::Vec2 myClipBoxBottomLeft
Definition: DtOsgWindowLineInstance.h:186
The abstract Channel Class.
Definition: DtChannel.h:30
osg::Vec4 myColor
Definition: DtOsgWindowLineInstance.h:176
int segmentStartVertex
Definition: DtOsgWindowLineInstance.h:132
SegmentAttributesVector mySegmentAttributes
Definition: DtOsgWindowLineInstance.h:172
unsigned int width
Definition: DtOsgWindowLineInstance.h:125
bool startArrow
Definition: DtOsgWindowLineInstance.h:126
unsigned int stipplePatternScale
Definition: DtOsgWindowLineInstance.h:130
float myWidth
Definition: DtOsgWindowLineInstance.h:177
DtRgbColorInterpolator interpolator
Definition: DtOsgWindowLineInstance.h:137
bool endArrow
Definition: DtOsgWindowLineInstance.h:127
Points myPoints
Definition: DtOsgWindowLineInstance.h:167
osg::Matrix myTransform
Definition: DtOsgWindowLineInstance.h:185
unsigned int stipplePattern
Definition: DtOsgWindowLineInstance.h:129
Base class for handling DtChannels.
Definition: DtChannelManager.h:32
Definition: DtRgbColorInterpolator.h:21
int segmentEndVertex
Definition: DtOsgWindowLineInstance.h:133
Interface for a DtWindowLineInstance - an attachable model instance that draws a 2D line...
Definition: DtWindowLineInstance.h:28
DtDe & myDe
Definition: DtOsgWindowLineInstance.h:161
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
bool mySegmentsDirty
Definition: DtOsgWindowLineInstance.h:182
A convex polygon drawn using lines.
Definition: DtSegmentedLine.h:24
std::string myDisplayName
Definition: DtOsgWindowLineInstance.h:188
std::string myChannelName
Definition: DtOsgWindowLineInstance.h:190
std::vector< double > mySegmentPercentages
Definition: DtOsgWindowLineInstance.h:180
std::string myWindowName
Definition: DtOsgWindowLineInstance.h:189
std::vector< SegmentAttributes > SegmentAttributesVector
Definition: DtOsgWindowLineInstance.h:163
Attributes describing one segment in a segmented line.
Definition: DtOsgWindowLineInstance.h:123

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)