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

#include <opennurbs_mesh.h>

Inheritance diagram for ON_MeshComponentRef:
ON_Geometry ON_Object

Public Member Functions

 ON_MeshComponentRef ()
 
 ON_MeshComponentRef (const class ON_Mesh *mesh, ON_COMPONENT_INDEX ci)
 
 ~ON_MeshComponentRef ()
 
ON_COMPONENT_INDEX ComponentIndex () const override
 
int Dimension () const override
 overrides of virtual ON_Geometry functions More...
 
void Dump (ON_TextLog &) const override
 
bool GetBBox (double *boxmin, double *boxmax, bool bGrowBox=false) const override
 virtual ON_Geometry GetBBox override
More...
 
unsigned int GetMeshFace (const class ON_MeshFace *&mesh_face) const
 
unsigned int GetMeshTopologyEdge (const struct ON_MeshTopologyEdge *&tope) const
 
unsigned int GetMeshTopologyEdgeAndLine (const struct ON_MeshTopologyEdge *&tope, ON_Line &line) const
 
unsigned int GetMeshTopologyEdgeLine (class ON_Line &line) const
 
unsigned int GetMeshTopologyVertex (const struct ON_MeshTopologyVertex *&topv) const
 
unsigned int GetMeshTopologyVertexAndPoint (const struct ON_MeshTopologyVertex *&topv, class ON_3dPoint &point) const
 
unsigned int GetMeshTopologyVertexPoint (class ON_3dPoint &point) const
 
unsigned int GetVertexPoint (class ON_3dPoint &point) const
 
bool IsValid (class ON_TextLog *text_log=nullptr) const override
 overrides of virtual ON_Object functions More...
 
const class ON_MeshMesh () const
 
const class ON_MeshFaceMeshFace () const
 
unsigned int MeshFaceIndex () const
 
const class ON_MeshNgonMeshNgon () const
 
const class ON_MeshNgonMeshNgon (class ON_MeshNgonBuffer &ngon_buffer) const
 
unsigned int MeshNgonIndex () const
 
const class ON_MeshTopologyMeshTopology () const
 
const struct ON_MeshTopologyEdgeMeshTopologyEdge () const
 
unsigned int MeshTopologyEdgeIndex () const
 
const struct ON_MeshTopologyVertexMeshTopologyVertex () const
 
unsigned int MeshTopologyVertexIndex () const
 
ON::object_type ObjectType () const override
 
ON_MeshComponentRefoperator= (const ON_MeshComponentRef &)
 
void Set (const class ON_Mesh *mesh, ON_COMPONENT_INDEX ci)
 
unsigned int SizeOf () const override
 
bool Transform (const ON_Xform &xform) override
 
unsigned int VertexIndex () const
 
ON_3dPoint VertexPoint () const
 
- Public Member Functions inherited from ON_Geometry
 ON_Geometry ()=default
 
 ON_Geometry (const ON_Geometry &)=default
 
 ~ON_Geometry ()=default
 
ON_BoundingBox BoundingBox () const
 
virtual class ON_BrepBrepForm (class ON_Brep *brep=nullptr) const
 
virtual void ClearBoundingBox ()
 
virtual bool EvaluatePoint (const class ON_ObjRef &objref, ON_3dPoint &P) const
 
bool GetBoundingBox (ON_3dPoint &bbox_min, ON_3dPoint &bbox_max, bool bGrowBox=false) const
 
bool GetBoundingBox (ON_BoundingBox &bbox, bool bGrowBox=false) const
 
virtual bool GetTightBoundingBox (class ON_BoundingBox &tight_bbox, bool bGrowBox=false, const class ON_Xform *xform=nullptr) const
 
virtual bool HasBrepForm () const
 
virtual bool IsDeformable () const
 
virtual bool IsMorphable () const
 
virtual bool MakeDeformable ()
 
virtual bool Morph (const class ON_SpaceMorph &morph)
 
ON_Geometryoperator= (const ON_Geometry &)=default
 
bool Rotate (double rotation_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center)
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center)
 
bool Scale (double scale_factor)
 
virtual bool SwapCoordinates (int i, int j)
 
bool Translate (const ON_3dVector &translation_vector)
 
- Public Member Functions inherited from ON_Object
 ON_Object () ON_NOEXCEPT
 
 ON_Object (const ON_Object &)
 
virtual ~ON_Object ()
 
virtual ON_AggregateComponentStatus AggregateComponentStatus () const
 
bool AttachUserData (class ON_UserData *pUserData)
 
unsigned int ClearAllComponentStates () const
 
virtual unsigned int ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const
 
virtual unsigned int ClearComponentStates (ON_ComponentStatus states_to_clear) const
 
void CopyUserData (const ON_Object &source_object)
 
unsigned int CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution)
 
virtual ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
virtual bool DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count)
 
virtual void DestroyRuntimeCache (bool bDelete=true)
 
bool DetachUserData (class ON_UserData *pUserData)
 
void EmergencyDestroy ()
 
class ON_UserDataFirstUserData () const
 
virtual unsigned int GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const
 
class ON_UserDataGetUserData (const ON_UUID &userdata_uuid) const
 
bool GetUserString (const wchar_t *key, ON_wString &string_value) const
 
int GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const
 
int GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const
 
bool IsCorrupt (bool bRepair, bool bSilentError, class ON_TextLog *text_log) const
 
bool IsKindOf (const ON_ClassId *pClassId) const
 
virtual void MarkAggregateComponentStatusAsNotCurrent () const
 
virtual void MemoryRelocate ()
 
virtual ON_UUID ModelObjectId () const
 
void MoveUserData (ON_Object &source_object)
 
unsigned int MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems)
 
ON_Objectoperator= (const ON_Object &)
 
void PurgeUserData ()
 
virtual bool Read (ON_BinaryArchive &binary_archive)
 
virtual unsigned int SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const
 
virtual unsigned int SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const
 
bool SetUserString (const wchar_t *key, const wchar_t *string_value)
 
int SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace)
 
bool ThisIsNullptr (bool bSilentError) const
 
void TransformUserData (const class ON_Xform &xform)
 
virtual bool UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map)
 
int UserStringCount () const
 
virtual bool Write (ON_BinaryArchive &binary_archive) const
 

Static Public Member Functions

static int Compare (const ON_MeshComponentRef *lhs, const ON_MeshComponentRef *rhs)
 
static int Compare2 (const ON_MeshComponentRef *const *lhs, const ON_MeshComponentRef *const *rhs)
 
static int CompareMeshPointer (const ON_MeshComponentRef *lhs, const ON_MeshComponentRef *rhs)
 

Static Public Attributes

static const ON_MeshComponentRef Unset
 
- Static Public Attributes inherited from ON_Geometry
const static ON_Geometry Unset
 

Additional Inherited Members

- Public Types inherited from ON_Object
enum  UserDataConflictResolution : unsigned char {
  UserDataConflictResolution::destination_object = 0, UserDataConflictResolution::source_object = 1, UserDataConflictResolution::source_copycount_gt = 2, UserDataConflictResolution::source_copycount_ge = 3,
  UserDataConflictResolution::destination_copycount_gt = 4, UserDataConflictResolution::destination_copycount_ge = 5, UserDataConflictResolution::delete_item = 6
}
 

Constructor & Destructor Documentation

◆ ON_MeshComponentRef() [1/2]

ON_MeshComponentRef::ON_MeshComponentRef ( )

◆ ON_MeshComponentRef() [2/2]

ON_MeshComponentRef::ON_MeshComponentRef ( const class ON_Mesh mesh,
ON_COMPONENT_INDEX  ci 
)

◆ ~ON_MeshComponentRef()

ON_MeshComponentRef::~ON_MeshComponentRef ( )

Member Function Documentation

◆ Compare()

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

Description: Dictionary compare: 1) Compare m_mesh pointer values as unsigned values 2) ON_COMPONENT_INDEX::Compare() m_mesh_ci values

◆ Compare2()

static int ON_MeshComponentRef::Compare2 ( const ON_MeshComponentRef *const *  lhs,
const ON_MeshComponentRef *const *  rhs 
)
static

Description: Dictionary compare: 1) Compare m_mesh pointer values as unsigned values 2) ON_COMPONENT_INDEX::Compare() m_mesh_ci values

◆ CompareMeshPointer()

static int ON_MeshComponentRef::CompareMeshPointer ( const ON_MeshComponentRef lhs,
const ON_MeshComponentRef rhs 
)
static

Description: Compare m_mesh pointer values as unsigned values. Ignore m_mesh_ci values.

◆ ComponentIndex()

ON_COMPONENT_INDEX ON_MeshComponentRef::ComponentIndex ( ) const
overridevirtual

Description: Override of the virtual ON_Geometry::ComponentIndex(). Returns: A mesh component index for the face. The type is ON_COMPONENT_INDEX::mesh_face and the index is the index into the ON_Mesh.m_F[] array.

Reimplemented from ON_Geometry.

◆ Dimension()

int ON_MeshComponentRef::Dimension ( ) const
overridevirtual

overrides of virtual ON_Geometry functions

Reimplemented from ON_Geometry.

◆ Dump()

void ON_MeshComponentRef::Dump ( ON_TextLog ) const
overridevirtual

Description: Creates a text dump of the object. Remarks: Dump() is intended for debugging and is not suitable for creating high quality text descriptions of an object.

The default implementations of this virtual function prints the class's name.

Reimplemented from ON_Object.

◆ GetBBox()

bool ON_MeshComponentRef::GetBBox ( double *  boxmin,
double *  boxmax,
bool  bGrowBox = false 
) const
overridevirtual

virtual ON_Geometry GetBBox override

Reimplemented from ON_Geometry.

◆ GetMeshFace()

unsigned int ON_MeshComponentRef::GetMeshFace ( const class ON_MeshFace *&  mesh_face) const

Returns: If the component is a face or an ngon made of a single face, this returns the face. Otherwise null is returned. Remarks: The best way to write code that works with triangle, quad and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).

◆ GetMeshTopologyEdge()

unsigned int ON_MeshComponentRef::GetMeshTopologyEdge ( const struct ON_MeshTopologyEdge *&  tope) const

◆ GetMeshTopologyEdgeAndLine()

unsigned int ON_MeshComponentRef::GetMeshTopologyEdgeAndLine ( const struct ON_MeshTopologyEdge *&  tope,
ON_Line line 
) const

Parameters: line - [out] If the component is an edge, the 3d line is returned here. Returns: If the component is an edge, this returns the edge. Otherwise null is returned.

◆ GetMeshTopologyEdgeLine()

unsigned int ON_MeshComponentRef::GetMeshTopologyEdgeLine ( class ON_Line line) const

◆ GetMeshTopologyVertex()

unsigned int ON_MeshComponentRef::GetMeshTopologyVertex ( const struct ON_MeshTopologyVertex *&  topv) const

Returns: If the component is a vertex and mesh topology exists or the component is a mesh topology vertex, then this returns the mesh topology vertex index. Otherwise ON_UNSET_UINT_INDEX is returned.

◆ GetMeshTopologyVertexAndPoint()

unsigned int ON_MeshComponentRef::GetMeshTopologyVertexAndPoint ( const struct ON_MeshTopologyVertex *&  topv,
class ON_3dPoint point 
) const

Returns: If the component is a vertex and mesh topology exists or the component is a mesh topology vertex, then this returns the mesh topology vertex index. Otherwise ON_UNSET_UINT_INDEX is returned.

◆ GetMeshTopologyVertexPoint()

unsigned int ON_MeshComponentRef::GetMeshTopologyVertexPoint ( class ON_3dPoint point) const

Returns: If the component is a vertex and mesh topology exists or the component is a mesh topology vertex, then this returns the mesh topology vertex index. Otherwise ON_UNSET_UINT_INDEX is returned.

◆ GetVertexPoint()

unsigned int ON_MeshComponentRef::GetVertexPoint ( class ON_3dPoint point) const

Parameters: point - [out] location of the vertex Returns: If the component is a vertex, this returns the vertex index. Otherwise ON_UNSET_UINT_INDEX is returned.

◆ IsValid()

bool ON_MeshComponentRef::IsValid ( class ON_TextLog text_log = nullptr) const
overridevirtual

overrides of virtual ON_Object functions

Reimplemented from ON_Geometry.

◆ Mesh()

const class ON_Mesh* ON_MeshComponentRef::Mesh ( ) const

Returns: The referenced mesh.

◆ MeshFace()

const class ON_MeshFace* ON_MeshComponentRef::MeshFace ( ) const

Returns: If the component is a face or an ngon made of a single face, this returns the face. Otherwise null is returned. Remarks: The best way to write code that works with triangle, quad and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).

◆ MeshFaceIndex()

unsigned int ON_MeshComponentRef::MeshFaceIndex ( ) const

Returns: If the component is a face or an ngon containing a single face, this returns the face index. Otherwise ON_UNSET_UINT_INDEX is returned. Remarks: The best way to write code that works with triangle, quad and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).

◆ MeshNgon() [1/2]

const class ON_MeshNgon* ON_MeshComponentRef::MeshNgon ( ) const

Returns: If the component is an ngon or a face in an ngon, this returns the ngon. Otherwise null is returned. Remarks: The best way to write code that works with triangle, quad and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).

◆ MeshNgon() [2/2]

const class ON_MeshNgon* ON_MeshComponentRef::MeshNgon ( class ON_MeshNgonBuffer ngon_buffer) const

Returns:

  • If the component references to an ON_MeshNgon in the mesh, then a pointer to this ngon is returned.
  • If the component references an ON_MeshFace triangle or quad, then then a single face ON_MeshNgon is created in the memory in ngon_buffer.
  • Otherwise, null is returned.

◆ MeshNgonIndex()

unsigned int ON_MeshComponentRef::MeshNgonIndex ( ) const

Returns: If the component is an ngon or a face in an ngon, this returns the ngon index. Otherwise ON_UNSET_UINT_INDEX is returned. Remarks: The best way to write code that works with triangle, quad and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).

◆ MeshTopology()

const class ON_MeshTopology* ON_MeshComponentRef::MeshTopology ( ) const

Returns: If the mesh topology exists or the component references a mesh topology component, then this returns a pointer to the mesh topology. Otherwise null is returned.

◆ MeshTopologyEdge()

const struct ON_MeshTopologyEdge* ON_MeshComponentRef::MeshTopologyEdge ( ) const

Returns: If the component is an edge, this returns the edge. Otherwise null is returned.

◆ MeshTopologyEdgeIndex()

unsigned int ON_MeshComponentRef::MeshTopologyEdgeIndex ( ) const

Returns: If the component is a mesh topology edge, this returns the mesh topology edge index. Otherwise ON_UNSET_UINT_INDEX is returned.

◆ MeshTopologyVertex()

const struct ON_MeshTopologyVertex* ON_MeshComponentRef::MeshTopologyVertex ( ) const

Returns: If the component is a vertex and mesh topology exists or the component is a mesh topology vertex, then this returns a pointer to the mesh topology vertex index. Otherwise null is returned.

◆ MeshTopologyVertexIndex()

unsigned int ON_MeshComponentRef::MeshTopologyVertexIndex ( ) const

Returns: If the component is a vertex and mesh topology exists or the component is a mesh topology vertex, then this returns the mesh topology vertex index. Otherwise ON_UNSET_UINT_INDEX is returned.

◆ ObjectType()

ON::object_type ON_MeshComponentRef::ObjectType ( ) const
overridevirtual

Description: Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.

Returns: ON::object_type enum value.

Remarks: The default implementation of this virtual function returns ON::unknown_object_type

Reimplemented from ON_Object.

◆ operator=()

ON_MeshComponentRef& ON_MeshComponentRef::operator= ( const ON_MeshComponentRef )

◆ Set()

void ON_MeshComponentRef::Set ( const class ON_Mesh mesh,
ON_COMPONENT_INDEX  ci 
)

◆ SizeOf()

unsigned int ON_MeshComponentRef::SizeOf ( ) const
overridevirtual

Returns: An estimate of the amount of memory the class uses in bytes.

Reimplemented from ON_Object.

◆ Transform()

bool ON_MeshComponentRef::Transform ( const ON_Xform xform)
overridevirtual

Description: Transforms the object.

Parameters: xform - [in] transformation to apply to object. If xform.IsSimilarity() is zero, then you may want to call MakeSquishy() before calling Transform.

Remarks: When overriding this function, be sure to include a call to ON_Object::TransformUserData() which takes care of transforming any ON_UserData that may be attached to the object.

See Also: ON_Geometry::IsDeformable();

Remarks: Classes derived from ON_Geometry should call ON_Geometry::Transform() to handle user data transformations and then transform their definition.

Reimplemented from ON_Geometry.

◆ VertexIndex()

unsigned int ON_MeshComponentRef::VertexIndex ( ) const

Returns: If the component is a vertex, this returns the vertex index. Otherwise ON_UNSET_UINT_INDEX is returned.

◆ VertexPoint()

ON_3dPoint ON_MeshComponentRef::VertexPoint ( ) const

Returns: If the component is a mesh vertex or mesh topology vertex, then this returns the vertex location. Otherwise ON_3dPoint::UnsetPoint is returned.

Member Data Documentation

◆ Unset

const ON_MeshComponentRef ON_MeshComponentRef::Unset
static