VR-Forces 4.8 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:
134 
137 
139 
141  };
142 }
float bColor
Definition: DtPolygonModelInstance.h:41
std::vector< DtVector > VertexList
Definition: DtPolygonModelInstance.h:35
double numTextureTiles
Definition: DtPolygonModelInstance.h:44
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Model instance to draw a polygon.
Definition: DtPolygonModelInstance.h:31
AttachablePolygonParameters myParameters
The current parameter set.
Definition: DtPolygonModelInstance.h:136
bool lit
Definition: DtPolygonModelInstance.h:46
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:33
float rColor
Definition: DtPolygonModelInstance.h:39
float aColor
Definition: DtPolygonModelInstance.h:42
Contains makVrv::DtOsgModelInstance class.
DtOsgSceneConnector is used by models to create an OSG position/orientation transform so that it can ...
Definition: DtOsgSceneConnector.h:76
osg::ref_ptr< osg::LineWidth > myLineWidth
Definition: DtPolygonModelInstance.h:131
virtual void setVisible(bool isVisible)
no-op
Definition: DtPolygonModelInstance.h:93
std::string texturePath
Definition: DtPolygonModelInstance.h:43
osg::ref_ptr< osg::Material > myMaterial
Definition: DtPolygonModelInstance.h:132
The base class for simple OSG based model instances.
Definition: DtOsgModelInstance.h:72
VertexList myVertices
Definition: DtPolygonModelInstance.h:138
float gColor
Definition: DtPolygonModelInstance.h:40
bool colorBlending
Definition: DtPolygonModelInstance.h:45
static const AttachablePolygonParameters defaultParameters
Default values for the polygon parameters.
Definition: DtPolygonModelInstance.h:50
osg::ref_ptr< osg::BlendFunc > myBlendFunc
Definition: DtPolygonModelInstance.h:133
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
osg::ref_ptr< osg::Geode > myGeode
Definition: DtPolygonModelInstance.h:140

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)