SculptPointPolysIterator Class Reference

#include <lib_sculptbrush.h>

Detailed Description

Iterates over all the polygons that are connected to a specified vertex.

if (itr)
{
// Iterate over all the polygons connected to vertex 0
for (itr->Init(pSculpt, 0); itr->IsValid(); itr->Next())
{
CPolygon poly = itr->GetPolygon();
}
}
BaseDocument * GetActiveDocument(void)
Definition: ge_autoptr.h:37
Definition: lib_sculpt.h:443
SculptObject * GetSelectedSculptObject(BaseDocument *doc, Bool includeHiddenObjects=false)
Represents a polygon that can be either a triangle or a quadrangle.
Definition: c4d_baseobject.h:44

Public Member Functions

Bool Init (const SculptObject *pObj, Int32 vertex)
 
void Next ()
 
Bool IsValid ()
 
CPolygon GetPolygon ()
 
Int32 GetIndex ()
 

Static Public Member Functions

static SculptPointPolysIteratorAlloc ()
 
static void Free (SculptPointPolysIterator *&itr)
 

Private Member Functions

 SculptPointPolysIterator ()
 
 ~SculptPointPolysIterator ()
 

Constructor & Destructor Documentation

◆ SculptPointPolysIterator()

◆ ~SculptPointPolysIterator()

Member Function Documentation

◆ Alloc()

static SculptPointPolysIterator* Alloc ( )
static

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

Returns
The allocated SculptPointPolysIterator object, or nullptr if the allocation failed.

◆ Free()

static void Free ( SculptPointPolysIterator *&  itr)
static

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

Parameters
[in,out]itrThe SculptPointPolysIterator object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ Init()

Bool Init ( const SculptObject pObj,
Int32  vertex 
)

Initializes the SculptPointPolysIterator for the given SculptObject and vertex index.

Parameters
[in]pObjThe SculptObject to iterate over the polygons for. The caller owns the pointed SculptObject.
[in]vertexThe vertex to check for connected polygons.
Returns
true if successful, otherwise false.

◆ Next()

void Next ( )

Moves to the next polygon that is connected to the vertex.

◆ IsValid()

Bool IsValid ( )

After calling Next() checks if the polygon is valid. If it is valid then call GetPolygon() and GetIndex().

Returns
true if the polygon is valid, otherwise false.

◆ GetPolygon()

CPolygon GetPolygon ( )

Gets the current CPolygon connected to the vertex that the iterator is pointing to.

Returns
The current CPolygon.

◆ GetIndex()

Int32 GetIndex ( )

Gets the index of the current polygon.

Note
This is the index of the polygon in the PolygonObject at the SculptObject current subdivision level, which can be accessed calling BrushDabData::GetPolygonObject().
Returns
The index of the polygon.