VR-Forces Developer's Guide
 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) 2023 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 
49  public:
50 
53 
55  virtual ~DtPolygonModelInstance();
56 
57  private:
58 
61 
64 
67 
68  public:
69 
73  virtual bool realize(const DtModelDefinition& definition );
74 
76  virtual void setColor(float r,float g,float b,float a);
77 
79  virtual void enableLighting( bool lit );
80 
82  virtual void enableColorBlending( bool colorBlend );
83 
85  virtual void setPosition( int vtx, const DtVector& position );
86 
92  virtual void setTexturePath(const std::string& texturePath);
93 
95  virtual void setNumTextureTiles(double numTiles);
96 
98  virtual void setOrientation( int vtx, const DtTaitBryan& orientation );
99 
101  virtual void addToConnector( DtOsgSceneConnector* connector );
102 
104  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
105 
107  virtual void setVisible(bool isVisible) {}
108 
110  virtual void addPoint(const DtVector& point,int index);
111 
113  virtual const VertexList& points() const;
114 
116  virtual void setPickable(bool enabled);
117 
119  virtual void removePoint(int index);
120 
122  virtual void setStipplePattern(unsigned int stipplePattern);
123 
125  virtual void setWidth(float width);
126 
128  virtual int pointCount() const;
129 
131  virtual DtVector point(int) const;
132 
134  virtual void updateGeometry();
135 
136  public:
139 
140  protected:
141 
143  virtual void buildGeometry(const AttachablePolygonParameters& parameters);
144 
146  virtual void buildState(const AttachablePolygonParameters& parameters);
147 
148  protected:
149 
153 
156 
158 
160  };
161 }
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:155
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:42
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:77
osg::ref_ptr< osg::LineWidth > myLineWidth
Definition: DtPolygonModelInstance.h:150
virtual void setVisible(bool isVisible)
no-op
Definition: DtPolygonModelInstance.h:107
std::string texturePath
Definition: DtPolygonModelInstance.h:43
osg::ref_ptr< osg::Material > myMaterial
Definition: DtPolygonModelInstance.h:151
The base class for simple OSG based model instances. This call can&#39;t be instantiated itself...
Definition: DtOsgModelInstance.h:77
VertexList myVertices
Definition: DtPolygonModelInstance.h:157
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:138
osg::ref_ptr< osg::BlendFunc > myBlendFunc
Definition: DtPolygonModelInstance.h:152
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
osg::ref_ptr< osg::Geode > myGeode
Definition: DtPolygonModelInstance.h:159

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)