VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Types | Protected Attributes
makVrv::DtFilledPolygon Class Reference

A variable vertex convex filled 2D polygon. More...

Inheritance diagram for makVrv::DtFilledPolygon:
Inheritance graph
[legend]

Public Types

enum  FillType { Fill_Solid = 0, Fill_Stipple, FillType_End }

Public Member Functions

 DtFilledPolygon (DtOverlayRenderer &renderer, DtWidgetPicker &picker)
 CTOR, takes render the overlay will be on.
 DtFilledPolygon (DtTriangleRenderer &renderer, DtWidgetPicker &picker)
 CTOR, takes render the triangle render that will draw the polygon.
virtual ~DtFilledPolygon ()
 DTOR.
virtual void setFillType (FillType type)
 Set the quad fill type.
virtual FillType fillType () const
 Get the fill type.
virtual void setFillParameter (unsigned int param, unsigned int fullStipplePattern[32]=0)
 Set the quad fill parameter.
virtual void clearFillPattern ()
 Clears the fill pattern of the quad.
virtual void getFillParameter (unsigned int &paramOut, unsigned int fullStipplePatternOut[32]) const
 Get the quad fill parameters.
virtual void setEventsEnabled (bool enabled, unsigned long long=0)
 Set whether the sprite has widget events.
bool eventsEnabled () const
 Get whether events are already enabled.
virtual void setVertexCount (unsigned int vertexCount)
 Set the number of vertices, any newly created vertices will be black and add 0,0,0 so setColor/setPosition may be necessary.
virtual unsigned int vertexCount () const
 Get the vertex count.
virtual void set2DPositions (const std::vector< float > &vertices)
 Set the number of vertices and their positions.
virtual void set2DPosition (unsigned int vertexIndex, float x, float y)
 Set one vertex position.
virtual void set2DCentroidPosition (float x, float y)
 Sets the position of the polygon's centroid.
virtual void get2DPosition (unsigned int vertexIndex, float &x, float &y) const
 Get the vertex position.
virtual void set3DPosition (unsigned int vertexIndex, float x, float y, float z, float w)
 Set one vertex position.
virtual void set3DCentroidPosition (float x, float y, float z, float w)
 Sets the position of the polygon's centroid.
virtual void get3DPosition (unsigned int index, float &x, float &y, float &z, float &w) const
 Get the vertex position.
void set3DDirectionAndLength (unsigned int index, float x, float y, float z, float l)
 Sets an optional 3D direction with a 2D length value for a vertex.
virtual void setStipple (unsigned int stipplePattern)
 Set the stipple pattern.
virtual void setVertexColor (unsigned int index, float r, float g, float b, float a)
 Set the color of a specific vertex.
virtual void getVertexColor (unsigned int index, float &r, float &g, float &b, float &a)
 TODO document.
virtual void setCentroidColor (float r, float g, float b, float a)
 Set the color of the polygon's centroid.
virtual void setColor (float r, float g, float b, float a)
 Set the color.
virtual void getColor (float &r, float &g, float &b, float &a) const
 Get the color.
virtual int group () const
 Returns the group that the polygon is on (for Z-Ordering). Default is zero.
virtual void setGroup (int)
 Sets the group for Z-Ordering.
virtual void triangulate ()
 As long as there are a divisible by three of triangle proxies, reworks them to be a triangle of three related points, using the center as an anchor point.
- Public Member Functions inherited from makVrv::DtPolygon
virtual ~DtPolygon ()

Protected Types

typedef std::vector< float > VertexList
typedef std::vector
< DtTriangleProxy * > 
TriangleProxyList
typedef std::vector
< DtPickableTriangle * > 
PickableTriangleList

Protected Attributes

DtTriangleRenderermyRenderer
DtWidgetPickermyPicker
bool myEventsEnabled
unsigned long long myUserData
VertexList myVertices
VertexList my3DVertices
float myCenterPoint [2]
double my3DCenterPoint [3]
TriangleProxyList myTriangles
PickableTriangleList myPickableTriangles
unsigned int myFillParam
unsigned int myFullStipplePattern [32]
FillType myFillType
int myGroup

Detailed Description

A variable vertex convex filled 2D polygon.

Member Typedef Documentation

typedef std::vector<float> makVrv::DtFilledPolygon::VertexList
protected

Member Enumeration Documentation

Enumerator:
Fill_Solid 
Fill_Stipple 
FillType_End 

Constructor & Destructor Documentation

makVrv::DtFilledPolygon::DtFilledPolygon ( DtOverlayRenderer renderer,
DtWidgetPicker picker 
)

CTOR, takes render the overlay will be on.

makVrv::DtFilledPolygon::DtFilledPolygon ( DtTriangleRenderer renderer,
DtWidgetPicker picker 
)

CTOR, takes render the triangle render that will draw the polygon.

virtual makVrv::DtFilledPolygon::~DtFilledPolygon ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtFilledPolygon::setFillType ( FillType  type)
virtual

Set the quad fill type.

Calling fill type resets the fill parameter, thus the fill parameter must be reset after calling setFillType.

virtual FillType makVrv::DtFilledPolygon::fillType ( ) const
virtual

Get the fill type.

virtual void makVrv::DtFilledPolygon::setFillParameter ( unsigned int  param,
unsigned int  fullStipplePattern[32] = 0 
)
virtual

Set the quad fill parameter.

In Texture mode the parameter is the texture index. If the full stippledPattern (aka a full 32x32 bit array) the initial param is ignored.

virtual void makVrv::DtFilledPolygon::clearFillPattern ( )
virtual

Clears the fill pattern of the quad.

virtual void makVrv::DtFilledPolygon::getFillParameter ( unsigned int &  paramOut,
unsigned int  fullStipplePatternOut[32] 
) const
virtual

Get the quad fill parameters.

virtual void makVrv::DtFilledPolygon::setEventsEnabled ( bool  enabled,
unsigned long  long = 0 
)
virtual

Set whether the sprite has widget events.

Disabling events disconnects all of the DtFilledPolygon signals The user data is set when enabling the events, to change only the user data make multiple calls with enabled=true

Implements makVrv::DtPolygon.

bool makVrv::DtFilledPolygon::eventsEnabled ( ) const

Get whether events are already enabled.

virtual void makVrv::DtFilledPolygon::setVertexCount ( unsigned int  vertexCount)
virtual

Set the number of vertices, any newly created vertices will be black and add 0,0,0 so setColor/setPosition may be necessary.

Implements makVrv::DtPolygon.

virtual unsigned int makVrv::DtFilledPolygon::vertexCount ( ) const
virtual

Get the vertex count.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::set2DPositions ( const std::vector< float > &  vertices)
virtual

Set the number of vertices and their positions.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::set2DPosition ( unsigned int  vertexIndex,
float  x,
float  y 
)
virtual

Set one vertex position.

NOTE it is much more efficient to update all vertices using setPositions if several change.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::set2DCentroidPosition ( float  x,
float  y 
)
virtual

Sets the position of the polygon's centroid.

virtual void makVrv::DtFilledPolygon::get2DPosition ( unsigned int  vertexIndex,
float &  x,
float &  y 
) const
virtual

Get the vertex position.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::set3DPosition ( unsigned int  vertexIndex,
float  x,
float  y,
float  z,
float  w 
)
virtual

Set one vertex position.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::set3DCentroidPosition ( float  x,
float  y,
float  z,
float  w 
)
virtual

Sets the position of the polygon's centroid.

virtual void makVrv::DtFilledPolygon::get3DPosition ( unsigned int  index,
float &  x,
float &  y,
float &  z,
float &  w 
) const
virtual

Get the vertex position.

Implements makVrv::DtPolygon.

void makVrv::DtFilledPolygon::set3DDirectionAndLength ( unsigned int  index,
float  x,
float  y,
float  z,
float  l 
)
virtual

Sets an optional 3D direction with a 2D length value for a vertex.

Parameters
indexthe index of the vertex to get the position of
xx component of the position
yy component of the position
zz component of the position
ll length of the vector offset in 2D.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::setStipple ( unsigned int  stipplePattern)
virtual

Set the stipple pattern.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::setVertexColor ( unsigned int  index,
float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color of a specific vertex.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::getVertexColor ( unsigned int  index,
float &  r,
float &  g,
float &  b,
float &  a 
)
virtual

TODO document.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::setCentroidColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color of the polygon's centroid.

virtual void makVrv::DtFilledPolygon::setColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::getColor ( float &  r,
float &  g,
float &  b,
float &  a 
) const
virtual

Get the color.

Implements makVrv::DtPolygon.

virtual int makVrv::DtFilledPolygon::group ( ) const
virtual

Returns the group that the polygon is on (for Z-Ordering). Default is zero.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::setGroup ( int  )
virtual

Sets the group for Z-Ordering.

Implements makVrv::DtPolygon.

virtual void makVrv::DtFilledPolygon::triangulate ( )
virtual

As long as there are a divisible by three of triangle proxies, reworks them to be a triangle of three related points, using the center as an anchor point.

Member Data Documentation

DtTriangleRenderer& makVrv::DtFilledPolygon::myRenderer
protected
DtWidgetPicker& makVrv::DtFilledPolygon::myPicker
protected
bool makVrv::DtFilledPolygon::myEventsEnabled
protected
unsigned long long makVrv::DtFilledPolygon::myUserData
protected
VertexList makVrv::DtFilledPolygon::myVertices
protected
VertexList makVrv::DtFilledPolygon::my3DVertices
protected
float makVrv::DtFilledPolygon::myCenterPoint[2]
protected
double makVrv::DtFilledPolygon::my3DCenterPoint[3]
protected
TriangleProxyList makVrv::DtFilledPolygon::myTriangles
protected
PickableTriangleList makVrv::DtFilledPolygon::myPickableTriangles
protected
unsigned int makVrv::DtFilledPolygon::myFillParam
protected
unsigned int makVrv::DtFilledPolygon::myFullStipplePattern[32]
protected
FillType makVrv::DtFilledPolygon::myFillType
protected
int makVrv::DtFilledPolygon::myGroup
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)