Rhino C++ API  8.14
Public Types | Public Member Functions | Static Public Attributes | List of all members
ON_SubDSectorIterator Class Reference

#include <opennurbs_subd.h>

Public Types

enum  StopAt : unsigned char { StopAt::Boundary = 0, StopAt::AnyCrease = 1, StopAt::HardCrease = 2 }
 

Public Member Functions

 ON_SubDSectorIterator ()=default
 
 ON_SubDSectorIterator (const ON_SubDSectorIterator &)=default
 
 ~ON_SubDSectorIterator ()=default
 
const ON_SubDVertexCenterVertex () const
 
const ON_SubDEdgeCurrentEdge (unsigned int face_side_index) const
 
ON__UINT_PTR CurrentEdgeDirection (unsigned int face_side_index) const
 
ON_SubDEdgePtr CurrentEdgePtr (unsigned int face_side_index) const
 
const ON_SubDVertexCurrentEdgeRingVertex (unsigned int face_side_index) const
 
const ON_SubDFaceCurrentFace () const
 
unsigned int CurrentFaceCenterVertexIndex () const
 
unsigned int CurrentFaceDirection () const
 
ON_SubDFacePtr CurrentFacePtr () const
 
int CurrentRingIndex () const
 
const ON_SubDFaceFirstFace ()
 
const ON_SubDFaceIncrementFace (int increment_direction, ON_SubDSectorIterator::StopAt stop_at)
 
const ON_SubDFaceIncrementToCrease (int increment_direction)
 
ON_SubDEdgeTag IncrementToCrease (int increment_direction, unsigned *increment_count)
 Increment the iterator until it reaches a face with a crease on the side indicated by increment_direction. More...
 
const ON_SubDFaceInitialFace () const
 
unsigned int InitialFaceCenterVertexIndex () const
 
void Initialize ()
 
const ON_SubDVertexInitialize (const ON_SubDFace *initial_face, ON__UINT_PTR iterator_orientation, const ON_SubDVertex *center_vertex)
 
const ON_SubDVertexInitialize (const ON_SubDFace *initial_face, ON__UINT_PTR iterator_orientation, unsigned int face_vertex_index)
 
const ON_SubDVertexInitialize (const ON_SubDVertex *center_vertex)
 
bool InitializeToCurrentFace ()
 
bool IsValid () const
 
const ON_SubDFaceNextFace (ON_SubDSectorIterator::StopAt stop_at)
 
ON_SubDSectorIteratoroperator= (const ON_SubDSectorIterator &)=default
 
const ON_SubDFacePrevFace (ON_SubDSectorIterator::StopAt stop_at)
 

Static Public Attributes

static const ON_SubDSectorIterator Empty
 

Detailed Description

ON_SubDSectorIterator

Member Enumeration Documentation

◆ StopAt

enum ON_SubDSectorIterator::StopAt : unsigned char
strong
Enumerator
Boundary 

summary> Sector iteration will terminate when the edge being crossed does not have two faces. /summary> summary> Sector iteration will terminate when the edge being crossed does not have two faces or that edge is tagged as ON_SubDEdgeTag::Crease. /summary>

AnyCrease 

summary> Sector iteration will terminate when the edge being crossed does not have two faces or that edge is tagged as ON_SubDEdgeTag::Crease and has no dart vertices. /summary>

HardCrease 

Constructor & Destructor Documentation

◆ ON_SubDSectorIterator() [1/2]

ON_SubDSectorIterator::ON_SubDSectorIterator ( )
default

◆ ~ON_SubDSectorIterator()

ON_SubDSectorIterator::~ON_SubDSectorIterator ( )
default

◆ ON_SubDSectorIterator() [2/2]

ON_SubDSectorIterator::ON_SubDSectorIterator ( const ON_SubDSectorIterator )
default

Member Function Documentation

◆ CenterVertex()

const ON_SubDVertex* ON_SubDSectorIterator::CenterVertex ( ) const

◆ CurrentEdge()

const ON_SubDEdge* ON_SubDSectorIterator::CurrentEdge ( unsigned int  face_side_index) const

Description:

          CurrentEdge(1)
              |
              |
   NextFace() | CurrentFace()
              |
              |
               ------------- CurrentEdge(0)
                  PrevFace()

The asterisk (*) marks the center vertex. The diagram is With respect to the initial iterator orientation.

Parameters: face_side_index - [in] CurrentEdge(0) = edge on the clockwise (PrevFace) side of the current face CurrentEdge(1) = edge on the counterclockwise (NextFace) side of the current face The directions "counterclockwise" and "clockwise" are with respect to the initial iterator orientation. Returns: The requested edge or nullptr if the iterator is not initialized, has terminated, or is not valid. When the sector iterator is initialized and valid, sit.CenterVertex() = CurrentEdge(*).RelativeVertex(0).

◆ CurrentEdgeDirection()

ON__UINT_PTR ON_SubDSectorIterator::CurrentEdgeDirection ( unsigned int  face_side_index) const

◆ CurrentEdgePtr()

ON_SubDEdgePtr ON_SubDSectorIterator::CurrentEdgePtr ( unsigned int  face_side_index) const

Description:

          CurrentEdge(1)
              |
              |
   NextFace() | CurrentFace()
              |
              |
               ------------- CurrentEdge(0)
                  PrevFace()

The asterisk (*) marks the center vertex. The diagram is With respect to the initial iterator orientation.

Parameters: face_side_index - [in] CurrentEdge(0) = edge on the clockwise (PrevFace) side of the current face CurrentEdge(1) = edge on the counterclockwise (NextFace) side of the current face The directions "counterclockwise" and "clockwise" are with respect to the initial iterator orientation.

Returns: The requested edge. The edge pointer is oriented such that RelativeVertex(0) is the center vertex.

◆ CurrentEdgeRingVertex()

const ON_SubDVertex* ON_SubDSectorIterator::CurrentEdgeRingVertex ( unsigned int  face_side_index) const

Returns: The vertex on CurrentEdge(face_side_index) that is opposite the central vertex.

◆ CurrentFace()

const ON_SubDFace* ON_SubDSectorIterator::CurrentFace ( ) const

◆ CurrentFaceCenterVertexIndex()

unsigned int ON_SubDSectorIterator::CurrentFaceCenterVertexIndex ( ) const

◆ CurrentFaceDirection()

unsigned int ON_SubDSectorIterator::CurrentFaceDirection ( ) const

◆ CurrentFacePtr()

ON_SubDFacePtr ON_SubDSectorIterator::CurrentFacePtr ( ) const

◆ CurrentRingIndex()

int ON_SubDSectorIterator::CurrentRingIndex ( ) const

Description: The current ring index reports the total increment from the start to the current state. It can be positive or negative.

◆ FirstFace()

const ON_SubDFace* ON_SubDSectorIterator::FirstFace ( )

Description: Reset iterator to initial face.

◆ IncrementFace()

const ON_SubDFace* ON_SubDSectorIterator::IncrementFace ( int  increment_direction,
ON_SubDSectorIterator::StopAt  stop_at 
)

Description: Advance the "current" face by "hopping across" the edge CurrentEdge((increment_direction>0) ? 1 : 0).

If the current face is not reversed (0 == CurrentFaceDirection), then increment_direction>0 rotates counter-clockwise with respect to the current face's orientation.

If the current face is reversed (1 == CurrentFaceDirection), then increment_direction>0 rotates clockwise with respect to the current face's orientation. Parameters: increment_direction - [in] > 0 advance the "current" face to next face <= 0 advance the "current" face to previous face stop_at - [in] Determines that type of CurrentEdge((increment_direction>0) ? 1 : 0) will terminate iteration. If true and the input value of CurrentEdge((increment_direction>0) ? 1 : 0) When iteration terminates at a crease, CurrentFace() becomes nullptr CurrentEdge((increment_direction>0) ? 1 : 0) becomes nullptr CurrentEdge((increment_direction>0) ? 0 : 1) points at the crease and nullptr returned. Returns: nullptr if iteration terminates.

◆ IncrementToCrease() [1/2]

const ON_SubDFace* ON_SubDSectorIterator::IncrementToCrease ( int  increment_direction)

Description: Increment the iterator until it reaches a face with a crease Parameters: increment_direction - [in]

0 advance next until CurrentEdge(1) is a crease.

<= 0 advance previous until CurrentEdge(0) is a crease. Returns: nullptr - the sector has no creases. not nullptr - incremented to a crease

◆ IncrementToCrease() [2/2]

ON_SubDEdgeTag ON_SubDSectorIterator::IncrementToCrease ( int  increment_direction,
unsigned *  increment_count 
)

Increment the iterator until it reaches a face with a crease on the side indicated by increment_direction.

Description: Increment the iterator until it reaches a face with a crease Parameters: increment_direction - [in]

0 advance next until CurrentEdge(1) is a crease.

<= 0 advance previous until CurrentEdge(0) is a crease. Returns: nullptr - the sector has no creases. not nullptr - incremented to a crease

Parameters
increment_direction> 0 advance next until CurrentEdge(1) is a crease. <= 0 advance previous until CurrentEdge(0) is a crease.
increment_countThe number of inrements it took to reach a crease.
Returns
ON_SubDEdgeTag::Smooth: The sector has no creases and the iterator was not changed. ON_SubDEdgeTag::Crease: The sector has a crease edge and this-<CurrentEdge(increment_direction > 0 ? 1 : 0) is a crease. ON_SubDEdgeTag::Unset: This sector iterator is not valid. No changes.

◆ InitialFace()

const ON_SubDFace* ON_SubDSectorIterator::InitialFace ( ) const

◆ InitialFaceCenterVertexIndex()

unsigned int ON_SubDSectorIterator::InitialFaceCenterVertexIndex ( ) const

◆ Initialize() [1/4]

void ON_SubDSectorIterator::Initialize ( )

◆ Initialize() [2/4]

const ON_SubDVertex* ON_SubDSectorIterator::Initialize ( const ON_SubDFace initial_face,
ON__UINT_PTR  iterator_orientation,
const ON_SubDVertex center_vertex 
)

Parameters: initial_face - [in] iterator_orientation - [in] 0: (more common) "next" means counter-clockwise with respect to the orientation of initial_face 1: (less common) "next" means clockwise with respect to the orientation of initial_face center_vertex - [in] The vertex on initial_face that will be iterated around. Returns: If input is valid, a pointer to the center vertex is returned. Otherwise, nullptr is returned.

◆ Initialize() [3/4]

const ON_SubDVertex* ON_SubDSectorIterator::Initialize ( const ON_SubDFace initial_face,
ON__UINT_PTR  iterator_orientation,
unsigned int  face_vertex_index 
)

Parameters: initial_face - [in] iterator_orientation - [in] 0: (more common) "next" means counter-clockwise with respect to the orientation of initial_face 1: (less common) "next" means clockwise with respect to the orientation of initial_face face_vertex_index - [in] initial_face->Vertex(face_vertex_index) is the center vertex that will be iterated around. Returns: If input is valid, a pointer to the center vertex is returned. Otherwise, nullptr is returned.

◆ Initialize() [4/4]

const ON_SubDVertex* ON_SubDSectorIterator::Initialize ( const ON_SubDVertex center_vertex)

Parameters: center_vertex - [in] The vertex to iterated around. center_vertex->Face(0) is used to select the sector. Returns: If input is valid, a pointer to the center vertex is returned. Otherwise, nullptr is returned.

◆ InitializeToCurrentFace()

bool ON_SubDSectorIterator::InitializeToCurrentFace ( )

◆ IsValid()

bool ON_SubDSectorIterator::IsValid ( ) const

◆ NextFace()

const ON_SubDFace* ON_SubDSectorIterator::NextFace ( ON_SubDSectorIterator::StopAt  stop_at)

Description: Advance the "current" face to the "next" face in the ring by crossing CurrentEdge(1).

If the current face is not reversed (1 == CurrentFaceDirection), then this rotation is counter-clockwise with respect to the current face's orientation.

If the current face is reversed (1 == CurrentFaceDirection), then this rotation is clockwise with respect to the current face's orientation. Parameters: stop_at - [in] Determines that type of CurrentEdge(1) will terminate iteration. Returns: When the input CurrentEdge(1) has exactly two faces and is not tagged as a crease or bStopAtCrease is false, the face on the other side of CurrentEdge(1) becomes the new current face and a pointer to this face is returned. Remarks: Identical to calling IncrementFace(+1,bStopAtCrease);

◆ operator=()

ON_SubDSectorIterator& ON_SubDSectorIterator::operator= ( const ON_SubDSectorIterator )
default

◆ PrevFace()

const ON_SubDFace* ON_SubDSectorIterator::PrevFace ( ON_SubDSectorIterator::StopAt  stop_at)

Description: Advance the "current" face to the "previous" face in the ring by crossing CurrentEdge(0).

If the current face is not reversed (0 == CurrentFaceDirection), then this rotation is clockwise with respect to the current face's orientation.

If the current face is reversed (1 == CurrentFaceDirection), then this rotation is counter-clockwise with respect to the current face's orientation. Parameters: stop_at - [in] Determines that type of CurrentEdge(0) will terminate iteration. Returns: When the input CurrentEdge(0) has exactly two faces and is not tagged as a crease or bStopAtCrease is false, the face on the other side of CurrentEdge(0) becomes the new current face and a pointer to this face is returned. In all other cases, nullptr is returned Remarks: Identical to calling IncrementFace(-1,bStopAtCrease);

Member Data Documentation

◆ Empty

const ON_SubDSectorIterator ON_SubDSectorIterator::Empty
static