VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtRectangularPyramidModelInstance.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2015 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
16 #include <osg/MatrixTransform>
17 #include <osg/Geometry>
18 #include <osg/Group>
19 
20 namespace makVrv
21 {
22  class DtDe;
23  class DtModelInstance;
24  class DtModelDefinition;
25  class DtOsgSceneConnector;
26 
31  {
32  public:
33 
38 
42 
43 
46 
49  virtual void addToConnector( makVrv::DtOsgSceneConnector* connector );
50 
53  virtual bool removeFromConnector( makVrv::DtOsgSceneConnector* connector );
54 
57  virtual bool realize( makVrv::DtModelDefinition& definition );
58 
61  virtual void setVisible( bool isVisible ) {}
62 
64 
67 
73  virtual void setRelativePosition( double x, double y, double z );
74 
80  virtual void setOrientation( double yaw, double pitch, double roll );
81 
84  virtual void setSize( double slantHeight );
85 
92  virtual void setColor( float r, float g, float b, float a );
93 
100  void setInnerColor( float r, float g, float b, float a );
101 
108  void setOuterColor( float r, float g, float b, float a );
109 
112  virtual void setXHalfAngle( double xHalfAngle );
113 
116  virtual void setYHalfAngle( double yHalfAngle );
117 
122  virtual void setShowLines( bool showLines );
123 
128  virtual void setLinesHaveAlpha( bool lineAlpha );
129 
131 
133  void update();
134 
135  protected:
136 
139 
143  virtual void updateGeometry();
144 
148  virtual void updateGeometryColors();
149 
152  virtual void updateGeometryWireframeState();
153 
157  virtual void updateGeometryTransforms();
158 
160 
161  protected:
162 
167  static void clampAngle( double& val, double minAngle, double maxAngle );
168 
169  protected:
170 
171  osg::ref_ptr<osg::MatrixTransform> myTransform;
172  osg::ref_ptr<osg::Group> myBlendNode;
173  osg::ref_ptr<osg::Group> myWireNode;
174  osg::ref_ptr<osg::Geometry> myGeometry;
175  osg::ref_ptr<osg::Geode> myFrontGeode;
176  osg::ref_ptr<osg::Geode> myBackGeode;
177 
182 
183  osg::Vec3d myRelativePosition;
185  osg::Vec3d myDimensions;
186  double myXHalfAngle;
187  double myYHalfAngle;
188 
190  osg::Vec4 myInnerColor;
191  osg::Vec4 myOuterColor;
192 
195 
196  };
197 
198 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)