Pgon Class Reference Library » Ngon

#include <lib_ngon.h>

公共成员函数

向量   CalcNormal (const 向量 *padr, const CPolygon *polys) const
void  GetMpRad (const 向量 *padr, const CPolygon *polys, 向量 &mp, 向量 &rad) const
Int32   GetCount () const
PgonEdge GetEdge ( Int32 i)
Int32   ID ( Int32 i) const
Int32   State ( Int32 i) const
Int32   Edge ( Int32 i) const
Int32   EdgeIndex ( Int32 i) const
Int32   IsFirst ( Int32 i) const
Int32   IsSegmentEnd ( Int32 i) const
Int32   GetIdentity () const
Int32   GetSegmentCount () const
Int32   GetSegmentLen ( Int32 startedge) const
void  GetEdge ( Int32 i, const CPolygon *vadr, Int32 &p1, Int32 &p2)
Int32   FindPolygon ( Int32 id) const
UChar   GetEdgeState ( Int32 id) const
Int32   GetPointCount () const
Int32   GetPolygonCount () const
void  UpdateStates ()

Private Attributes

PgonEdge m_Edge
Int32   m_Count
UInt32   m_CRC

成员函数文档编制

◆  CalcNormal()

向量 CalcNormal ( const 向量 padr ,
const CPolygon polys  
) const

Calculates the normal for the N-gon.

参数
[in] padr The point array. The caller owns the pointed array.
[in] polys The polygons array. The caller owns the pointed array.
返回
The calculated normal.

◆  GetMpRad()

void GetMpRad ( const 向量 padr ,
const CPolygon polys ,
向量 mp ,
向量 rad  
) const

Get the bounds of the N-gon.

参数
[in] padr The point array. The caller owns the pointed array.
[in] polys The polygons array. The caller owns the pointed array.
[out] mp Assigned the calculated mid-point.
[out] rad Assigned the calculated bounding box vector.

◆  GetCount()

Int32 GetCount ( ) const

Retrieves the number of elements in the array (all PgonEdge edges in all segments).

注意
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.
返回
The number of elements in the array.

◆  GetEdge() [1/2]

PgonEdge * GetEdge ( Int32   i )

Gets access directly to a PgonEdge . Normally the helper functions below should be used.

参数
[in] i An edge index.
返回
The edge.

◆  ID()

Int32 ID ( Int32   i ) const

Retrieves the PgonEdge::ID() of the edge at index i .

参数
[in] i An edge index.
返回
The edge polygon ID.

◆  State()

Int32 State ( Int32   i ) const

Retrieves the PgonEdge::State() of the edge at index i .

参数
[in] i An edge index.
返回
The edge state.

◆  Edge()

Int32 Edge ( Int32   i ) const

Retrieves the PgonEdge::Edge() of the edge at index i .

参数
[in] i An edge index.
返回
The edge.

◆  EdgeIndex()

Int32 EdgeIndex ( Int32   i ) const

Retrieves the PgonEdge::EdgeIndex() of the edge at index i .

参数
[in] i An edge index.
返回
The edge index.

◆  IsFirst()

Int32 IsFirst ( Int32   i ) const

Retrieves the PgonEdge::IsFirst() state of the edge at index i .

参数
[in] i An edge index.
返回
The edge first state.

◆  IsSegmentEnd()

Int32 IsSegmentEnd ( Int32   i ) const

Retrieves the PgonEdge::IsSegmentEnd() state of the edge at index i .

参数
[in] i An edge index.
返回
The edge segment end state.

◆  GetIdentity()

Int32 GetIdentity ( ) const

Retrieves 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.

返回
The first polygon ID.

◆  GetSegmentCount()

Int32 GetSegmentCount ( ) const

Retrieves the number of segments in the N-gon.

返回
The segment count.

◆  GetSegmentLen()

Int32 GetSegmentLen ( Int32   startedge ) const

Retrieves the number of elements in the segment starting from the index startedge . This includes any PgonEdge edges that are internal (NOEDGE).

参数
[in] startedge An edge index.
返回
The number of elements in the segment starting from startedge .

◆  GetEdge() [2/2]

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

Maps to the function PgonEdge::GetEdge() of the edge at index i .

参数
[in] i An edge index.
[in] vadr The polygon array. The caller owns the pointed array.
[out] p1 Assigned the first point index.
[out] p2 Assigned the second point index.

◆  FindPolygon()

Int32 FindPolygon ( Int32   id ) const

Does a search to see if the polygon index id exists within the N-gon; the look up uses tables so it is pretty fast.

参数
[in] id A polygon ID to search for.
返回
The index of the first edge found with the specified polygon id ,或 NOTOK if no edge was found.

◆  GetEdgeState()

UChar GetEdgeState ( Int32   id ) const

Retrieves the edges (bits) for polygon id that form any edge/s around the N-gon.

参数
[in] id Combined edge bits for all edges with polygon ID matching id : PGONEDGE
返回
A polygon ID.

◆  GetPointCount()

Int32 GetPointCount ( ) const

Retrieves the number of points that form the N-gon.

返回
The point count.

◆  GetPolygonCount()

Int32 GetPolygonCount ( ) const

Retrieves the number of polygons that form the N-gon.

返回
The polygon count.

◆  UpdateStates()

void UpdateStates ( )

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

Member Data Documentation

◆  m_Edge

PgonEdge * m_Edge
private

◆  m_Count

Int32 m_Count
private

◆  m_CRC

UInt32 m_CRC
private