Ngon Class Reference

#include <lib_ngon.h>

Public Member Functions

 Ngon ()
 
 ~Ngon ()
 
 Ngon (const CPolygon &ply)
 
 Ngon (const Ngon &src)
 
Ngonoperator= (const Ngon &src)
 
Bool Alloc (Int32 cnt, Int32 scnt)
 
void Free ()
 
Bool CopyFrom (const Ngon *src)
 
Bool CopyFrom (Int32 cnt, Int32 scnt, Int32 *pts, Int32 *segs)
 
void Release ()
 
Float CalcArea (Int32 seg, const Vector *p, Matrix &m)
 

Public Attributes

Int32points
 
Int32segments
 
Int32 count
 
Int32 segcount
 

Constructor & Destructor Documentation

◆ Ngon() [1/3]

Ngon ( )

Constructor.

◆ ~Ngon()

~Ngon ( )

Destructor.

◆ Ngon() [2/3]

Ngon ( const CPolygon ply)
explicit

Constructor from polygon in ply.

Parameters
[in]plyA polygon.

◆ Ngon() [3/3]

Ngon ( const Ngon src)

Copy constructor from another N-gon in src.

Parameters
[in]srcAnother N-gon.

Member Function Documentation

◆ operator=()

Ngon& operator= ( const Ngon src)

Assignment operator.

Parameters
[in]srcAnother N-gon.
Returns
The assigned N-gon.

◆ Alloc()

Bool Alloc ( Int32  cnt,
Int32  scnt 
)

Allocates data for cnt points and scnt segments.

Parameters
[in]cntThe point count.
[in]scntThe segment count.
Returns
true if successful, otherwise false.

◆ Free()

void Free ( )

Frees the internal data.

◆ CopyFrom() [1/2]

Bool CopyFrom ( const Ngon src)

Copies data from src.

Parameters
[in]srcThe source N-gon.
Returns
true if successful, otherwise false.

◆ CopyFrom() [2/2]

Bool CopyFrom ( Int32  cnt,
Int32  scnt,
Int32 pts,
Int32 segs 
)

Copies data from the passed arrays.

Parameters
[in]cntThe point count.
[in]scntThe segment count.
[in]ptsThe points array. The caller owns the pointed array.
[in]segsThe segments array. The caller owns the pointed array.
Returns
true if successful, otherwise false.

◆ Release()

void Release ( )

Releases the internal arrays, i.e. so that they are not freed by the destructor.

◆ CalcArea()

Float CalcArea ( Int32  seg,
const Vector p,
Matrix m 
)

Calculates the N-gon area.

Parameters
[in]segThe segment.
[in]pThe points array.
[in]mThe projection matrix.
Returns
The calculated area.

Member Data Documentation

◆ points

Int32* points

Point array.

◆ segments

Int32* segments

Segments array.

◆ count

Int32 count

Point count.

◆ segcount

Int32 segcount

Segment count.