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

#include <opennurbs_mesh.h>

Public Member Functions

 ON_MeshRef () ON_NOEXCEPT
 
 ON_MeshRef (const ON_MeshRef &src) ON_NOEXCEPT
 
 ~ON_MeshRef ()
 
void Clear ()
 
class ON_MeshCopyMesh (const ON_Mesh &src)
 
class ON_MeshCopyMesh (const ON_MeshRef &src)
 
bool IsEmpty () const
 
bool IsNotEmpty () const
 
const class ON_MeshMesh () const
 
class ON_MeshNewMesh ()
 
ON_MeshRefoperator= (const ON_MeshRef &src)
 
unsigned int ReferenceCount () const
 
class ON_MeshSetMeshForExperts (class ON_Mesh *&mesh)
 
const std::shared_ptr< class ON_Mesh > & SharedMesh () const
 
class ON_MeshUniqueMesh ()
 

Static Public Attributes

static const ON_MeshRef Empty
 

Detailed Description

ON_MeshRef

Constructor & Destructor Documentation

◆ ON_MeshRef() [1/2]

ON_MeshRef::ON_MeshRef ( )

◆ ~ON_MeshRef()

ON_MeshRef::~ON_MeshRef ( )

◆ ON_MeshRef() [2/2]

ON_MeshRef::ON_MeshRef ( const ON_MeshRef src)

Member Function Documentation

◆ Clear()

void ON_MeshRef::Clear ( )

Description: Remove this reference to the managed ON_Mesh. If this is the last reference, then the managed ON_Mesh is deleted.

◆ CopyMesh() [1/2]

class ON_Mesh& ON_MeshRef::CopyMesh ( const ON_Mesh src)

Description: Allocates a new ON_Mesh and has this ON_MeshRef reference it. Parameters: src - [in] The new ON_Mesh managed by this ON_MeshRef will be a copy of src. Returns: A reference to the new ON_Mesh managed by this ON_MeshRef.

◆ CopyMesh() [2/2]

class ON_Mesh& ON_MeshRef::CopyMesh ( const ON_MeshRef src)

Description: Allocates a new ON_Mesh and has this ON_MeshRef reference it. Parameters: src - [in] The new ON_Mesh managed by this ON_MeshRef will be a copy of src.Mesh(). Returns: A reference to the new ON_Mesh managed by this ON_MeshRef.

◆ IsEmpty()

bool ON_MeshRef::IsEmpty ( ) const

Returns: True if no ON_Mesh is being managed by this ON_MeshRef. Remarks: It is always the case that exactly one of IsEmpty() and IsNotEmpty() is true. Both are provided so code using ON_MeshRef can be clean and easily read.

◆ IsNotEmpty()

bool ON_MeshRef::IsNotEmpty ( ) const

Returns: True if an ON_Mesh is being managed by this ON_MeshRef. Remarks: It is always the case that exactly one of IsEmpty() and IsNotEmpty() is true. Both are provided so code using ON_MeshRef can be clean and easily read.

◆ Mesh()

const class ON_Mesh& ON_MeshRef::Mesh ( ) const

Returns: The mesh being managed by this ON_MeshRef. If this ON_MeshRef is not managing an ON_Mesh, then ON_Mesh::Empty is returned.

◆ NewMesh()

class ON_Mesh& ON_MeshRef::NewMesh ( )

Description: Allocates a new empty ON_Mesh and has this ON_MeshRef reference it.

◆ operator=()

ON_MeshRef& ON_MeshRef::operator= ( const ON_MeshRef src)

◆ ReferenceCount()

unsigned int ON_MeshRef::ReferenceCount ( ) const

Returns: Number of references to the managed ON_Mesh, including the one by this ON_MeshRef.

◆ SetMeshForExperts()

class ON_Mesh* ON_MeshRef::SetMeshForExperts ( class ON_Mesh *&  mesh)

Description: Expert user function to have this ON_MeshRef manage mesh. Parameters: mesh - [in/out] mesh must point to an ON_Mesh that was constructed on the heap using an operator new call with a public ON_Mesh constructor. Returns: a pointer to the managed mesh Example: ON_Mesh* mesh = new ON_Mesh(...); ON_MeshRef mesh_ref; ON_Mesh* managed_mesh = mesh_ref.SetMesh(mesh); / mesh = nullptr / managed_mesh = pointer you can use

◆ SharedMesh()

const std::shared_ptr<class ON_Mesh>& ON_MeshRef::SharedMesh ( ) const

Returns: The mesh being managed by this ON_MeshRef. If this ON_MeshRef is not managing an ON_Mesh, then ON_Mesh::Empty is returned.

◆ UniqueMesh()

class ON_Mesh& ON_MeshRef::UniqueMesh ( )

Description: If ReferenceCount() > 1, then have this ON_MeshRef reference a new copy. Otherwise do nothing. The result being that this will be the unique reference to the ON_Mesh managed by this ON_MeshRef. Returns: A reference to the ON_Mesh uniquely managed by this ON_MeshRef.

Member Data Documentation

◆ Empty

const ON_MeshRef ON_MeshRef::Empty
static