VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 
142 
143  osg::ref_ptr<osg::Billboard> myGeode;
144  osg::ref_ptr<osg::Geometry> myGeometry;
145  osg::ref_ptr<osg::Vec3Array> myPickableVertices;
146  };
147 }
148 
149 #endif
150 

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)