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

#include <opennurbs_defines.h>

Public Types

enum  TYPE {
  invalid_type = 0, brep_vertex = 1, brep_edge = 2, brep_face = 3,
  brep_trim = 4, brep_loop = 5, mesh_vertex = 11, meshtop_vertex = 12,
  meshtop_edge = 13, mesh_face = 14, mesh_ngon = 15, idef_part = 21,
  polycurve_segment = 31, pointcloud_point = 41, group_member = 51, extrusion_bottom_profile = 61,
  extrusion_top_profile = 62, extrusion_wall_edge = 63, extrusion_wall_surface = 64, extrusion_cap_surface = 65,
  extrusion_path = 66, subd_vertex = 71, subd_edge = 72, subd_face = 73,
  hatch_loop = 81, dim_linear_point = 100, dim_radial_point = 101, dim_angular_point = 102,
  dim_ordinate_point = 103, dim_text_point = 104, dim_centermark_point = 105, dim_leader_point = 106,
  no_type = 0xFFFFFFFF
}
 

Public Member Functions

 ON_COMPONENT_INDEX ()
 
 ON_COMPONENT_INDEX (ON_COMPONENT_INDEX::TYPE type, int index)
 
void AppendToString (class ON_String &s) const
 
void AppendToString (class ON_wString &s) const
 
void Dump (class ON_TextLog &text_log) const
 
bool IsAnnotationComponentIndex () const
 
bool IsBrepComponentIndex () const
 
bool IsExtrusionComponentIndex () const
 
bool IsExtrusionPathComponentIndex () const
 
bool IsExtrusionProfileComponentIndex () const
 
bool IsExtrusionWallComponentIndex () const
 
bool IsExtrusionWallEdgeComponentIndex () const
 
bool IsExtrusionWallSurfaceComponentIndex () const
 
bool IsGroupMemberComponentIndex () const
 
bool IsHatchLoopComponentIndex () const
 
bool IsIDefComponentIndex () const
 
bool IsMeshComponentIndex () const
 
bool IsNotSet () const
 
bool IsPointCloudComponentIndex () const
 
bool IsPolyCurveComponentIndex () const
 
bool IsSet () const
 
bool IsSubDComponentIndex () const
 
bool operator!= (const ON_COMPONENT_INDEX &other) const
 
bool operator< (const ON_COMPONENT_INDEX &other) const
 
bool operator<= (const ON_COMPONENT_INDEX &other) const
 
bool operator== (const ON_COMPONENT_INDEX &other) const
 
bool operator> (const ON_COMPONENT_INDEX &other) const
 
bool operator>= (const ON_COMPONENT_INDEX &other) const
 
void Set (ON_COMPONENT_INDEX::TYPE type, int index)
 
void Set (ON_COMPONENT_INDEX::TYPE type, unsigned int index)
 
void UnSet ()
 
unsigned int UnsignedIndex () const
 

Static Public Member Functions

static int Compare (const ON_COMPONENT_INDEX *a, const ON_COMPONENT_INDEX *b)
 
static int CompareType (const ON_COMPONENT_INDEX *lhs, const ON_COMPONENT_INDEX *rhs)
 
static ON_COMPONENT_INDEX::TYPE Type (int i)
 

Public Attributes

int m_index
 
TYPE m_type
 

Static Public Attributes

static const ON_COMPONENT_INDEX UnsetComponentIndex
 
static const ON_COMPONENT_INDEX WholeObject
 

Detailed Description

Description: Component indices are used to provide a persistent way to identify portions of complex objects.

Member Enumeration Documentation

◆ TYPE

Do not change these values; they are stored in 3dm archives and provide a persistent way to identify components of complex objects.

Enumerator
invalid_type 
brep_vertex 
brep_edge 
brep_face 
brep_trim 
brep_loop 
mesh_vertex 
meshtop_vertex 
meshtop_edge 
mesh_face 
mesh_ngon 
idef_part 
polycurve_segment 
pointcloud_point 
group_member 
extrusion_bottom_profile 

3d bottom profile curves index identifies profile component

extrusion_top_profile 

3d top profile curves index identifies profile component

extrusion_wall_edge 

3d wall edge curve index/2: identifies profile component index%2: 0 = start, 1 = end

extrusion_wall_surface 

side wall surfaces index: identifies profile component

extrusion_cap_surface 

bottom and top cap surfaces index: 0 = bottom, 1 = top

extrusion_path 

extrusion path (axis line) index -1 = entire path, 0 = start point, 1 = endpoint

subd_vertex 

m_index = ON_SubDVertex.m_id, use ON_SubD.ComponentPtrFromComponentIndex()

ON_SubD component index

Use ON_SubD.ComponentPtrFromComponentIndex() to convert an ON_COMPONENT_INDEX into a component pointer. See also ON_SubD.VertexFromId() ON_SubD.EdgeFromId() ON_SubD.FaceFromId()

subd_edge 

m_index = ON_SubDEdge.m_id

subd_face 

m_index = ON_SubDFace.m_id

hatch_loop 

m_index = ON_Hatch::m_loops[] array index

dim_linear_point 
dim_radial_point 
dim_angular_point 
dim_ordinate_point 
dim_text_point 
dim_centermark_point 
dim_leader_point 
no_type 

Constructor & Destructor Documentation

◆ ON_COMPONENT_INDEX() [1/2]

ON_COMPONENT_INDEX::ON_COMPONENT_INDEX ( )

Description: Default constructor has value ON_COMPONENT_INDEX UnsetComponentIndex.

◆ ON_COMPONENT_INDEX() [2/2]

ON_COMPONENT_INDEX::ON_COMPONENT_INDEX ( ON_COMPONENT_INDEX::TYPE  type,
int  index 
)

Description: Sets m_type = type and m_index = index.

Member Function Documentation

◆ AppendToString() [1/2]

void ON_COMPONENT_INDEX::AppendToString ( class ON_String s) const

◆ AppendToString() [2/2]

void ON_COMPONENT_INDEX::AppendToString ( class ON_wString s) const

◆ Compare()

static int ON_COMPONENT_INDEX::Compare ( const ON_COMPONENT_INDEX a,
const ON_COMPONENT_INDEX b 
)
static

Description: Dictionary compare on m_type, m_index as ints. Returns: < 0: a < b = 0: a = b

0: a > b

◆ CompareType()

static int ON_COMPONENT_INDEX::CompareType ( const ON_COMPONENT_INDEX lhs,
const ON_COMPONENT_INDEX rhs 
)
static

Description: Compare on m_type (as an int).

◆ Dump()

void ON_COMPONENT_INDEX::Dump ( class ON_TextLog text_log) const

◆ IsAnnotationComponentIndex()

bool ON_COMPONENT_INDEX::IsAnnotationComponentIndex ( ) const

Returns: True if m_type = dim_... and m_index >= 0.

◆ IsBrepComponentIndex()

bool ON_COMPONENT_INDEX::IsBrepComponentIndex ( ) const

Returns: True if m_type is set to one of the brep TYPE enum values and m_index >= 0.

◆ IsExtrusionComponentIndex()

bool ON_COMPONENT_INDEX::IsExtrusionComponentIndex ( ) const

Returns: True if m_type = extrusion_bottom_profile, extrusion_top_profile, extrusion_wall_edge, extrusion_wall_surface, extrusion_cap_surface or extrusion_path and m_index is reasonable.

◆ IsExtrusionPathComponentIndex()

bool ON_COMPONENT_INDEX::IsExtrusionPathComponentIndex ( ) const

Returns: True if m_type = extrusion_path and -1 <= m_index <= 1.

◆ IsExtrusionProfileComponentIndex()

bool ON_COMPONENT_INDEX::IsExtrusionProfileComponentIndex ( ) const

Returns: True if m_type = extrusion_bottom_profile or extrusion_top_profile and m_index >= 0.

◆ IsExtrusionWallComponentIndex()

bool ON_COMPONENT_INDEX::IsExtrusionWallComponentIndex ( ) const

Returns: True if m_type = extrusion_wall_surface or extrusion_wall_edge and m_index >= 0.

◆ IsExtrusionWallEdgeComponentIndex()

bool ON_COMPONENT_INDEX::IsExtrusionWallEdgeComponentIndex ( ) const

Returns: True if m_type = extrusion_wall_edge and m_index >= 0.

◆ IsExtrusionWallSurfaceComponentIndex()

bool ON_COMPONENT_INDEX::IsExtrusionWallSurfaceComponentIndex ( ) const

Returns: True if m_type = extrusion_wall_surface and m_index >= 0.

◆ IsGroupMemberComponentIndex()

bool ON_COMPONENT_INDEX::IsGroupMemberComponentIndex ( ) const

Returns: True if m_type = group_member and m_index >= 0.

◆ IsHatchLoopComponentIndex()

bool ON_COMPONENT_INDEX::IsHatchLoopComponentIndex ( ) const

Returns: True if m_type = hatch_loop and m_index >= 0.

◆ IsIDefComponentIndex()

bool ON_COMPONENT_INDEX::IsIDefComponentIndex ( ) const

Returns: True if m_type = idef_part and m_index >= 0.

◆ IsMeshComponentIndex()

bool ON_COMPONENT_INDEX::IsMeshComponentIndex ( ) const

Returns: True if m_type is set to one of the mesh or meshtop TYPE enum values and m_index >= 0.

◆ IsNotSet()

bool ON_COMPONENT_INDEX::IsNotSet ( ) const

◆ IsPointCloudComponentIndex()

bool ON_COMPONENT_INDEX::IsPointCloudComponentIndex ( ) const

Returns: True if m_type = pointcloud_point and m_index >= 0.

◆ IsPolyCurveComponentIndex()

bool ON_COMPONENT_INDEX::IsPolyCurveComponentIndex ( ) const

Returns: True if m_type = polycurve_segment and m_index >= 0.

◆ IsSet()

bool ON_COMPONENT_INDEX::IsSet ( ) const

Returns: True if m_type is set to a TYPE enum value between brep_vertex and dim_leader_point.

◆ IsSubDComponentIndex()

bool ON_COMPONENT_INDEX::IsSubDComponentIndex ( ) const

Returns: True if m_type is set to one of the subd TYPE enum values and m_index >= 0.

◆ operator!=()

bool ON_COMPONENT_INDEX::operator!= ( const ON_COMPONENT_INDEX other) const

◆ operator<()

bool ON_COMPONENT_INDEX::operator< ( const ON_COMPONENT_INDEX other) const

◆ operator<=()

bool ON_COMPONENT_INDEX::operator<= ( const ON_COMPONENT_INDEX other) const

◆ operator==()

bool ON_COMPONENT_INDEX::operator== ( const ON_COMPONENT_INDEX other) const

◆ operator>()

bool ON_COMPONENT_INDEX::operator> ( const ON_COMPONENT_INDEX other) const

◆ operator>=()

bool ON_COMPONENT_INDEX::operator>= ( const ON_COMPONENT_INDEX other) const

◆ Set() [1/2]

void ON_COMPONENT_INDEX::Set ( ON_COMPONENT_INDEX::TYPE  type,
int  index 
)

◆ Set() [2/2]

void ON_COMPONENT_INDEX::Set ( ON_COMPONENT_INDEX::TYPE  type,
unsigned int  index 
)

◆ Type()

static ON_COMPONENT_INDEX::TYPE ON_COMPONENT_INDEX::Type ( int  i)
static

Description: Safe conversion of integer value to TYPE enum. Parameters: i - [in] integer with value equal to one of the TYPE enums. Returns: The TYPE enum with the same numeric value or ON_COMPONENT_INDEX::invalid_type if no corresponding enum exists.

◆ UnSet()

void ON_COMPONENT_INDEX::UnSet ( )

Description: Sets m_type = invalid_type and m_index = -1.

◆ UnsignedIndex()

unsigned int ON_COMPONENT_INDEX::UnsignedIndex ( ) const
inline

The interpretation of m_index depends on the m_type value.

m_type m_index interpretation (0 based indices)

no_type used when context makes it clear what array is being index brep_vertex ON_Brep.m_V[] array index brep_edge ON_Brep.m_E[] array index brep_face ON_Brep.m_F[] array index brep_trim ON_Brep.m_T[] array index brep_loop ON_Brep.m_L[] array index mesh_vertex ON_Mesh.m_V[] array index meshtop_vertex ON_MeshTopology.m_topv[] array index meshtop_edge ON_MeshTopology.m_tope[] array index mesh_face ON_Mesh.m_F[] array index mesh_ngon ON_Mesh.Ngon() array index idef_part ON_InstanceDefinition.m_object_uuid[] array index polycurve_segment ON_PolyCurve::m_segment[] array index

extrusion_bottom_profile Use ON_Extrusion::Profile3d() to get 3d profile curve extrusion_top_profile Use ON_Extrusion::Profile3d() to get 3d profile curve extrusion_wall_edge Use ON_Extrusion::WallEdge() to get 3d line curve extrusion_wall_surface Use ON_Extrusion::WallSurface() to get 3d wall surface extrusion_cap_surface 0 = bottom cap, 1 = top cap extrusion_path -1 = entire path, 0 = start of path, 1 = end of path

hatch_loop ON_Hatch::m_loops[] array index

dim_linear_point linear dimension point index dim_radial_point radial dimension point index dim_angular_point angular dimension point index dim_ordinate_point ordinate dimension point index dim_text_point annotation text object point

Member Data Documentation

◆ m_index

int ON_COMPONENT_INDEX::m_index

◆ m_type

TYPE ON_COMPONENT_INDEX::m_type

◆ UnsetComponentIndex

const ON_COMPONENT_INDEX ON_COMPONENT_INDEX::UnsetComponentIndex
static

Description: UnsetComponentIndex.m_type = invalid_type UnsetComponentIndex.m_index = -1 as int = ON_UNSET_UINT_INDEX as unsigned int

◆ WholeObject

const ON_COMPONENT_INDEX ON_COMPONENT_INDEX::WholeObject
static