![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /***************************************************************************** 00002 * Copyright (c) 2010 MAK Technologies, Inc. 00003 * All rights reserved. 00004 *****************************************************************************/ 00005 /***************************************************************************** 00006 * $RCSfile: DtSegmentedLine.h,v $ $Revision: 1.0 $ $State: Exp $ 00007 *****************************************************************************/ 00008 00012 00013 #pragma once 00014 #include <vrvGraphics/vrvGraphics.h> 00015 00016 namespace makVrv 00017 { 00018 00019 class DtOverlayRenderer; 00020 class DtWidgetPicker; 00021 class DtLineRenderer; 00022 class DtLineSegment; 00023 class DtPickableLine; 00024 00027 class DT_DLL_VRVGRAPHICS DtSegmentedLine 00028 { 00029 public: 00030 00032 DtSegmentedLine(DtOverlayRenderer& renderer,DtWidgetPicker& picker); 00033 00035 DtSegmentedLine(DtLineRenderer& renderer,DtWidgetPicker& picker); 00036 00038 virtual ~DtSegmentedLine(); 00039 00044 void setEventsEnabled(bool enabled, unsigned long long userData = 0); 00045 00047 bool eventsEnabled() const; 00048 00053 virtual void setVertexCount(unsigned int vertexCount); 00054 00057 virtual unsigned int vertexCount() const; 00058 00060 virtual unsigned int segmentCount() const; 00061 00063 virtual void set2DPosition(unsigned int vertexIndex, float x1, float y1); 00064 00066 virtual void get2DPosition(unsigned int vertexIndex, float& x, float& y) const; 00067 00071 virtual void set3DPosition(unsigned int vertexIndex, float x, float y, float z, float w); 00072 00074 virtual void get3DPosition(unsigned int vertexIndex, float& x, float& y, float& z, float& w) const; 00075 00077 virtual void set3DDirection(unsigned int vertexIndex, float x, float y, float z); 00078 00080 virtual void get3DDirection(unsigned int vertexIndex, float& x, float& y, float& z) const; 00081 00083 virtual void setDirection2DLength(unsigned int vertexIndex, float length); 00084 00086 virtual float direction2DLength(unsigned int vertexIndex) const; 00087 00089 virtual void setSegmentColor(unsigned int segment, float r, float g, float b, float a); 00090 00092 virtual void setPointColor(unsigned int point, float r, float g, float b, float a); 00093 00095 virtual void setStipplePattern(unsigned int segment, unsigned int pattern); 00096 00098 virtual void setWidth(unsigned int segment, float w); 00099 00103 virtual void setEventWidth(float); 00104 00105 protected: 00106 00107 typedef std::vector<DtLineSegment*> LineSegmentList; 00108 typedef std::vector<DtPickableLine*> PickableSegmentList; 00109 00110 DtLineRenderer& myRenderer; 00111 DtWidgetPicker& myPicker; 00112 LineSegmentList myLineSegments; 00113 PickableSegmentList myPickableSegments; 00114 bool myEventsEnabled; 00115 unsigned int myVertexCount; 00116 unsigned long long myUserData; 00117 float myEventWidth; 00118 }; 00119 }