VR-Forces 4.1 Class Documentation
DtOsgOverlayPolygonModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 #include <osg/Vec4>
15 #include <osg/Vec3>
16 #include <osg/Quat>
17 #include <vector>
19 
20 #include <osg/Texture>
21 
22 namespace makVrv
23 {
24  class DtPolygon;
25  class DtChannelManager;
26  class DtChannel;
27 
31  {
32  public:
33  struct VertexData
34  {
36  : my3DPos()
37  {
38  my2DOffset[0] = 0.0f;
39  my2DOffset[1] = 0.0f;
40  }
41 
42  osg::Vec3d my3DPos;
43  osg::Vec3d my3DOffset;
44  float my2DLength;
45  float my2DOffset[2];
46  };
47  typedef std::vector<VertexData> VertexList;
48 
49  public:
52 
55 
58  virtual void setModelSet(int);
59 
61  virtual void setPosition( int vtx, const DtVector& position );
62 
64  virtual void setRotation(const osg::Quat& quat);
65 
67  virtual void setOrigin(const DtVector&);
68 
70  virtual DtVector origin() const;
71 
73  virtual void addPoint(const DtVector& point,int index);
74 
76  virtual void removePoint(int index);
77 
79  virtual void set2dOffset(int index, float x, float y);
80 
83  virtual void set3dDirection2dLength( int index, float x, float y, float z,
84  float len );
85 
87  virtual void setColor(float r,float g,float b,float a);
88 
94  virtual void setTexturePath(const std::string& texturePath);
95 
97  virtual void setOutlineTexture(const std::string& texturePath);
98 
100  virtual void setOutlineTexture(osg::Texture* texture);
101 
103  virtual void setSolidFillCenter(bool);
104 
106  virtual void setNumTextureTiles(double numTiles);
107 
109  virtual void setStipplePattern(unsigned int stipplePattern);
110 
112  virtual void setWidth(float width);
113 
115  virtual void setEventWidth(float width);
116 
118  virtual void setVisible(bool isVisible);
119 
121  virtual void setLockUpdates(bool lock);
122 
124  bool updatesLocked() const;
125 
127  virtual void setPickable(bool enabled);
128 
130  virtual void setEventsEnabled(bool, unsigned long long userData);
131 
133  bool eventsEnabled() const;
134 
136  virtual void setFill(bool);
137 
139  virtual void setInsideColor( float r, float g, float b, float a );
140 
142  virtual void setOutsideColor( float r, float g, float b, float a );
143 
145  virtual int pointCount() const;
146 
148  virtual DtVector point(int) const;
149 
151  virtual void setFillPattern(const std::vector<unsigned int> pattern);
152 
154  virtual void setOutline(bool);
155 
159  virtual void setChannelInstance(DtChannel*, int modelSet);
160 
162  virtual const VertexList& vertexList() const;
163 
165  virtual void setVertexList(const VertexList&);
166 
167  protected:
169  virtual void createPolygonIfNecessary();
170 
172  virtual void updateGeometry();
173 
175  virtual void updateColors();
176 
178  virtual void translateAndUpdateVertex( unsigned int index, const VertexData& vert, DtPolygon* polygon);
179 
181  virtual void channelUpdated(DtTacticalGraphicModelUpdaterManager::ChannelUpdateData);
182 
184  virtual std::vector<DtVector> topographicVertices() const;
185 
186  // @{
189  virtual bool triangulate(const std::vector<DtVector>& input, std::vector<int>& output) const;
190  virtual bool snipTriangle(const std::vector<DtVector> &contour,int u,int v,int w,int n,int *V) const;
191  virtual bool insideTriangle(float Ax, float Ay,
192  float Bx, float By, float Cx, float Cy, float Px, float Py) const;
193  virtual float triangulateAreaSize(const std::vector<DtVector> &contour) const;
194  // @}
195 
196  protected:
197 
201 
204  bool myFilled;
205 
206  float myWidth;
207  osg::Vec4 myInnerColor;
208  osg::Vec4 myOuterColor;
209  unsigned int myStipplePattern;
211  unsigned long long myUserData;
212 
217  bool myOutline;
219 
220  osg::Vec3d myOrigin;
221  osg::Quat myRotation;
222 
223  osg::ref_ptr<osg::Texture> myOutlineTexture;
224 
226  };
227 }

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)