PolygonReduction Class Reference

#include <lib_polygonreduction.h>

Detailed Description

Performs polygon reduction for a polygon object.

Since
R19

Private Member Functions

 PolygonReduction ()
 
 ~PolygonReduction ()
 

Alloc/Free

static PolygonReductionAlloc ()
 
static void Free (PolygonReduction *&node)
 

Processing

Bool PreProcess (const PolygonReductionData &data)
 
Bool IsPreprocessing ()
 
void StopPreprocessing ()
 
void Reset ()
 

Levels

Bool SetReductionStrengthLevel (Float strengthLevel)
 
Bool SetTriangleLevel (Int32 desiredLevel)
 
Bool SetVertexLevel (Int32 desiredLevel)
 
Bool SetRemainingEdgesLevel (Int32 desiredLevel)
 
Float GetReductionStrengthLevel () const
 
Int32 GetTriangleLevel () const
 
Int32 GetVertexLevel () const
 
Int32 GetRemainingEdgesLevel () const
 
Float GetMaxReductionStrengthLevel () const
 
Int32 GetMaxTriangleLevel () const
 
Int32 GetMaxVertexLevel () const
 
Int32 GetMaxRemainingEdgesLevel () const
 
Int32 GetMinTriangleLevel () const
 
Int32 GetMinVertexLevel () const
 

Miscellaneous

const PolygonReductionDataGetData () const
 
Bool IsValid () const
 

Constructor & Destructor Documentation

◆ PolygonReduction()

PolygonReduction ( )
private

◆ ~PolygonReduction()

~PolygonReduction ( )
private

Member Function Documentation

◆ Alloc()

static PolygonReduction* Alloc ( )
static

Allocates a PolygonReduction. Destroy the allocated PolygonReduction with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Returns
The allocated PolygonReduction, or nullptr if the allocation failed.

◆ Free()

static void Free ( PolygonReduction *&  node)
static

Destructs PolygonReductions allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in]nodeThe PolygonReduction to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ PreProcess()

Bool PreProcess ( const PolygonReductionData data)

Starts the background or synchronous preprocessing that sets up the polygon reduction cache.

Parameters
[in]dataThe data for the reduction.
Returns
true if successful, otherwise false.

◆ IsPreprocessing()

Bool IsPreprocessing ( )

Checks whether the background preprocessing thread is still running.

Returns
true if preprocessing is ongoing, otherwise false.

◆ StopPreprocessing()

void StopPreprocessing ( )

Aborts preprocessing if it is running in the background. Resets the interactive settings values.

◆ Reset()

void Reset ( )

Aborts preprocessing if it is running in the background and frees all temporary data.

◆ SetReductionStrengthLevel()

Bool SetReductionStrengthLevel ( Float  strengthLevel)

Sets the reduction strength level if the desired level is different than the current one.

Parameters
[in]strengthLevelThe desired reduction strength level.
Returns
true if successful, otherwise false.

◆ SetTriangleLevel()

Bool SetTriangleLevel ( Int32  desiredLevel)

Reduces or restores the mesh to the desired number of triangles.

Note
If the desired level is different than the current level, at least one edge collapse or restore will be performed. The actual resulting number of triangles may be slightly different.
Parameters
[in]desiredLevelThe desired number of triangles on call.
Returns
true if successful, otherwise false.

◆ SetVertexLevel()

Bool SetVertexLevel ( Int32  desiredLevel)

Reduces or restores the mesh to the desired number of vertices.

Note
If the desired level is different than the current level, at least one edge collapse or restore will be performed. The actual resulting number of vertices may be slightly different.
Parameters
[in]desiredLevelThe desired number of vertices on call.
Returns
true if successful, otherwise false.

◆ SetRemainingEdgesLevel()

Bool SetRemainingEdgesLevel ( Int32  desiredLevel)

Reduces or restores the mesh to the desired number of edges remaining to collapse.

Note
If the desired level is different than the current level, at least one edge collapse or restore will be performed. The actual resulting number of edges may be slightly different.
Parameters
[in]desiredLevelThe desired collapse stack index.
Returns
true if successful, otherwise false.

◆ GetReductionStrengthLevel()

Float GetReductionStrengthLevel ( ) const

Queries the current reduction strength level.

Returns
The reduction strength percentage: 0 means no reduction performed, 1 means maximum reduction performed.

◆ GetTriangleLevel()

Int32 GetTriangleLevel ( ) const

Queries the current triangle count.

Returns
The triangle count.

◆ GetVertexLevel()

Int32 GetVertexLevel ( ) const

Queries the current vertex count.

Returns
The vertex count.

◆ GetRemainingEdgesLevel()

Int32 GetRemainingEdgesLevel ( ) const

Queries the current remaining number of edges available to collapse.

Returns
The remaining edges level.

◆ GetMaxReductionStrengthLevel()

Float GetMaxReductionStrengthLevel ( ) const

Queries the maximum reduction strength percentage.

Returns
The maximum reduction strength percentage. Always 1.0.

◆ GetMaxTriangleLevel()

Int32 GetMaxTriangleLevel ( ) const

Queries the triangle count when no reduction has been performed.

Returns
The maximum triangle count.

◆ GetMaxVertexLevel()

Int32 GetMaxVertexLevel ( ) const

Queries the vertex count when no reduction has been performed.

Returns
The maximum vertex count.

◆ GetMaxRemainingEdgesLevel()

Int32 GetMaxRemainingEdgesLevel ( ) const

Queries the total number of possible edge collapses.

Returns
The maximum collapse count.

◆ GetMinTriangleLevel()

Int32 GetMinTriangleLevel ( ) const

Queries the triangle count when complete reduction has been performed.

Returns
The minimum triangle count. May be non-zero if border constraints are enabled.

◆ GetMinVertexLevel()

Int32 GetMinVertexLevel ( ) const

Queries the vertex count when complete reduction has been performed.

Returns
The minimum vertex count. May be non-zero if border constraints are enabled.

◆ GetData()

const PolygonReductionData& GetData ( ) const

Retrieves the associated PolygonReductionData.

Returns
The polygon reduction data.

◆ IsValid()

Bool IsValid ( ) const

Checks if a valid object and a valid document are associated with the PolygonReduction instance.

Returns
true if the PolygonReduction instance is valid, otherwise false.