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

#include <opennurbs_subd.h>

Public Types

enum  : unsigned int { TransientIdBit = 0x80000000U }
 

Public Member Functions

 ON_SubDComponentRegion ()=default
 
 ON_SubDComponentRegion (const ON_SubDComponentRegion &)=default
 
 ~ON_SubDComponentRegion ()=default
 
bool IsEmptyRegion () const
 
bool IsPersistentId () const
 
bool IsTransientId () const
 
ON_SubDComponentRegionoperator= (const ON_SubDComponentRegion &)=default
 
void Pop ()
 
void PushAbsolute (unsigned int region_index)
 
void PushAdjusted (unsigned int region_index)
 
void SetLevel0Component (ON_SubDComponentPtr component_ptr)
 
void SetLevel0EdgePtr (const ON_SubDEdgePtr edge_ptr)
 
void SetLevel0Face (const ON_SubDFace *face)
 
void SetLevel0Vertex (const ON_SubDVertex *vertex)
 
unsigned short SubdivisionCount () const
 
const ON_wString ToString () const
 
wchar_t * ToString (wchar_t *s, size_t s_capacity) const
 

Static Public Member Functions

static int Compare (const ON_SubDComponentRegion *lhs, const ON_SubDComponentRegion *rhs)
 
static int CompareTypeIdDirection (const ON_SubDComponentRegion *lhs, const ON_SubDComponentRegion *rhs)
 
static int CompareTypeIdDirectionMinimumSubregion (const ON_SubDComponentRegion *lhs, const ON_SubDComponentRegion *rhs)
 
static int CompareTypeIdDirectionSubregion (const ON_SubDComponentRegion *lhs, const ON_SubDComponentRegion *rhs)
 
static const ON_SubDComponentRegion Create (const class ON_SubDFace *level0_face)
 
static const ON_SubDComponentRegion Create (unsigned int component_id, ON_SubDComponentPtr::Type component_type, bool bComponentMark)
 
static const ON_SubDComponentRegion CreateSubdivisionRegion (ON_SubDComponentPtr::Type component_type, bool bComponentDirection, unsigned short subdivision_count, bool bAssignTransientId)
 
static bool IsPersistentId (unsigned int id)
 
static bool IsTransientId (unsigned int id)
 
static const unsigned int NewTransientId ()
 
static void ResetTransientId ()
 
static unsigned int TransientId (unsigned int id)
 

Public Attributes

ON_SubDComponentPtr m_level0_component = ON_SubDComponentPtr::Null
 
unsigned int m_level0_component_id = 0
 
ON_SubDComponentRegionIndex m_region_index
 

Static Public Attributes

static const ON_SubDComponentRegion Empty
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : unsigned int
Enumerator
TransientIdBit 

Constructor & Destructor Documentation

◆ ON_SubDComponentRegion() [1/2]

ON_SubDComponentRegion::ON_SubDComponentRegion ( )
default

◆ ~ON_SubDComponentRegion()

ON_SubDComponentRegion::~ON_SubDComponentRegion ( )
default

◆ ON_SubDComponentRegion() [2/2]

ON_SubDComponentRegion::ON_SubDComponentRegion ( const ON_SubDComponentRegion )
default

Member Function Documentation

◆ Compare()

static int ON_SubDComponentRegion::Compare ( const ON_SubDComponentRegion lhs,
const ON_SubDComponentRegion rhs 
)
static

Description: Compares m_level0_component.ComponentType(), m_level0_component_id, m_level0_component.ComponentDirection(), the entire sub region, and m_level0_component.m_ptr.

◆ CompareTypeIdDirection()

static int ON_SubDComponentRegion::CompareTypeIdDirection ( const ON_SubDComponentRegion lhs,
const ON_SubDComponentRegion rhs 
)
static

Descriptions: Compares m_level0_component.ComponentType(), m_level0_component_id, m_level0_component.ComponentDirection().

◆ CompareTypeIdDirectionMinimumSubregion()

static int ON_SubDComponentRegion::CompareTypeIdDirectionMinimumSubregion ( const ON_SubDComponentRegion lhs,
const ON_SubDComponentRegion rhs 
)
static

Description: Compares m_level0_component.ComponentType(), m_level0_component_id, m_level0_component.ComponentDirection(), and the m_region_index[] values for the minimum subdivision count lhs and rhs.

◆ CompareTypeIdDirectionSubregion()

static int ON_SubDComponentRegion::CompareTypeIdDirectionSubregion ( const ON_SubDComponentRegion lhs,
const ON_SubDComponentRegion rhs 
)
static

Description: Compares m_level0_component.ComponentType(), m_level0_component_id, m_level0_component.ComponentDirection(), and the entire sub region.

◆ Create() [1/2]

static const ON_SubDComponentRegion ON_SubDComponentRegion::Create ( const class ON_SubDFace level0_face)
static

◆ Create() [2/2]

static const ON_SubDComponentRegion ON_SubDComponentRegion::Create ( unsigned int  component_id,
ON_SubDComponentPtr::Type  component_type,
bool  bComponentMark 
)
static

◆ CreateSubdivisionRegion()

static const ON_SubDComponentRegion ON_SubDComponentRegion::CreateSubdivisionRegion ( ON_SubDComponentPtr::Type  component_type,
bool  bComponentDirection,
unsigned short  subdivision_count,
bool  bAssignTransientId 
)
static

Description: Creates a region that can be used to identify a component created at a certain level of subdivision that does not come from dividing a component from the previous level. For example, Catmull Clark subdivision edges on level N+1 that run from the level N edge subdivision point to the level N face subdivision point.

m_level0_component = ON_SubDComponentPtr::CreateNull(component_type, bComponentDirection?1:0), (m_level0_component.IsNull() will be true) m_level0_component_id = ON_SubDComponentRegion::NewTransientId() m_subdivision_count = subdivision_count, m_region_index[0, ..., (subdivision_count-1)] = 0xFFFF.

◆ IsEmptyRegion()

bool ON_SubDComponentRegion::IsEmptyRegion ( ) const

◆ IsPersistentId() [1/2]

bool ON_SubDComponentRegion::IsPersistentId ( ) const

Returns: True if m_level0_component_id is the id of a persistent ON_SubD level 0 component.

◆ IsPersistentId() [2/2]

static bool ON_SubDComponentRegion::IsPersistentId ( unsigned int  id)
static

Parameters: id - [in] Value to test to see if it is a persitsent subd component id. Returns: True if (ON_SubDComponentRegion::TransientIdBit & id) is not zero and (~ON_SubDComponentRegion::TransientIdBit & id) is not zero. Remarks: Transient ids are used to identify subdivision components at levels that do not persist in the ON_SubD. They are unique within the context where they are being used. They generally vary with each repetition of a calcultion in that context.

◆ IsTransientId() [1/2]

bool ON_SubDComponentRegion::IsTransientId ( ) const

Returns: True if m_level0_component_id is a transient id.

◆ IsTransientId() [2/2]

static bool ON_SubDComponentRegion::IsTransientId ( unsigned int  id)
static

Parameters: id - [in] Value to test to see if it is a transient subd component id. Returns: True if (ON_SubDComponentRegion::TransientIdBit & id) is not zero and (~ON_SubDComponentRegion::TransientIdBit & id) is not zero. Remarks: Transient ids are used to identify subdivision components at levels that do not persist in the ON_SubD. They are unique within the context where they are being used. They generally vary with each repetition of a calcultion in that context.

◆ NewTransientId()

static const unsigned int ON_SubDComponentRegion::NewTransientId ( )
static

Returns: A value that can be used to identify transient subdivision components that do not exist in the persistent levels of a SubD. Transient ids always satisfy (ON_SubDComponentRegion::TransientIdBit & transient_id) is not zero and (~ON_SubDComponentRegion::TransientIdBit & transient_id) is not zero. Remarks: Transient ids are used to identify subdivision components at levels that do not persist in the ON_SubD. They are unique within the context where they are being used. They generally vary with each repetition of a calcultion in that context.

◆ operator=()

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

◆ Pop()

void ON_SubDComponentRegion::Pop ( )

◆ PushAbsolute()

void ON_SubDComponentRegion::PushAbsolute ( unsigned int  region_index)

Parameters: region_index - [in] If m_level0_component identifies a face, then region_index is the index of the corner vertex for the subdivision quad. If m_level0_component identifies an edge, then region_index must be 0 or 1. Description: Increments if m_subdivision_count and appends region_index to m_region_index[] (m_region_index[m_subdivision_count++] = region_index)

◆ PushAdjusted()

void ON_SubDComponentRegion::PushAdjusted ( unsigned int  region_index)

Description: region_index - [in] If m_level0_component identifies an edge, region_index is 0 or 1, and the edge is reversed (1=m_level0_component.ComponentMark()), then PushAbsolute(1-region_index) is called. In every other case, PushAbsolute(region_index) is called.

◆ ResetTransientId()

static void ON_SubDComponentRegion::ResetTransientId ( )
static

Description: Resets the value used to generate transient ids. This is useful during debugging session so that transient id values are predictable. Otherwise, use of this function should be avoided.

◆ SetLevel0Component()

void ON_SubDComponentRegion::SetLevel0Component ( ON_SubDComponentPtr  component_ptr)

◆ SetLevel0EdgePtr()

void ON_SubDComponentRegion::SetLevel0EdgePtr ( const ON_SubDEdgePtr  edge_ptr)

◆ SetLevel0Face()

void ON_SubDComponentRegion::SetLevel0Face ( const ON_SubDFace face)

◆ SetLevel0Vertex()

void ON_SubDComponentRegion::SetLevel0Vertex ( const ON_SubDVertex vertex)

◆ SubdivisionCount()

unsigned short ON_SubDComponentRegion::SubdivisionCount ( ) const

◆ ToString() [1/2]

const ON_wString ON_SubDComponentRegion::ToString ( ) const

◆ ToString() [2/2]

wchar_t* ON_SubDComponentRegion::ToString ( wchar_t *  s,
size_t  s_capacity 
) const

Description: Get a string of the form fN.a.b.c where N = m_level0_face-m_id, a.b.c = m_region_index[] values.

◆ TransientId()

static unsigned int ON_SubDComponentRegion::TransientId ( unsigned int  id)
static

Parameters: id - [in] Value to test to see if it is a transient subd component id. Returns: If the id is a transient id, then its id value is returned. Otherwise, 0 is returned. Remarks: Transient ids are used to identify subdivision components at levels that do not persist in the ON_SubD. They are unique within the context where they are being used. They generally vary with each repetition of a calcultion in that context.

Member Data Documentation

◆ Empty

const ON_SubDComponentRegion ON_SubDComponentRegion::Empty
static

◆ m_level0_component

ON_SubDComponentPtr ON_SubDComponentRegion::m_level0_component = ON_SubDComponentPtr::Null

◆ m_level0_component_id

unsigned int ON_SubDComponentRegion::m_level0_component_id = 0

◆ m_region_index

ON_SubDComponentRegionIndex ON_SubDComponentRegion::m_region_index