VR-Forces 4.1 Class Documentation
DtPolygonModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtAttachablePolygonModelInstance_H_
11 #define DtAttachablePolygonModelInstance_H_
12 
13 #include <vrvOsg/vrvOsg.h>
15 
16 #include <osg/Geode>
17 #include <osg/MatrixTransform>
18 
19 #include <vector>
20 
21 namespace osg
22 {
23  class LineWidth;
24 }
25 
26 namespace makVrv
27 {
31  : public DtOsgModelInstance
32  {
33  public:
34 
36  {
37  float rColor; // RGBA red value
38  float gColor; // RGBA green value
39  float bColor; // RGBA blue value
40  float aColor; // RGBA alpha value
41  std::string texturePath; // Path to texture file
42  double numTextureTiles; // Number of times to tile the texture
43  };
44 
47 
50 
52  virtual ~DtPolygonModelInstance();
53 
55  virtual bool realize( DtModelDefinition& definition );
56 
58  virtual void setColor(float r,float g,float b,float a);
59 
61  virtual void setPosition( int vtx, const DtVector& position );
62 
68  virtual void setTexturePath(const std::string& texturePath);
69 
71  virtual void setNumTextureTiles(double numTiles);
72 
74  virtual void setOrientation( int vtx, const DtTaitBryan& orientation );
75 
77  virtual void addToConnector( DtOsgSceneConnector* connector );
78 
80  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
81 
83  virtual void setVisible(bool isVisible) {}
84 
86  virtual void addPoint(const DtVector& point,int index);
87 
89  virtual void setLockUpdates(bool lock);
90  bool updatesLocked() const
91  {
92  return myIsLocked;
93  }
94 
96  virtual void setPickable(bool enabled);
97 
99  virtual void removePoint(int index);
100 
102  virtual void setStipplePattern(unsigned int stipplePattern);
103 
105  virtual void setWidth(float width);
106 
108  virtual int pointCount() const;
109 
111  virtual DtVector point(int) const;
112 
113  protected:
114 
116  virtual void buildGeometry(const AttachablePolygonParameters& parameters);
117 
119  virtual void buildState(const AttachablePolygonParameters& parameters);
120 
121  protected:
122  osg::ref_ptr<osg::LineWidth> myLineWidth;
123 
126 
127  typedef std::vector<osg::Vec3> VertexList;
129 
130  osg::ref_ptr<osg::Geode> myGeode;
131 
135  };
136 }
137 
138 #endif
139 

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)