TopologyContainer Class Reference

#include <generic_components.h>

Detailed Description

A class that represents a Topology set indices. It is composed by 3 arrays, a linear list of point indices, list of offsets that split the point list in outlines, and a list of the groups outline in complex elements (like a polygon with holes). It can also represents as set of line outlines, in which case the groups array will not be used and the closed array will containe the close status for each outline.

Public Member Functions

 TopologyContainer ()=default
 
 TopologyContainer (const Array< Int32 > &points, const Array< Int32 > &outlines, const Array< Int32 > &groups)
 
 TopologyContainer (const Array< Int32 > &points, const Array< Int32 > &outlines, const Array< Bool > &closed)
 
 MAXON_OPERATOR_EQUALITY_HASHCODE (TopologyContainer, _points, _outlines, _groups, _closed)
 
Result< void > InitPolygons (Int32 pointCount=0, Int32 segCount=0, Int32 gorupCount=0)
 
Result< void > InitLines (Int32 pointCount=0, Int32 segCount=0)
 
Bool IsLine () const
 
Bool IsPolygon () const
 
Bool IsPopulated () const
 
Bool IsEmpty () const
 
Bool HasNgons () const
 
Bool HasGroups () const
 
Int GetGroupCount () const
 
template<typename FN >
Result< void > ForEachPolygonInTopology (FN &&fn) const
 

Public Attributes

Array< Int32_points
 
Array< Int32_outlines
 
Array< Int32_groups
 
Array< Bool_closed
 

Constructor & Destructor Documentation

◆ TopologyContainer() [1/3]

TopologyContainer ( )
default

◆ TopologyContainer() [2/3]

TopologyContainer ( const Array< Int32 > &  points,
const Array< Int32 > &  outlines,
const Array< Int32 > &  groups 
)

◆ TopologyContainer() [3/3]

TopologyContainer ( const Array< Int32 > &  points,
const Array< Int32 > &  outlines,
const Array< Bool > &  closed 
)

Member Function Documentation

◆ MAXON_OPERATOR_EQUALITY_HASHCODE()

MAXON_OPERATOR_EQUALITY_HASHCODE ( TopologyContainer  ,
_points  ,
_outlines  ,
_groups  ,
_closed   
)

◆ InitPolygons()

Result<void> InitPolygons ( Int32  pointCount = 0,
Int32  segCount = 0,
Int32  gorupCount = 0 
)

◆ InitLines()

Result<void> InitLines ( Int32  pointCount = 0,
Int32  segCount = 0 
)

◆ IsLine()

Bool IsLine ( ) const

◆ IsPolygon()

Bool IsPolygon ( ) const

◆ IsPopulated()

Bool IsPopulated ( ) const

◆ IsEmpty()

Bool IsEmpty ( ) const

◆ HasNgons()

Bool HasNgons ( ) const

◆ HasGroups()

Bool HasGroups ( ) const

◆ GetGroupCount()

Int GetGroupCount ( ) const

◆ ForEachPolygonInTopology()

Result<void> ForEachPolygonInTopology ( FN &&  fn) const

Member Data Documentation

◆ _points

Array<Int32> _points

A linear sequence of indices which represent all user polygon/polyline outlines.

◆ _outlines

Array<Int32> _outlines

An array which contains the point count of each outline.

◆ _groups

Array<Int32> _groups

Containes groups for polygons.

◆ _closed

Array<Bool> _closed

Close status for lines.