VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
makVrv::DtDecalProjectorPolygon Class Reference

A variable vertex convex filled 2D polygon.

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

Classes

struct  Point
 
struct  Triangle
 

Public Member Functions

 DtDecalProjectorPolygon (DtOverlayRendererInterface &renderer, DtWidgetPicker &picker, bool isOutline, bool lineTopology)
 
 DtDecalProjectorPolygon (DtDe &de, DtChannel *channel, DtModelSetId modelSet, bool isOutline, bool lineTopology)
 
virtual ~DtDecalProjectorPolygon ()
 
virtual void setFillType (FillType type)
 
virtual FillType fillType () const
 
virtual void setFillParameter (unsigned int param, unsigned int fullStipplePattern[32]=0) override
 
virtual void clearFillPattern ()
 
virtual void getFillParameter (unsigned int &paramOut, unsigned int fullStipplePatternOut[32]) const override
 
virtual void setFillPatternFrequency (float frequency) override
 
virtual void setFillTexture (DtTextureInterface *textureHandle) override
 
virtual void setEventsEnabled (bool enabled, unsigned long long=0)
 
bool eventsEnabled () const
 
virtual void setVertexCount (unsigned int vertexCount)
 
virtual unsigned int vertexCount () const
 
virtual void set2DPositions (const std::vector< float > &vertices)
 
virtual void set2DPosition (unsigned int vertexIndex, float x, float y)
 
virtual void set2DCentroidPosition (float x, float y)
 
virtual void get2DPosition (unsigned int vertexIndex, float &x, float &y) const
 
virtual void set3DPosition (unsigned int vertexIndex, float x, float y, float z, float w)
 
virtual void set3DCentroidPosition (float x, float y, float z, float w)
 
virtual void get3DPosition (unsigned int index, float &x, float &y, float &z, float &w) const
 
void set3DDirectionAndLength (unsigned int index, float x, float y, float z, float l)
 
virtual void projectUVCoordinates (const DtVector &origin, const DtVector &axisU, const DtVector &axisV, float scale=1.0f) override
 
virtual void setStipple (unsigned int stipplePattern)
 
virtual void setOutlineWidth (float width)
 
virtual void setVertexColor (unsigned int index, float r, float g, float b, float a)
 
virtual void getVertexColor (unsigned int index, float &r, float &g, float &b, float &a)
 
virtual void setCentroidColor (float r, float g, float b, float a)
 
virtual void setColor (float r, float g, float b, float a)
 
virtual void getColor (float &r, float &g, float &b, float &a) const
 
virtual int group () const
 
virtual void setGroup (int)
 
virtual void triangulate () override
 
virtual void triangulationComplete (bool crossingLines) override
 
virtual void set2DPositionsTriangles (const std::vector< float > &vertices)
 
virtual void setVertexCountTriangles (unsigned int vertexCount)
 
virtual void setIsNormalisedScreenCoordinates (bool isNormalisedScreenCoords) override
 
- Public Member Functions inherited from makVrv::DtDecalProjectorPolygonInterface
 DtDecalProjectorPolygonInterface ()
 
virtual ~DtDecalProjectorPolygonInterface ()
 
- Public Member Functions inherited from makVrv::DtFilledPolygonInterface
 DtFilledPolygonInterface ()
 
virtual ~DtFilledPolygonInterface ()
 
- Public Member Functions inherited from makVrv::DtPolygonInterface
 DtPolygonInterface ()=default
 
 DtPolygonInterface (DtPolygonInterface &)=delete
 
 DtPolygonInterface (DtPolygonInterface &&)=delete
 
DtPolygonInterfaceoperator= (DtPolygonInterface &)=delete
 
DtPolygonInterfaceoperator= (DtPolygonInterface &&)=delete
 
virtual ~DtPolygonInterface ()
 

Protected Types

typedef std::vector< float > VertexList
 

Protected Member Functions

virtual void updateDecalProjectorWithTriangles ()
 
virtual void slot_pickerDestroyed ()
 
virtual void connectToPicker ()
 
void disconnectFromPicker ()
 

Protected Attributes

DtOverlayRendererInterfacemyRenderer
 
bool myIsOutline
 
bool myLineTopology
 
DtWidgetPickermyPicker
 
bool myEventsEnabled
 
bool myPickerDestroyed
 
bool myPickerConnected
 
unsigned long long myUserData
 
DtPickableDecalProjectormyPickableDecalProjector
 
VertexList myVertices
 
VertexList my3DVertices
 
float myCenterPoint [2]
 
double my3DCenterPoint [3]
 
unsigned int myFillParam
 
unsigned int myFullStipplePattern [32]
 
FillType myFillType
 
float myOutlineWidth
 
int myGroup
 
std::vector< TrianglemyTriangles
 
DtDecalProjectorComponentInterfacemyDecalProjectorComponent
 

Friends

class DtDecalProjectorPolygonCreator
 

Additional Inherited Members

- Public Types inherited from makVrv::DtFilledPolygonInterface
enum  FillType { Fill_Solid = 0, Fill_Stipple, Fill_Texture, FillType_End }
 

Member Typedef Documentation

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

Constructor & Destructor Documentation

makVrv::DtDecalProjectorPolygon::DtDecalProjectorPolygon ( DtOverlayRendererInterface renderer,
DtWidgetPicker picker,
bool  isOutline,
bool  lineTopology 
)

CTOR, takes renderer that the overlay will be on.

makVrv::DtDecalProjectorPolygon::DtDecalProjectorPolygon ( DtDe de,
DtChannel channel,
DtModelSetId  modelSet,
bool  isOutline,
bool  lineTopology 
)

CTOR.

virtual makVrv::DtDecalProjectorPolygon::~DtDecalProjectorPolygon ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtDecalProjectorPolygon::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.

Implements makVrv::DtFilledPolygonInterface.

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

Get the fill type.

Implements makVrv::DtFilledPolygonInterface.

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

Set the fill parameter. If the full stippledPattern (aka a full 32x32 bit array) the initial param is ignored.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::clearFillPattern ( )
virtual

Clears the fill pattern of the quad.

Implements makVrv::DtFilledPolygonInterface.

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

Get the quad fill parameters.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::setFillPatternFrequency ( float  frequency)
overridevirtual

Sets the fill pattern tiling frequency. The frequency needs to be 1 / x where x is a whole number. examples: frequency = 1.0 : the tiled pattern will tile normally frequency = 0.5 : the tiled pattern will appear half as often.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::setFillTexture ( DtTextureInterface textureHandle)
overridevirtual

Sets the texture to fill the polygon with. The texture is visualized to be centered in the polygon and to fill the polygon with minimal tiling.

Implements makVrv::DtFilledPolygonInterface.

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

Set whether the sprite has widget events. Disabling events disconnects all of the DtDecalProjectorPolygon signals The user data is set when enabling the events, to change only the user data make multiple calls with enabled=true.

Implements makVrv::DtFilledPolygonInterface.

bool makVrv::DtDecalProjectorPolygon::eventsEnabled ( ) const
virtual

Get whether events are already enabled.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::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::DtFilledPolygonInterface.

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

Get the vertex count.

Implements makVrv::DtFilledPolygonInterface.

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

Set the number of vertices and their positions.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::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::DtFilledPolygonInterface.

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

Sets the position of the polygon's centroid.

Implements makVrv::DtFilledPolygonInterface.

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

Get the vertex position.

Implements makVrv::DtFilledPolygonInterface.

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

Set one vertex position.

Implements makVrv::DtFilledPolygonInterface.

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

Sets the position of the polygon's centroid.

Implements makVrv::DtFilledPolygonInterface.

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

Get the vertex position.

Implements makVrv::DtFilledPolygonInterface.

void makVrv::DtDecalProjectorPolygon::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::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::projectUVCoordinates ( const DtVector &  origin,
const DtVector &  axisU,
const DtVector &  axisV,
float  scale = 1.0f 
)
overridevirtual

Does uv coordinate projection based on the current vertex positions and the given projection parameters.

Parameters
origin- each vertex position will subtract the origin.
axisU- the X axis to project the position along for the u coordinate.
axisV- the Y axis to project the position along for the v coordinate.
scale- the scale to apply to the final uv coordinates.

Implements makVrv::DtFilledPolygonInterface.

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

Set the stipple pattern.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::setOutlineWidth ( float  width)
virtual

Sets the width of the line segments that comprise the polygon.

Implements makVrv::DtDecalProjectorPolygonInterface.

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

Set the color of a specific vertex.

Implements makVrv::DtFilledPolygonInterface.

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

TODO document.

Implements makVrv::DtFilledPolygonInterface.

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

Set the color of the polygon's centroid.

Implements makVrv::DtFilledPolygonInterface.

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

Set the color.

Implements makVrv::DtFilledPolygonInterface.

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

Get the color.

Implements makVrv::DtFilledPolygonInterface.

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

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

Implements makVrv::DtFilledPolygonInterface.

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

Sets the group for Z-Ordering.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::triangulate ( )
overridevirtual

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.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::triangulationComplete ( bool  crossingLines)
overridevirtual

This is call when a polygon's triangulation is complete. Derived classes are not required to do anything in this case.

Parameters
crossingLinesTrue if triangulation had crossing lines.

Reimplemented from makVrv::DtPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::set2DPositionsTriangles ( const std::vector< float > &  vertices)
virtual

Set the number of vertices and their positions. This method is to be used instead of set2DPositions. This method does not calculate/use the center of the polygon as the third vertex for each two passed in like set2DPositions. It expects the triangles to already be calculated, the loop in here skips 6 floats per iteration.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::setVertexCountTriangles ( 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.This method is used instead of setVertexCount when you are calling set2DPositionsTriangles.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::setIsNormalisedScreenCoordinates ( bool  isNormalisedScreenCoords)
overridevirtual

No-op Set whether the graphic is normalised screen coordinates Used by window object API, passed to shader.

Implements makVrv::DtFilledPolygonInterface.

virtual void makVrv::DtDecalProjectorPolygon::updateDecalProjectorWithTriangles ( )
protectedvirtual

Sends the current list of triangles to the decal projector.

virtual void makVrv::DtDecalProjectorPolygon::slot_pickerDestroyed ( )
protectedvirtual

Called when the widget picker is destroyed, clears out pickable segment list and sets a flag to no longer use the picker.

virtual void makVrv::DtDecalProjectorPolygon::connectToPicker ( )
protectedvirtual

Connects to the widget picket (if not connected).

void makVrv::DtDecalProjectorPolygon::disconnectFromPicker ( )
protected

Disconnects from the widget picker signals (if connected). non-virutal used in destructor.

Friends And Related Function Documentation

friend class DtDecalProjectorPolygonCreator
friend

Member Data Documentation

DtOverlayRendererInterface* makVrv::DtDecalProjectorPolygon::myRenderer
protected
bool makVrv::DtDecalProjectorPolygon::myIsOutline
protected
bool makVrv::DtDecalProjectorPolygon::myLineTopology
protected
DtWidgetPicker* makVrv::DtDecalProjectorPolygon::myPicker
protected
bool makVrv::DtDecalProjectorPolygon::myEventsEnabled
protected
bool makVrv::DtDecalProjectorPolygon::myPickerDestroyed
protected
bool makVrv::DtDecalProjectorPolygon::myPickerConnected
protected
unsigned long long makVrv::DtDecalProjectorPolygon::myUserData
protected
DtPickableDecalProjector* makVrv::DtDecalProjectorPolygon::myPickableDecalProjector
protected
VertexList makVrv::DtDecalProjectorPolygon::myVertices
protected
VertexList makVrv::DtDecalProjectorPolygon::my3DVertices
protected
float makVrv::DtDecalProjectorPolygon::myCenterPoint[2]
protected
double makVrv::DtDecalProjectorPolygon::my3DCenterPoint[3]
protected
unsigned int makVrv::DtDecalProjectorPolygon::myFillParam
protected
unsigned int makVrv::DtDecalProjectorPolygon::myFullStipplePattern[32]
protected
FillType makVrv::DtDecalProjectorPolygon::myFillType
protected
float makVrv::DtDecalProjectorPolygon::myOutlineWidth
protected
int makVrv::DtDecalProjectorPolygon::myGroup
protected
std::vector<Triangle> makVrv::DtDecalProjectorPolygon::myTriangles
protected
DtDecalProjectorComponentInterface* makVrv::DtDecalProjectorPolygon::myDecalProjectorComponent
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)