VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtOsgWindowLineInstance.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>
13 
16 
17 #include <osg/Vec2>
18 #include <osg/Vec4>
19 
20 namespace makVrv
21 {
22  class DtDe;
23  class DtSegmentedLine;
24 
29  {
30  public:
33 
35  virtual ~DtOsgWindowLineInstance();
36 
38  virtual void setVertex(unsigned int vertex, double x, double y );
39 
41  virtual void removeVertex(unsigned int vertex );
42 
44  virtual void setColor(float r, float g, float b, float a);
45 
47  virtual void setStipplePattern(unsigned int stipplePattern);
48 
50  virtual void setWidth(unsigned int width);
51 
54  virtual void setStyleSegments( const std::vector<double>& segmentPercentages );
55 
57  virtual void setSegmentColor(unsigned int index, float r, float g, float b, float a);
58 
61  virtual void setSegmentStartColor(unsigned int index, float r, float g,
62  float b, float a);
63 
66  virtual void setSegmentEndColor(unsigned int index, float r, float g,
67  float b, float a);
68 
70  virtual void setSegmentLightningStyle(unsigned int index, bool enableLightningStyle);
71 
73  virtual void setSegmentStartArrow(unsigned int index, bool enableStartArrow);
74 
76  virtual void setSegmentEndArrow(unsigned int index, bool enableEndArrow);
77 
79  virtual void setSegmentStipplePattern(unsigned int index, unsigned int stipplePattern);
80 
82  virtual void setSegmentWidth(unsigned int index, unsigned int width);
83 
85  virtual void setVisible(bool isVisible);
86 
88  virtual void update();
89 
90  protected:
91 
93  virtual void resizeSegmentAttributes( int size );
94 
96  virtual void createLineIfNecessary();
97 
99  virtual void updateSegments();
100 
102  virtual void updateGeometry();
103 
105  virtual void generateSegment( int segmentIndex, const osg::Vec2& startPoint,
106  const osg::Vec2& endPoint, const osg::Vec2& segmentAxis,
107  const osg::Vec2& segmentPerpendicular );
108 
111  {
112  unsigned int width;
114  bool endArrow;
115  bool lightning;
116  unsigned int stipplePattern;
117  osg::Vec4 color[2];
120  int startColorRange[2];
121  int blendColorRange[2];
122  int endColorRange[2];
125  };
126 
128  virtual void setupColorRanges( SegmentAttributes* segmentAttributes );
129 
132  virtual void setLineSegmentColors( unsigned int vtx,
133  SegmentAttributes* segmentAttributes );
134 
135  protected:
136 
138 
139  typedef std::vector<SegmentAttributes> SegmentAttributesVector;
140  typedef std::vector<osg::Vec2> Points;
141 
142  // These are the points as set by the model
144 
145  // These are the actual vertices, which may be different if style segments are used
147 
149 
151  bool myVisible;
152 
153  osg::Vec4 myColor;
154  float myWidth;
155  unsigned int myStipplePattern;
156  std::vector<double> mySegmentPercentages;
157 
160  };
161 }
162 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)