VR-Forces 5.0.2 Developer's Guide
 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) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
18 
19 #include <osg/Vec2>
20 #include <osg/Vec4>
21 #include <osg/Matrix>
22 
23 namespace makVrv
24 {
25  class DtDe;
26  class DtSegmentedLine;
27  class DtChannelManager;
28  class DtChannel;
29 
34  {
35  public:
38 
40  virtual ~DtOsgWindowLineInstance();
41 
43  virtual void setVertex(unsigned int vertex, double x, double y );
44 
46  virtual void removeVertex(unsigned int vertex );
47 
49  virtual void setColor(float r, float g, float b, float a);
50 
52  virtual void setStipplePattern(unsigned int stipplePattern);
53 
55  virtual void setWidth(unsigned int width);
56 
59  virtual void setStyleSegments( const std::vector<double>& segmentPercentages );
60 
62  virtual void setSegmentColor(unsigned int index, float r, float g, float b, float a);
63 
66  virtual void setSegmentStartColor(unsigned int index, float r, float g,
67  float b, float a);
68 
71  virtual void setSegmentEndColor(unsigned int index, float r, float g,
72  float b, float a);
73 
75  virtual void setSegmentLightningStyle(unsigned int index, bool enableLightningStyle);
76 
78  virtual void setSegmentStartArrow(unsigned int index, bool enableStartArrow);
79 
81  virtual void setSegmentEndArrow(unsigned int index, bool enableEndArrow);
82 
84  virtual void setSegmentStipplePattern(unsigned int index, unsigned int stippleScale, unsigned int stipplePattern);
85 
87  virtual void setSegmentWidth(unsigned int index, unsigned int width);
88 
90  virtual void setVisible(bool isVisible);
91 
93  virtual void update();
94 
97  virtual void setTransform( DtMatrix3<double> transform);
98 
100  virtual void createLine();
101 
103  virtual void setClipBox( DtVector2<double> bottomLeftLocation, DtVector2<double> topRightLocation );
104 
107  virtual void setGroup( int groupId );
108  protected:
109 
111  virtual void resizeSegmentAttributes( int size );
112 
114  virtual void updateSegments();
115 
117  virtual void updateGeometry();
118 
120  virtual void generateSegment( int segmentIndex, const osg::Vec2& startPoint,
121  const osg::Vec2& endPoint, const osg::Vec2& segmentAxis,
122  const osg::Vec2& segmentPerpendicular );
123 
126  {
127  unsigned int width;
129  bool endArrow;
130  bool lightning;
131  unsigned int stipplePattern;
132  unsigned int stipplePatternScale;
133  osg::Vec4 color[2];
136  int startColorRange[2];
137  int blendColorRange[2];
138  int endColorRange[2];
141  };
142 
144  virtual void setupColorRanges( SegmentAttributes* segmentAttributes );
145 
148  virtual void setLineSegmentColors( unsigned int vtx,
149  SegmentAttributes* segmentAttributes );
150 
155  virtual void setChannelOverlay( const std::string& displayName,
156  const std::string& windowName, const std::string& channelName ) override;
157 
159  virtual void slot_channelToBeDestroyed(DtChannelManager*, DtChannel*);
160 
161  protected:
162 
164 
165  typedef std::vector<SegmentAttributes> SegmentAttributesVector;
166  typedef std::vector<osg::Vec2> Points;
167 
168  // These are the points as set by the model
170 
171  // These are the actual vertices, which may be different if style segments are used
173 
175 
177 
178  osg::Vec4 myColor;
179  float myWidth;
180  unsigned int myStipplePattern;
181  unsigned int myGroup;
182  std::vector<double> mySegmentPercentages;
186  bool myVisible;
187  osg::Matrix myTransform;
189  osg::Vec2 myClipBoxTopRight;
190  std::string myDisplayName;
191  std::string myWindowName;
192  std::string myChannelName;
193 
195  };
196 
199  {
200  public:
203 
206  virtual DtWindowLineInstance* create();
207  };
208 }
Contains makVrv::DtWindowLineInstance class.
bool lightning
Definition: DtOsgWindowLineInstance.h:130
bool myGeometryDirty
Definition: DtOsgWindowLineInstance.h:183
Contains makVrv::DtRgbColorInterpolator class declaration.
osg::Vec2 myClipBoxTopRight
Definition: DtOsgWindowLineInstance.h:189
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtSegmentedLine * myLine
Definition: DtOsgWindowLineInstance.h:176
OSG Implementation of a DtWindowLineInstance. Uses a vrvGraphics DtSegmentedLine to draw a 2D Line...
Definition: DtOsgWindowLineInstance.h:33
bool colorRangesSetup
Definition: DtOsgWindowLineInstance.h:140
voidpf void uLong size
Definition: ioapi.h:39
unsigned int myStipplePattern
Definition: DtOsgWindowLineInstance.h:180
std::vector< osg::Vec2 > Points
Definition: DtOsgWindowLineInstance.h:166
unsigned int myGroup
Definition: DtOsgWindowLineInstance.h:181
bool myVisible
Definition: DtOsgWindowLineInstance.h:186
bool myUseChannelOverlay
Definition: DtOsgWindowLineInstance.h:185
DtSignalConnectionManager myConnections
Definition: DtOsgWindowLineInstance.h:194
Creator for DtOsgWindowLineInstance.
Definition: DtOsgWindowLineInstance.h:198
Points myVertices
Definition: DtOsgWindowLineInstance.h:172
Creator for DtWindowLineInstance, will throw if you create on it. osg creator is registered in vrvOsg...
Definition: DtWindowLineInstance.h:114
osg::Vec2 myClipBoxBottomLeft
Definition: DtOsgWindowLineInstance.h:188
The abstract Channel Class.
Definition: DtChannel.h:35
osg::Vec4 myColor
Definition: DtOsgWindowLineInstance.h:178
int segmentStartVertex
Definition: DtOsgWindowLineInstance.h:134
SegmentAttributesVector mySegmentAttributes
Definition: DtOsgWindowLineInstance.h:174
unsigned int width
Definition: DtOsgWindowLineInstance.h:127
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
bool startArrow
Definition: DtOsgWindowLineInstance.h:128
unsigned int stipplePatternScale
Definition: DtOsgWindowLineInstance.h:132
float myWidth
Definition: DtOsgWindowLineInstance.h:179
DtRgbColorInterpolator interpolator
Definition: DtOsgWindowLineInstance.h:139
bool endArrow
Definition: DtOsgWindowLineInstance.h:129
Points myPoints
Definition: DtOsgWindowLineInstance.h:169
osg::Matrix myTransform
Definition: DtOsgWindowLineInstance.h:187
unsigned int stipplePattern
Definition: DtOsgWindowLineInstance.h:131
Base class for handling DtChannels. Derived classes should override the tick() method and advance the...
Definition: DtChannelManager.h:32
Definition: DtRgbColorInterpolator.h:21
int segmentEndVertex
Definition: DtOsgWindowLineInstance.h:135
Base class to provide boost signal/slot management.
Interface for a DtWindowLineInstance - an attachable model instance that draws a 2D line...
Definition: DtWindowLineInstance.h:28
DtDe & myDe
Definition: DtOsgWindowLineInstance.h:163
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
bool mySegmentsDirty
Definition: DtOsgWindowLineInstance.h:184
A convex polygon drawn using lines.
Definition: DtSegmentedLine.h:24
std::string myDisplayName
Definition: DtOsgWindowLineInstance.h:190
std::string myChannelName
Definition: DtOsgWindowLineInstance.h:192
std::vector< double > mySegmentPercentages
Definition: DtOsgWindowLineInstance.h:182
std::string myWindowName
Definition: DtOsgWindowLineInstance.h:191
std::vector< SegmentAttributes > SegmentAttributesVector
Definition: DtOsgWindowLineInstance.h:165
Attributes describing one segment in a segmented line.
Definition: DtOsgWindowLineInstance.h:125

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)