![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2012 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 00009 00010 #pragma once 00011 00012 #include <vrvOsg/vrvOsg.h> 00013 #include <vrvOsg/DtOsgModelInstance.h> 00014 00015 namespace makVrv 00016 { 00017 class DtLineSegment; 00018 00021 class DT_DLL_VRVOSG DtOsgOverlayDirectionLineModelInstance 00022 : public DtOsgModelInstance 00023 { 00024 public: 00025 00027 DtOsgOverlayDirectionLineModelInstance(DtDe& de); 00028 00030 virtual ~DtOsgOverlayDirectionLineModelInstance(); 00031 00033 virtual void setVisible(bool); 00034 00036 virtual void setModelSet( int modelSet ); 00037 00044 virtual void addPoint(const DtVector& position, int index = -1); 00045 00047 virtual void setPosition(int index, const DtVector& position); 00048 00050 virtual void setStipplePattern(unsigned int stipple); 00051 00053 virtual void setColor(float r, float g, float b, float a); 00054 00056 virtual void setWidth(float width); 00057 00059 virtual void setEventsEnabled(bool, unsigned long long userData); 00060 00062 bool eventsEnabled() const; 00063 00065 virtual void setPositionOffset(const DtVector&); 00066 00068 virtual void setDirection( int index, const DtVector& direction ); 00069 00072 virtual void setLength( int index, float length ); 00073 00075 virtual void update(); 00076 00079 virtual bool realize(DtModelDefinition& definition); 00080 00081 00082 protected: 00084 virtual void createLineIfNecessary(); 00085 00087 virtual void updateAttributes(); 00088 00090 virtual void updateGeometry(); 00091 00093 virtual void set3DVertexPosition( unsigned int index, double x, double y, double z ); 00094 00095 protected: 00096 00097 struct DirectionAttributes 00098 { 00099 DirectionAttributes() 00100 : direction() 00101 , length(0.0f) 00102 { 00103 } 00104 00105 DtVector direction; 00106 float length; 00107 }; 00108 00109 00110 DtVector myPoints[2]; 00111 DirectionAttributes myDirections[2]; 00112 unsigned int myModelSet; 00113 DtLineSegment* myLine; 00114 00115 osg::Vec4 myColor; 00116 float myWidth; 00117 unsigned int myStipplePattern; 00118 00119 bool myGeometryDirty; 00120 bool myAttributesDirty; 00121 bool myEventsEnabled; 00122 bool myVisibleFlag; 00123 unsigned long long myUserData; 00124 00125 00126 DtVector myPositionOffset; 00127 }; 00128 } 00129 00130