VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtPolygonModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
15 #include <osg/Geode>
16 #include <osg/MatrixTransform>
17 
18 #include <vector>
19 
20 namespace osg
21 {
22  class LineWidth;
23  class Material;
24  class BlendFunc;
25 }
26 
27 namespace makVrv
28 {
32  : public DtOsgModelInstance
33  {
34  public:
35  typedef std::vector<DtVector> VertexList;
36 
38  {
39  float rColor; // RGBA red value
40  float gColor; // RGBA green value
41  float bColor; // RGBA blue value
42  float aColor; // RGBA alpha value
43  std::string texturePath; // Path to texture file
44  double numTextureTiles; // Number of times to tile the texture
45  bool colorBlending; // Is the polygon color blended
46  bool lit; // Is the polygon lit
47  };
48 
51 
54 
56  virtual ~DtPolygonModelInstance();
57 
59  virtual bool realize( DtModelDefinition& definition );
60 
62  virtual void setColor(float r,float g,float b,float a);
63 
65  virtual void enableLighting( bool lit );
66 
68  virtual void enableColorBlending( bool colorBlend );
69 
71  virtual void setPosition( int vtx, const DtVector& position );
72 
78  virtual void setTexturePath(const std::string& texturePath);
79 
81  virtual void setNumTextureTiles(double numTiles);
82 
84  virtual void setOrientation( int vtx, const DtTaitBryan& orientation );
85 
87  virtual void addToConnector( DtOsgSceneConnector* connector );
88 
90  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
91 
93  virtual void setVisible(bool isVisible) {}
94 
96  virtual void addPoint(const DtVector& point,int index);
97 
99  virtual void setLockUpdates(bool lock);
100  bool updatesLocked() const
101  {
102  return myIsLocked;
103  }
104 
106  virtual const VertexList& points() const;
107 
109  virtual void setPickable(bool enabled);
110 
112  virtual void removePoint(int index);
113 
115  virtual void setStipplePattern(unsigned int stipplePattern);
116 
118  virtual void setWidth(float width);
119 
121  virtual int pointCount() const;
122 
124  virtual DtVector point(int) const;
125 
126  protected:
127 
129  virtual void buildGeometry(const AttachablePolygonParameters& parameters);
130 
132  virtual void buildState(const AttachablePolygonParameters& parameters);
133 
134  protected:
135  osg::ref_ptr<osg::LineWidth> myLineWidth;
136  osg::ref_ptr<osg::Material> myMaterial;
137  osg::ref_ptr<osg::BlendFunc> myBlendFunc;
138 
141 
143 
144  osg::ref_ptr<osg::Geode> myGeode;
145 
149  };
150 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)