VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtPolygonModelInstance.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 <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 const VertexList& points() const;
100 
102  virtual void setPickable(bool enabled);
103 
105  virtual void removePoint(int index);
106 
108  virtual void setStipplePattern(unsigned int stipplePattern);
109 
111  virtual void setWidth(float width);
112 
114  virtual int pointCount() const;
115 
117  virtual DtVector point(int) const;
118 
120  virtual void updateGeometry();
121 
122  protected:
123 
125  virtual void buildGeometry(const AttachablePolygonParameters& parameters);
126 
128  virtual void buildState(const AttachablePolygonParameters& parameters);
129 
130  protected:
131  osg::ref_ptr<osg::LineWidth> myLineWidth;
132  osg::ref_ptr<osg::Material> myMaterial;
133  osg::ref_ptr<osg::BlendFunc> myBlendFunc;
134 
137 
139 
140  osg::ref_ptr<osg::Geode> myGeode;
141  };
142 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)