Pgon Class Reference

#include <c4d_pgon.h>

Private Member Functions

Bool Alloc (Int32 cnt)
 
void Free ()
 
Bool CopyFrom (const Pgon *src)
 
 Pgon ()
 
 ~Pgon ()
 

Private Attributes

PgonEdgem_Edge
 
Int32 m_Count
 

Friends

class NgonBase
 

Edge Access

Int32 GetCount ()
 
PgonEdgeGetEdge (Int32 i)
 

PgonEdge Convenience Methods

Int32 ID (Int32 i)
 
Int32 State (Int32 i)
 
Int32 Edge (Int32 i)
 
Int32 EdgeIndex (Int32 i)
 
Int32 IsFirst (Int32 i)
 
Int32 IsSegmentEnd (Int32 i)
 
Int32 GetIdentity ()
 
void GetEdge (Int32 i, const CPolygon *vadr, Int32 &p1, Int32 &p2)
 

Miscellaneous

Int32 FindPolygon (Int32 id)
 

Update

void UpdateStates ()
 

Detailed Description

An N-gon represented as a list of edges.

Constructor & Destructor Documentation

◆ Pgon()

Pgon ( )
private

◆ ~Pgon()

~Pgon ( )
private

Member Function Documentation

◆ Alloc()

Bool Alloc ( Int32  cnt)
private

◆ Free()

void Free ( )
private

◆ CopyFrom()

Bool CopyFrom ( const Pgon src)
private

◆ GetCount()

Int32 GetCount ( )

Gets the number of elements in the array (all PgonEdges in all segments).

Note
This is not the same as all N-gon edges since some elements may be from internal polygons with no outer/inner N-gon edge.
Returns
The number of elements in the N-gon.

◆ GetEdge() [1/2]

PgonEdge* GetEdge ( Int32  i)

Gets direct access to a PgonEdge.

Note
The helper methods below should be used.
Parameters
[in]iAn edge index.
Returns
The N-gon edge.

◆ ID()

Int32 ID ( Int32  i)

Convenience method for PgonEdge::ID() for the edge at index i.

Parameters
[in]iAn edge index.
Returns
The polygon ID.

◆ State()

Int32 State ( Int32  i)

Convenience method for PgonEdge::State() for the edge at index i.

Parameters
[in]iAn edge index.
Returns
The edge state.

◆ Edge()

Int32 Edge ( Int32  i)

Convenience method for PgonEdge::Edge() for the edge at index i.

Parameters
[in]iAn edge index.
Returns
The edge of the polygon.

◆ EdgeIndex()

Int32 EdgeIndex ( Int32  i)

Convenience method for PgonEdge::EdgeIndex() for the edge at index i.

Parameters
[in]iAn edge index.
Returns
The edge index (4*polygon ID + edge).

◆ IsFirst()

Int32 IsFirst ( Int32  i)

Convenience method for PgonEdge::IsFirst() for the edge at index i.

Parameters
[in]iAn edge index.
Returns
true if the polygon ID is the first occurrence in the array, otherwise false.

◆ IsSegmentEnd()

Int32 IsSegmentEnd ( Int32  i)

Convenience method for PgonEdge::IsSegmentEnd() for the edge at index i.

Parameters
[in]iAn edge index.
Returns
The PgonEdge::IsSegmentEnd() state.

◆ GetIdentity()

Int32 GetIdentity ( )

Gets the first polygon ID in the array.
Useful as a marker (identity) for the N-gon giving a polygon ID that is within the N-gon.

Returns
The first polygon ID in the array.

◆ GetEdge() [2/2]

void GetEdge ( Int32  i,
const CPolygon vadr,
Int32 p1,
Int32 p2 
)

Convenience method for PgonEdge::GetEdge() for the edge at index i.

Parameters
[in]iAn edge index.
[in]vadrThe polygon array. The caller owns the pointed array.
[in]p1Assigned the first edge point index.
[in]p2Assigned the second edge point index.

◆ FindPolygon()

Int32 FindPolygon ( Int32  id)

Does a search to see if the polygon with index id exists within the N-gon.

Note
The look up uses tables so it is pretty fast.
Parameters
[in]idA polygon ID to search for.
Returns
The index of the first edge found with the specified polygon id, or NOTOK if no edge was found.

◆ UpdateStates()

void UpdateStates ( )

If any changes are done to the edges this must be called when completed to update the repeat markers of the N-gon edges.
Also note that any changes must correct set/change any of the marker bits (such as the segment end, or no edges markers).

Friends And Related Function Documentation

◆ NgonBase

friend class NgonBase
friend

Member Data Documentation

◆ m_Edge

PgonEdge* m_Edge
private

◆ m_Count

Int32 m_Count
private