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

#include <opennurbs_mesh.h>

Public Member Functions

 ON_MeshCache ()=default
 
 ON_MeshCache (const ON_MeshCache &src)
 
 ~ON_MeshCache ()
 
void ClearAllMeshes ()
 
void ClearAllMeshes (bool bDeleteMeshes)
 
void ClearMesh (ON::mesh_type mesh_type)
 
void ClearMesh (ON::mesh_type mesh_type, bool bDeleteMesh)
 
void ClearMesh (ON_UUID mesh_id)
 
void ClearMesh (ON_UUID mesh_id, bool bDeleteMesh)
 
void Dump (ON_TextLog &text_log) const
 
const ON_MeshMesh (ON::mesh_type mesh_type) const
 
const ON_MeshMesh (ON_UUID mesh_id) const
 
unsigned int MeshCount () const
 
std::shared_ptr< ON_MeshMeshSharedPtr (ON::mesh_type mesh_type) const
 
std::shared_ptr< ON_MeshMeshSharedPtr (ON_UUID mesh_id) const
 
ON_MeshCacheoperator= (const ON_MeshCache &src)
 
bool Read (ON_BinaryArchive &archive)
 
void SetMesh (ON::mesh_type mesh_type, const std::shared_ptr< ON_Mesh > &mesh_sp)
 
void SetMesh (ON_UUID mesh_id, const std::shared_ptr< ON_Mesh > &mesh_sp)
 
bool Transform (const ON_Xform &xform)
 
bool Write (ON_BinaryArchive &archive) const
 

Static Public Member Functions

static ON_UUID MeshIdFromMeshType (ON::mesh_type mesh_type)
 

Static Public Attributes

static const ON_UUID AnalysisMeshId
 
static const ON_UUID AnyMeshId
 
static const ON_UUID CoarseMeshId
 Cached mesh with the fewest faces. More...
 
static const ON_MeshCache Empty
 
static const ON_UUID FineMeshId
 Cached mesh with the most faces. More...
 
static const ON_UUID PreviewMeshId
 
static const ON_UUID RenderMeshId
 

Detailed Description

ON_MeshCache

Constructor & Destructor Documentation

◆ ON_MeshCache() [1/2]

ON_MeshCache::ON_MeshCache ( )
default

◆ ~ON_MeshCache()

ON_MeshCache::~ON_MeshCache ( )

◆ ON_MeshCache() [2/2]

ON_MeshCache::ON_MeshCache ( const ON_MeshCache src)

Member Function Documentation

◆ ClearAllMeshes() [1/2]

void ON_MeshCache::ClearAllMeshes ( )

◆ ClearAllMeshes() [2/2]

void ON_MeshCache::ClearAllMeshes ( bool  bDeleteMeshes)

Parameters: bDeleteMeshes - [in] true ON_Mesh will be deleted. false ON_Mesh will not be deleted. This is typically done when the mesh was in the process of being created in a separate thread and memory pool, both of which were killed and the pointer to the mesh is no longer valid.

◆ ClearMesh() [1/4]

void ON_MeshCache::ClearMesh ( ON::mesh_type  mesh_type)

◆ ClearMesh() [2/4]

void ON_MeshCache::ClearMesh ( ON::mesh_type  mesh_type,
bool  bDeleteMesh 
)

Parameters: bDeleteMesh - [in] true ON_Mesh will be deleted. false ON_Mesh will not be deleted. This is typically done when the mesh was in the process of being created in a separate thread and memory pool, both of which were killed and the pointer to the mesh is no longer valid.

◆ ClearMesh() [3/4]

void ON_MeshCache::ClearMesh ( ON_UUID  mesh_id)

Parameters: mesh_id - [in] If mesh_id is ON_MeshCache::AnyMeshId, then every cached mesh will be deleted.

◆ ClearMesh() [4/4]

void ON_MeshCache::ClearMesh ( ON_UUID  mesh_id,
bool  bDeleteMesh 
)

Parameters: bDeleteMesh - [in] true ON_Mesh will be deleted. false ON_Mesh will not be deleted. This is typically done when the mesh was in the process of being created in a separate thread and memory pool, both of which were killed and the pointer to the mesh is no longer valid.

◆ Dump()

void ON_MeshCache::Dump ( ON_TextLog text_log) const

◆ Mesh() [1/2]

const ON_Mesh* ON_MeshCache::Mesh ( ON::mesh_type  mesh_type) const

◆ Mesh() [2/2]

const ON_Mesh* ON_MeshCache::Mesh ( ON_UUID  mesh_id) const

Parameters: mesh_id - [in] If mesh_id is ON_MeshCache::AnyMeshId, then the most recently cached mesh is returned.

◆ MeshCount()

unsigned int ON_MeshCache::MeshCount ( ) const

◆ MeshIdFromMeshType()

static ON_UUID ON_MeshCache::MeshIdFromMeshType ( ON::mesh_type  mesh_type)
static

Returns: The id that corresponds to the obsolete ON::mesh_type enum value. Remarks: Ids are used to allow custom meshes to be cached.

◆ MeshSharedPtr() [1/2]

std::shared_ptr<ON_Mesh> ON_MeshCache::MeshSharedPtr ( ON::mesh_type  mesh_type) const

◆ MeshSharedPtr() [2/2]

std::shared_ptr<ON_Mesh> ON_MeshCache::MeshSharedPtr ( ON_UUID  mesh_id) const

Parameters: mesh_id - [in] If mesh_id is ON_MeshCache::AnyMeshId, then the most recently cached mesh is returned.

◆ operator=()

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

◆ Read()

bool ON_MeshCache::Read ( ON_BinaryArchive archive)

◆ SetMesh() [1/2]

void ON_MeshCache::SetMesh ( ON::mesh_type  mesh_type,
const std::shared_ptr< ON_Mesh > &  mesh_sp 
)

◆ SetMesh() [2/2]

void ON_MeshCache::SetMesh ( ON_UUID  mesh_id,
const std::shared_ptr< ON_Mesh > &  mesh_sp 
)

Parameters: mesh_id - [in] mesh_id cannot be nil or ON_MeshCache::AnyMeshId.

◆ Transform()

bool ON_MeshCache::Transform ( const ON_Xform xform)

◆ Write()

bool ON_MeshCache::Write ( ON_BinaryArchive archive) const

Member Data Documentation

◆ AnalysisMeshId

const ON_UUID ON_MeshCache::AnalysisMeshId
static

◆ AnyMeshId

const ON_UUID ON_MeshCache::AnyMeshId
static

◆ CoarseMeshId

const ON_UUID ON_MeshCache::CoarseMeshId
static

Cached mesh with the fewest faces.

◆ Empty

const ON_MeshCache ON_MeshCache::Empty
static

◆ FineMeshId

const ON_UUID ON_MeshCache::FineMeshId
static

Cached mesh with the most faces.

◆ PreviewMeshId

const ON_UUID ON_MeshCache::PreviewMeshId
static

◆ RenderMeshId

const ON_UUID ON_MeshCache::RenderMeshId
static