VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Dt3DLineModelInstanceSegment.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtAttachableLineModelInstanceSegment_H_
11 #define DtAttachableLineModelInstanceSegment_H_
12 
13 #include <vrvOsg/vrvOsg.h>
15 
16 #include <osg/Billboard>
17 #include <osg/MatrixTransform>
18 
19 namespace makVrv
20 {
26  {
27  public:
30 
33 
35  virtual void setStartPoint(const osg::Vec3d& startPoint);
36 
38  virtual void setEndPoint(const osg::Vec3d& endPoint);
39 
40  const osg::Vec3d& startPoint() const
41  {
42  return myState.startPoint;
43  }
44 
45  const osg::Vec3d& endPoint() const
46  {
47  return myState.endPoint;
48  }
49 
51  virtual void setColor(const osg::Vec4& color);
52 
54  virtual void setVertexColor( unsigned int vertexIndex, const osg::Vec4& color );
55 
57  virtual void setStartArrow(bool arrowEnabled);
58 
60  virtual void setEndArrow(bool arrowEnabled);
61 
63  virtual void setLightningStyle(bool lightningStyle);
64 
66  virtual void setWidth(double width);
67 
69  virtual double width() const;
70 
72  virtual void setStipplePattern(unsigned int stipplePattern, int repeatFactor);
73 
75  virtual osg::Node* rootNode();
76 
77  const std::vector<osg::Vec3>& pickableVertices() const;
78 
80  virtual void update();
81 
83  virtual void updateGeometry();
84 
85  protected:
86 
88  virtual void build();
89 
93  virtual void calculateArrowVertices(
94  const osg::Vec3d& segmentStart, const osg::Vec3d& segmentEnd,
95  osg::Vec3d& arrowStartOut, osg::Vec3d& arrowEndOut);
96 
98  virtual void buildVertices();
99 
101  virtual void buildLinePrimitive();
102 
104  virtual void buildPickableVertices();
105 
107  virtual void buildColorArray();
108 
112  virtual unsigned int startArrowVertexIndex();
113 
117  virtual unsigned int endArrowVertexIndex();
118 
122  virtual unsigned int lightningVertexIndex();
123 
124  protected:
125 
128  {
129  osg::Vec3d startPoint;
130  osg::Vec3d endPoint;
131  osg::Vec4 color[2];
133  bool endArrow;
134  bool lightning;
135  double width;
136  unsigned int stipplePattern;
137  };
138 
140 
143 
150  };
151 }
152 
153 #endif
154 
osg::Vec3d endPoint
Definition: Dt3DLineModelInstanceSegment.h:130
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::ref_ptr< osg::Billboard > myGeode
Definition: Dt3DLineModelInstanceSegment.h:144
bool startArrow
Definition: Dt3DLineModelInstanceSegment.h:132
bool lightning
Definition: Dt3DLineModelInstanceSegment.h:134
bool endArrow
Definition: Dt3DLineModelInstanceSegment.h:133
osg::ref_ptr< osg::Geometry > myGeometry
Definition: Dt3DLineModelInstanceSegment.h:145
const osg::Vec3d & startPoint() const
Definition: Dt3DLineModelInstanceSegment.h:40
LineSegmentState myState
Definition: Dt3DLineModelInstanceSegment.h:139
Structure to contain the line segment&#39;s state.
Definition: Dt3DLineModelInstanceSegment.h:127
osg::ref_ptr< osg::Vec4Array > myColorArray
Definition: Dt3DLineModelInstanceSegment.h:148
const osg::Vec3d & endPoint() const
Definition: Dt3DLineModelInstanceSegment.h:45
unsigned int stipplePattern
Definition: Dt3DLineModelInstanceSegment.h:136
osg::Vec3d startPoint
Definition: Dt3DLineModelInstanceSegment.h:129
double width
Definition: Dt3DLineModelInstanceSegment.h:135
Helper class to draw a styleable line segment; generates a geode containing the line segment geometry...
Definition: Dt3DLineModelInstanceSegment.h:24
Contains DLL export macros.
bool myGeometryDirty
Definition: Dt3DLineModelInstanceSegment.h:141
osg::ref_ptr< osg::Vec3Array > myVertexArray
Definition: Dt3DLineModelInstanceSegment.h:147
osg::ref_ptr< osg::Vec3Array > myPickableVertices
Definition: Dt3DLineModelInstanceSegment.h:146
bool myIndexBufferDirty
Definition: Dt3DLineModelInstanceSegment.h:142
Contains makVrv::Dt3DLineModelInstanceSegmentInterface class.
osg::ref_ptr< osg::DrawElementsUInt > myLinePrimitive
Definition: Dt3DLineModelInstanceSegment.h:149
Dt3DLineModelInstanceSegmentInterface is an abstract class providing a common interface for line mode...
Definition: Dt3DLineModelInstanceSegmentInterface.h:30

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)