![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2010 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00006 00007 #pragma once 00008 #include <vrvGraphics/vrvGraphics.h> 00009 00010 namespace makVrv 00011 { 00012 class DtLineSegmentProxy; 00013 class DtLineRenderer; 00014 class DtOverlayRenderer; 00015 00018 class DT_DLL_VRVGRAPHICS DtLineSegment 00019 { 00020 public: 00021 00022 const static unsigned short NoStipple = 0xFFFF; 00023 const static unsigned short NoLine = 0x0; 00024 00026 DtLineSegment(DtOverlayRenderer& renderer); 00027 00029 DtLineSegment(DtLineRenderer& renderer); 00030 00032 ~DtLineSegment(); 00033 00038 void setGroup(float group); 00039 00041 int group() const; 00042 00044 void set2DPositions(float x1, float y1,float x2, float y2); 00045 00047 void set2DPosition(unsigned int index0or1, float x, float y); 00048 00049 //Set the position of the vertex. 00050 void get2DPosition(unsigned int index0or1, float& x, float& y ) const; 00051 00053 void setFirstPosition(float x, float y); 00054 00056 void setSecondPosition(float x, float y); 00057 00059 void setColors(float r1, float g1, float b1, float a1, 00060 float r2, float g2, float b2, float a2); 00061 00064 void set3DPosition(int index0or1,float dx, float dy, float z, float w); 00065 00066 //Get the 3D position of the line. 00067 void get3DPosition(int index0or1,float& dx, float& dy, float& z, float& w) const; 00068 00070 virtual void set3DDirection(unsigned int index0or1, float x, float y, float z); 00071 00073 virtual void get3DDirection(unsigned int index0or1, float& x, float& y, float& z) const; 00074 00076 virtual void setDirection2DLength(unsigned int index0or1, float length); 00077 00079 virtual float direction2DLength(unsigned int index0or1) const; 00080 00081 //Set the vertex color. 00082 void setColor(unsigned int index0or1,float r, float g, float b, float a); 00083 00084 //Get the vertex color. 00085 void getColor(unsigned int index0or1,float& r, float& g, float& b, float& a) const; 00086 00087 //Set the first vertex color. 00088 void setColor1(float r1, float g1, float b1, float a1); 00089 00090 //Set the second vertex color. 00091 void setColor2(float r2, float g2, float b2, float a2); 00092 00093 //Set the line color. 00094 inline void setColor(float r, float g, float b, float a) 00095 { 00096 setColors(r,g,b,a,r,g,b,a); 00097 } 00098 00101 void setWidth(float w); 00102 00104 float width() const; 00105 00112 void setStippleParameters(unsigned int scale,unsigned short pattern); 00113 00116 void getStippleParameters(unsigned int& scale, unsigned short& pattern) const; 00117 00118 private: 00119 00120 DtLineSegment(const DtLineSegment&); 00121 DtLineSegment& operator=(const DtLineSegment&); 00122 00123 private: 00124 DtLineSegmentProxy* myProxy; 00125 00126 protected: 00127 DtLineSegment() : myProxy(0) {} 00128 }; 00129 00130 }