CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
OdGsMaterialCache Class Reference

#include <GsMaterialCache.h>

Inheritance diagram for OdGsMaterialCache:
OdRxObject

Public Member Functions

 OdGsMaterialCache ()
 
 ~OdGsMaterialCache ()
 
 ODRX_DECLARE_MEMBERS (OdGsMaterialCache)
 
void setBaseModel (OdGsBaseModel *pModel)
 
OdGsBaseModelbaseModel ()
 
const OdGsBaseModelbaseModel () const
 
OdGsMaterialNodesearchNode (OdDbStub *mtl) const
 
OdGsMaterialNodesetMaterial (OdGsBaseVectorizer &view, OdDbStub *mtl, bool bDontReinit=false)
 
bool removeNode (OdDbStub *mtl)
 
bool removeNode (OdGsCache *pCsh)
 
OdUInt32 getCacheSize () const
 
OdGsMaterialNodegetCacheNode (OdUInt32 n) const
 
void addNode (OdGsBaseVectorizer &view, OdDbStub *mtl)
 
void clearCache ()
 
void invalidateCache (const OdGsBaseModule *pModule=NULL)
 
bool saveMaterialCache (OdGsFiler *pFiler) const
 
bool loadMaterialCache (OdGsFiler *pFiler)
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Static Public Member Functions

static OdSmartPtr< OdGsMaterialCachecreateObject (OdGsBaseModel *pModel)
 
- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Protected Attributes

OdUInt32 m_nMaterials
 
OdGsMaterialNodem_pMaterials
 
OdGsBaseModelm_pModel
 
OdMutexPtr m_pCacheMutex
 

Detailed Description

<group OdGs_Classes>

Definition at line 42 of file GsMaterialCache.h.

Constructor & Destructor Documentation

◆ OdGsMaterialCache()

OdGsMaterialCache::OdGsMaterialCache ( )

Constructor for the OdGsLightNode class. Sets material cache and associated model to NULL.

◆ ~OdGsMaterialCache()

OdGsMaterialCache::~OdGsMaterialCache ( )

Destructor for the OdGsLightNode class.

Member Function Documentation

◆ addNode()

void OdGsMaterialCache::addNode ( OdGsBaseVectorizer view,
OdDbStub *  mtl 
)
inline

Adds a material node to cache.

Parameters
view[in] Vectorization view.
mtl[in] Persistent object ID that represents a material.

Definition at line 134 of file GsMaterialCache.h.

◆ baseModel() [1/2]

OdGsBaseModel * OdGsMaterialCache::baseModel ( )
inline

Retrieves pointer to the base model associated with this object.

Definition at line 73 of file GsMaterialCache.h.

◆ baseModel() [2/2]

const OdGsBaseModel * OdGsMaterialCache::baseModel ( ) const
inline

Retrieves pointer to the base model associated with this object.

Definition at line 78 of file GsMaterialCache.h.

◆ clearCache()

void OdGsMaterialCache::clearCache ( )

Clears cache.

◆ createObject()

static OdSmartPtr< OdGsMaterialCache > OdGsMaterialCache::createObject ( OdGsBaseModel pModel)
static

Creates a material cache and returns a smart pointer to it.

Parameters
pModel[in] Pointer to base model.

◆ getCacheNode()

OdGsMaterialNode * OdGsMaterialCache::getCacheNode ( OdUInt32  n) const

◆ getCacheSize()

OdUInt32 OdGsMaterialCache::getCacheSize ( ) const

Retrieves a number of cache elements.

◆ invalidateCache()

void OdGsMaterialCache::invalidateCache ( const OdGsBaseModule pModule = NULL)

Invalidates material cache.

Parameters
pModule[in] Pointer to module which is erased from the map cache.

◆ loadMaterialCache()

bool OdGsMaterialCache::loadMaterialCache ( OdGsFiler pFiler)

Loads material cache from the specified filer.

Parameters
pFiler[in] Pointer to a filer where to load the material item from.
Returns
true if material cache is successfully loaded, false otherwise.

◆ ODRX_DECLARE_MEMBERS()

OdGsMaterialCache::ODRX_DECLARE_MEMBERS ( OdGsMaterialCache  )

◆ removeNode() [1/2]

bool OdGsMaterialCache::removeNode ( OdDbStub *  mtl)

Removes material node on Erase.

Parameters
mtl[in] Persistent object ID that represents a material.

◆ removeNode() [2/2]

bool OdGsMaterialCache::removeNode ( OdGsCache pCsh)

Removes material node on Erase.

Parameters
pCsh[in] Pointer to GS cache.

◆ saveMaterialCache()

bool OdGsMaterialCache::saveMaterialCache ( OdGsFiler pFiler) const

Saves material cache to the specified filer.

Parameters
pFiler[in] Pointer to a filer where to save the material item.
Returns
true if material cache is successfully saved, false otherwise.

◆ searchNode()

OdGsMaterialNode * OdGsMaterialCache::searchNode ( OdDbStub *  mtl) const

Searches for already initialized node by the persistent object ID.

Parameters
mtl[in] Persistent object ID that represents a material.

◆ setBaseModel()

void OdGsMaterialCache::setBaseModel ( OdGsBaseModel pModel)

Sets the base model for this object.

Parameters
pModel[in] Pointer to base model.

◆ setMaterial()

OdGsMaterialNode * OdGsMaterialCache::setMaterial ( OdGsBaseVectorizer view,
OdDbStub *  mtl,
bool  bDontReinit = false 
)

Initializes a new node, if not already initialized or changed and set's as current node and returns a pointer to the initialized node.

Parameters
view[in] Vectorization view.
mtl[in] Persistent object ID that represents a material.
bDontReinit[in] Flag that specifies whether initialization should not be performed if this node is previously initialized and not changed.

Member Data Documentation

◆ m_nMaterials

OdUInt32 OdGsMaterialCache::m_nMaterials
protected

Definition at line 45 of file GsMaterialCache.h.

◆ m_pCacheMutex

OdMutexPtr OdGsMaterialCache::m_pCacheMutex
mutableprotected

Definition at line 48 of file GsMaterialCache.h.

◆ m_pMaterials

OdGsMaterialNode* OdGsMaterialCache::m_pMaterials
protected

Definition at line 46 of file GsMaterialCache.h.

◆ m_pModel

OdGsBaseModel* OdGsMaterialCache::m_pModel
protected

Definition at line 47 of file GsMaterialCache.h.


The documentation for this class was generated from the following file: