VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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:
253  osg::ref_ptr<osg::Geode> myShapeGeode;
254  osg::ref_ptr<osg::Geometry> myShapeGeometry;
255  osg::ref_ptr<osg::Vec3Array> myShapePoints;
256 
257  osg::ref_ptr<osg::Geode> myScribeGeode;
258  osg::ref_ptr<osg::Geometry> myScribeGeometryFull;
259  osg::ref_ptr<osg::Geometry> myScribeGeometryTop;
260  osg::ref_ptr<osg::Geometry> myScribeGeometryBottom;
261  osg::ref_ptr<osg::Vec3Array> myScribePointsTop;
262  osg::ref_ptr<osg::Vec3Array> myScribePointsBottom;
263  osg::ref_ptr<osg::Vec3Array> myScribePointsFull;
264 
265  osg::ref_ptr<osg::Texture> myTexture;
266  osg::ref_ptr<osg::Vec2Array> myTextureCoordinates;
267 
268  osg::ref_ptr<osg::LineWidth> myLineWidth;
269  osg::ref_ptr<osg::LineWidth> myScribeWidth;
270 
271  osg::ref_ptr<osg::Group> myFrontTransparentGroup;
272  osg::ref_ptr<osg::Group> myBackTransparentGroup;
273  osg::ref_ptr<osg::Group> myOpaqueGroup;
274  osg::ref_ptr<osg::Group> myMainTransform;
275 
279  osg::ref_ptr<osg::Vec3Array> myFaces;
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 }

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)