![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 * Copyright (c) 2010 MAK Technologies, Inc. 00003 * All rights reserved. 00004 *****************************************************************************/ 00005 /***************************************************************************** 00006 * $RCSfile: DtFilledPolygon.h,v $ $Revision: 1.0 $ $State: Exp $ 00007 *****************************************************************************/ 00008 00012 00013 #pragma once 00014 00015 #include <vrvGraphics/vrvGraphics.h> 00016 #include <vrvGraphics/DtPolygon.h> 00017 00018 namespace makVrv 00019 { 00020 00021 class DtOverlayRenderer; 00022 class DtTriangleRenderer; 00023 class DtTriangleProxy; 00024 class DtWidgetPicker; 00025 class DtPickableTriangle; 00026 00029 class DT_DLL_VRVGRAPHICS DtFilledPolygon : public DtPolygon 00030 { 00031 public: 00032 00033 enum FillType 00034 { 00035 Fill_Solid = 0, 00036 Fill_Stipple, 00037 FillType_End 00038 }; 00039 00041 DtFilledPolygon(DtOverlayRenderer& renderer, DtWidgetPicker& picker); 00042 00044 DtFilledPolygon(DtTriangleRenderer& renderer, DtWidgetPicker& picker ); 00045 00047 virtual ~DtFilledPolygon(); 00048 00052 virtual void setFillType(FillType type); 00053 00055 virtual FillType fillType() const; 00056 00061 virtual void setFillParameter( unsigned int param, unsigned int fullStipplePattern[32] = 0 ); 00062 00064 virtual void getFillParameter( unsigned int& paramOut, unsigned int fullStipplePatternOut[32]) const; 00065 00070 virtual void setEventsEnabled(bool enabled, unsigned long long = 0); 00071 00073 bool eventsEnabled() const; 00074 00077 virtual void setVertexCount(unsigned int vertexCount); 00078 00080 virtual unsigned int vertexCount() const; 00081 00083 virtual void set2DPositions( const std::vector<float>& vertices ); 00084 00087 virtual void set2DPosition( unsigned int vertexIndex, float x, float y ); 00088 00090 virtual void set2DCentroidPosition( float x, float y ); 00091 00093 virtual void get2DPosition( unsigned int vertexIndex, float& x, float& y ) const; 00094 00096 virtual void set3DPosition( unsigned int vertexIndex, float x, float y, float z, float w ); 00097 00099 virtual void set3DCentroidPosition( float x, float y, float z, float w ); 00100 00102 virtual void get3DPosition( unsigned int index, float& x, float& y, float& z, float& w ) const; 00103 00104 void set3DDirectionAndLength( unsigned int index, float x, float y, float z, float l ); 00105 00107 virtual void setStipple( unsigned int stipplePattern ); 00108 00110 virtual void setVertexColor( unsigned int index, float r, float g, float b, float a ); 00111 00113 virtual void getVertexColor( unsigned int index, float& r, float& g, float& b, float& a ); 00114 00116 virtual void setCentroidColor( float r, float g, float b, float a ); 00117 00119 virtual void setColor(float r, float g, float b, float a); 00120 00122 virtual void getColor(float& r, float& g, float& b, float& a) const; 00123 00124 protected: 00125 00126 typedef std::vector<float> VertexList; 00127 typedef std::vector<DtTriangleProxy*> TriangleProxyList; 00128 typedef std::vector<DtPickableTriangle*> PickableTriangleList; 00129 00130 DtTriangleRenderer& myRenderer; 00131 DtWidgetPicker& myPicker; 00132 bool myEventsEnabled; 00133 unsigned long long myUserData; 00134 VertexList myVertices; 00135 VertexList my3DVertices; 00136 float myCenterPoint[2]; 00137 double my3DCenterPoint[3]; 00138 TriangleProxyList myTriangles; 00139 PickableTriangleList myPickableTriangles; 00140 unsigned int myFillParam; 00141 unsigned int myFullStipplePattern[32]; 00142 FillType myFillType; 00143 }; 00144 00145 } 00146