VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtExtrudedModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
15 #include <matrix/vlVector.h>
16 
17 #include <osg/PrimitiveSet>
18 #include <osg/Geometry>
19 
20 namespace osg
21 {
22  class Geode;
23  class Array;
24  class Texture;
25  class LineWidth;
26  class Group;
27 }
28 
29 namespace makVrv
30 {
31  class DtOsgSegmentPickable;
32 
36  {
37  public:
38  typedef std::vector<DtVector> PointVector;
39 
41  {
45  FullExtrusion
46  };
47 
50 
52  virtual ~DtExtrudedModelInstance();
53 
55  virtual const PointVector& points() const;
56 
58  virtual void addPoint(const DtVector&, int index = -1);
59 
61  virtual void removePoint(int index);
62 
64  virtual void setPoints(const std::vector<DtVector>&);
65 
67  virtual void setPosition(int index, const DtVector&);
68 
70  virtual void setPositions(const std::vector<DtVector>&);
71 
73  virtual void clearPoints();
74 
77  virtual bool realize(DtModelDefinition& definition);
78 
80  virtual void addToConnector( DtOsgSceneConnector* connector );
81 
83  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
84 
86  virtual void setStipplePattern(unsigned int);
87 
89  virtual void setColor(float r,float g,float b,float a);
90 
92  virtual void getColor(float& r,float& g,float& b,float& a) const;
93 
95  virtual void setTextureHeight(double height);
96 
98  virtual void setTextureWidth(double width);
99 
101  virtual void setTexture(osg::Texture* texture);
102 
109 
111  virtual void setUpExtent(float height);
112 
114  virtual void setDownExtent(float height);
115 
117  virtual void setLeftExtent(float height);
118 
120  virtual void setRightExtent(float heigh);
122 
124  virtual void setWidth(float);
125 
128  virtual void setHeight(float);
129 
131  virtual void setDimensions(float width, float height);
132 
135  virtual void setLineWidth(float width);
136 
140  virtual void setScribeWidth(float width);
141 
145  virtual void setScribeAllPolygons(bool);
146 
148  virtual void setScribed(bool b);
149 
152  virtual void setScribeColor(float r, float g, float b, float a);
153 
155  virtual void setVisible(bool isVisible) {}
156 
158  int pointCount() const;
159 
161  const DtVector& origin() const;
162 
164  const DtVector& point(int) const;
165 
167  virtual void setPickable(bool);
168 
170  bool pickable() const;
171 
172  void setOrigin(const DtVector& origin);
173 
175  virtual void updatePoints();
176 
178  virtual void setSolid(bool);
179 
181  osg::Node* rootNode();
182 
183  protected:
185  virtual osg::Vec3 rotatePoint(const osg::Vec3& org, double range, const DtTaitBryan& angle) const;
186 
188  virtual void updateMode();
189 
191  virtual void updateGeometry();
192 
194  virtual void updateTextureCoordinates();
195 
197  virtual void addPointsForExtentExtrusion(const DtVector& point);
198 
200  virtual void addFaceForRotation(const osg::Quat& rotation, const DtVector& point);
201 
203  virtual void addPointsForFullExtrusion(const DtVector& from,
204  const DtVector& to);
205 
208  virtual void setupScribeTransparency(bool b);
209 
211  virtual void setupGeodeTransparency(bool b);
212 
214  virtual void updateStippling();
215 
217  virtual void updateScribeLine();
218 
220  virtual void updateColors();
221 
223  virtual bool frontAndBackFaceRendered() const;
224 
226  virtual void updatePointsForLineStrip();
227 
229  virtual void updatePointsForTriangleStrip();
230 
232  virtual void updatePointsForExtrusion();
233 
235  virtual void createFaces();
236 
238  virtual void updateScribeForTriangleStrip();
239 
241  virtual void updateScribeForExtrusion(osg::Vec3Array*);
242 
244  virtual void updateScribeForOutline();
245 
247  virtual void updateScribeForFull();
248 
250  virtual void updateGeometryWithStrip(osg::ref_ptr<osg::Geometry>&, const osg::ref_ptr<osg::Vec3Array>&);
251 
252  protected:
256 
264 
267 
270 
275 
280 
281  osg::Vec4 myColor;
282 
285 
286  float myUpExtent;
290 
292 
294 
296 
297  bool myScribed;
299  bool mySolid;
301 
304 
309 
310  osg::Vec4 myScribeColor;
312  };
313 }
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
osg::ref_ptr< osg::Texture > myTexture
Definition: DtExtrudedModelInstance.h:265
float myLeftExtent
Definition: DtExtrudedModelInstance.h:288
float myDownExtent
Definition: DtExtrudedModelInstance.h:287
Create a series of cylinders that can be used as pickable on lines that only have osg width...
Definition: DtOsgSegmentPickable.h:23
float myUpExtent
Definition: DtExtrudedModelInstance.h:286
Definition: DtExtrudedModelInstance.h:44
DtOsgSegmentPickable * myPickable
If drawing as line use this pointer to create the pickable segments of that line, else geometry will ...
Definition: DtExtrudedModelInstance.h:307
virtual void setVisible(bool isVisible)
no-op
Definition: DtExtrudedModelInstance.h:155
osg::ref_ptr< osg::Group > myFrontTransparentGroup
Definition: DtExtrudedModelInstance.h:271
A prism controlled by control points.
Definition: DtExtrudedModelInstance.h:35
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
voidpf uLong int origin
Definition: ioapi.h:42
float myRightExtent
Definition: DtExtrudedModelInstance.h:289
osg::ref_ptr< osg::Group > myMainTransform
Definition: DtExtrudedModelInstance.h:274
bool myScribed
Definition: DtExtrudedModelInstance.h:297
osg::ref_ptr< osg::Vec3Array > myScribePointsFull
Definition: DtExtrudedModelInstance.h:263
osg::ref_ptr< osg::Vec3Array > myShapePoints
Definition: DtExtrudedModelInstance.h:255
std::vector< DtVector > PointVector
Definition: DtExtrudedModelInstance.h:38
bool myScribeAllPolygons
Definition: DtExtrudedModelInstance.h:298
osg::ref_ptr< osg::LineWidth > myLineWidth
Definition: DtExtrudedModelInstance.h:268
osg::ref_ptr< osg::Vec3Array > myFaces
If the line has width and height, the list of faces that make up the junction points of the boxes...
Definition: DtExtrudedModelInstance.h:279
double myTextureWidth
Definition: DtExtrudedModelInstance.h:283
bool mySolid
Definition: DtExtrudedModelInstance.h:299
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:33
osg::Vec4 myScribeColor
Definition: DtExtrudedModelInstance.h:310
Contains makVrv::DtOsgModelInstance class.
DtOsgSceneConnector is used by models to create an OSG position/orientation transform so that it can ...
Definition: DtOsgSceneConnector.h:76
bool myShapePointsDirty
Definition: DtExtrudedModelInstance.h:295
bool myIsPickable
Definition: DtExtrudedModelInstance.h:308
osg::ref_ptr< osg::Geometry > myScribeGeometryTop
Definition: DtExtrudedModelInstance.h:259
LineExtrusionMode myMode
Definition: DtExtrudedModelInstance.h:303
osg::ref_ptr< osg::Geode > myShapeGeode
Definition: DtExtrudedModelInstance.h:253
The base class for simple OSG based model instances.
Definition: DtOsgModelInstance.h:72
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
bool myScribeWidthSet
Definition: DtExtrudedModelInstance.h:300
osg::ref_ptr< osg::Vec2Array > myTextureCoordinates
Definition: DtExtrudedModelInstance.h:266
int myStipplePattern
Definition: DtExtrudedModelInstance.h:302
double myTextureHeight
Definition: DtExtrudedModelInstance.h:284
osg::ref_ptr< osg::Geode > myScribeGeode
Definition: DtExtrudedModelInstance.h:257
Definition: DtExtrudedModelInstance.h:42
PointVector myLinePoints
Definition: DtExtrudedModelInstance.h:291
osg::ref_ptr< osg::Geometry > myScribeGeometryBottom
Definition: DtExtrudedModelInstance.h:260
Definition: DtExtrudedModelInstance.h:43
osg::ref_ptr< osg::Geometry > myScribeGeometryFull
Definition: DtExtrudedModelInstance.h:258
bool myScribeColorSet
Definition: DtExtrudedModelInstance.h:311
osg::ref_ptr< osg::Group > myOpaqueGroup
Definition: DtExtrudedModelInstance.h:273
osg::ref_ptr< osg::Vec3Array > myScribePointsTop
Definition: DtExtrudedModelInstance.h:261
DtVector myOrigin
Definition: DtExtrudedModelInstance.h:293
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
osg::ref_ptr< osg::Group > myBackTransparentGroup
Definition: DtExtrudedModelInstance.h:272
osg::ref_ptr< osg::Geometry > myShapeGeometry
Definition: DtExtrudedModelInstance.h:254
osg::ref_ptr< osg::LineWidth > myScribeWidth
Definition: DtExtrudedModelInstance.h:269
osg::ref_ptr< osg::Vec3Array > myScribePointsBottom
Definition: DtExtrudedModelInstance.h:262
LineExtrusionMode
Definition: DtExtrudedModelInstance.h:40
osg::Vec4 myColor
Definition: DtExtrudedModelInstance.h:281

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)