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

#include <DbLayerState.h>

Inheritance diagram for OdDbLayerStateManager:
OdRxObject

Public Types

enum  LayerStateMask {
  kNone = 0x0000 , kOn = 0x0001 , kFrozen = 0x0002 , kLocked = 0x0004 ,
  kPlot = 0x0008 , kNewViewport = 0x0010 , kColor = 0x0020 , kLineType = 0x0040 ,
  kLineWeight = 0x0080 , kPlotStyle = 0x0100 , kCurrentViewport = 0x0200 , kTransparency = 0x0400 ,
  kAll , kStateIsHidden = 0x8000 , kLastRestored = 0x10000 , kDecomposition = kAll | 0x20000
}
 
enum  { kUndefDoNothing = 0 , kUndefTurnOff = 1 , kUndefFreeze = 2 , kRestoreAsOverrides = 4 }
 

Public Member Functions

 ODRX_DECLARE_MEMBERS (OdDbLayerStateManager)
 
 OdDbLayerStateManager ()
 
 ~OdDbLayerStateManager ()
 
bool addReactor (OdDbLayerStateManagerReactor *pReactor)
 
bool removeReactor (OdDbLayerStateManagerReactor *pReactor)
 
OdDbObjectId layerStatesDictionaryId (bool bCreateIfNotPresent=false)
 
bool hasLayerState (const OdString &sName)
 
OdResult saveLayerState (const OdString &sName, LayerStateMask mask)
 
OdResult restoreLayerState (const OdString &sName)
 
OdResult setLayerStateMask (const OdString &sName, LayerStateMask mask)
 
OdResult getLayerStateMask (const OdString &sName, LayerStateMask &returnMask)
 
OdResult deleteLayerState (const OdString &sName)
 
OdResult renameLayerState (const OdString &sName, const OdString &sNewName)
 
OdResult importLayerState (OdStreamBuf *pStreamBuf)
 
OdResult importLayerState (OdStreamBuf *pStreamBuf, OdString &sName)
 
OdResult exportLayerState (const OdString &sNameToExport, OdStreamBuf *pStreamBuf)
 
OdResult saveLayerState (const OdString &sName, LayerStateMask mask, const OdDbObjectId &idVp)
 
OdResult restoreLayerState (const OdString &sName, const OdDbObjectId &idVp, int nRestoreFlags=0, const LayerStateMask *pClientMask=NULL)
 
OdResult setLayerStateDescription (const OdString &sName, const OdString &sDesc)
 
OdResult getLayerStateDescription (const OdString &sName, OdString &sDesc)
 
bool layerStateHasViewportData (const OdString &sName)
 
OdResult importLayerStateFromDb (const OdString &pStateName, OdDbDatabase *pDb)
 
OdResult getLayerStateNames (OdStringArray &lsArray, bool bIncludeHidden=true, bool bIncludeXref=true)
 
OdResult getLastRestoredLayerState (OdString &sName, OdDbObjectId &restoredLSId)
 
OdResult getLayerStateLayers (OdStringArray &layerArray, const OdString &sName, bool bInvert=false)
 
bool compareLayerStateToDb (const OdString &sName, const OdDbObjectId &idVp)
 
OdResult addLayerStateLayers (const OdString &sName, const OdDbObjectIdArray &layerIds)
 
OdResult removeLayerStateLayers (const OdString &sName, const OdStringArray &layerNames)
 
bool isDependentLayerState (const OdString &sName)
 
OdDbDatabasegetDatabase () const
 
- 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
 

Protected Member Functions

 OdDbLayerStateManager (OdDbLayerStateManagerImpl *)
 

Protected Attributes

OdDbLayerStateManagerImplm_pImpl
 

Friends

class OdDbLayerStateManagerImpl
 
class OdDbDatabase
 

Additional Inherited Members

- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Detailed Description

This class represents Layer States Manager objects. Corresponding C++ library: TD_Db <group OdDb_Classes>

Definition at line 38 of file DbLayerState.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

This enumeration determines flags that are used in restore layer state operations. The first three flags indicate what to do with the layers that are not included in the layer state being restored.

Enumerator
kUndefDoNothing 
kUndefTurnOff 
kUndefFreeze 
kRestoreAsOverrides 

Definition at line 87 of file DbLayerState.h.

◆ LayerStateMask

Enumeration that determines which layer attributes are to be stored in the LayerState.

Enumerator
kNone 
kOn 
kFrozen 
kLocked 
kPlot 
kNewViewport 
kColor 
kLineType 
kLineWeight 
kPlotStyle 
kCurrentViewport 
kTransparency 
kAll 
kStateIsHidden 
kLastRestored 
kDecomposition 

Definition at line 61 of file DbLayerState.h.

Constructor & Destructor Documentation

◆ OdDbLayerStateManager() [1/2]

OdDbLayerStateManager::OdDbLayerStateManager ( OdDbLayerStateManagerImpl )
protected

◆ OdDbLayerStateManager() [2/2]

OdDbLayerStateManager::OdDbLayerStateManager ( )

Default constructor for objects of the OdDbLayerStateManager class.

◆ ~OdDbLayerStateManager()

OdDbLayerStateManager::~OdDbLayerStateManager ( )

Default destructor for objects of the OdDbLayerStateManager class.

Member Function Documentation

◆ addLayerStateLayers()

OdResult OdDbLayerStateManager::addLayerStateLayers ( const OdString sName,
const OdDbObjectIdArray layerIds 
)

◆ addReactor()

bool OdDbLayerStateManager::addReactor ( OdDbLayerStateManagerReactor pReactor)

Adds a state manager reactor to this state manager object.

Parameters
OdDbLayerStateManagerReactor[in] Pointer to the state manager reactor object to be added.
Returns
True if the state manager reactor was added successfully; false means that this reactor has been already added before.

◆ compareLayerStateToDb()

bool OdDbLayerStateManager::compareLayerStateToDb ( const OdString sName,
const OdDbObjectId idVp 
)

◆ deleteLayerState()

OdResult OdDbLayerStateManager::deleteLayerState ( const OdString sName)

Deletes a layer state.

Parameters
sName[in] Name of the layer state to be deleted.
Returns
eOk if operation succeeded; error code otherwise.

◆ exportLayerState()

OdResult OdDbLayerStateManager::exportLayerState ( const OdString sNameToExport,
OdStreamBuf pStreamBuf 
)

◆ getDatabase()

OdDbDatabase * OdDbLayerStateManager::getDatabase ( ) const

◆ getLastRestoredLayerState()

OdResult OdDbLayerStateManager::getLastRestoredLayerState ( OdString sName,
OdDbObjectId restoredLSId 
)

◆ getLayerStateDescription()

OdResult OdDbLayerStateManager::getLayerStateDescription ( const OdString sName,
OdString sDesc 
)

◆ getLayerStateLayers()

OdResult OdDbLayerStateManager::getLayerStateLayers ( OdStringArray layerArray,
const OdString sName,
bool  bInvert = false 
)

◆ getLayerStateMask()

OdResult OdDbLayerStateManager::getLayerStateMask ( const OdString sName,
LayerStateMask returnMask 
)

Retrieves a layer state mask from a specific layer state.

Parameters
sName[in] Name of the layer state to get the mask from.
returnMask[out] Layer state mask.
Remarks
Layer state mask determines which layer attributes are stored in the layer state. Layer state mask is a combination of one or more of the following:

Value kNone 0x0000 kOn 0x0001 kFrozen 0x0002 kLocked 0x0004 kPlot 0x0008 kNewViewport 0x0010 kColor 0x0020 kLineType 0x0040 kLineWeight 0x0080 kPlotStyle 0x0100 kCurrentViewport 0x0200 kTransparency 0x0400 kAll kOn | kFrozen | kLocked | kPlot | kNewViewport | kColor | kLineType | kLineWeight | kPlotStyle | kCurrentViewport | kTransparency kHidden 0x8000

Returns
eOk if operation succeeded; error code otherwise.

◆ getLayerStateNames()

OdResult OdDbLayerStateManager::getLayerStateNames ( OdStringArray lsArray,
bool  bIncludeHidden = true,
bool  bIncludeXref = true 
)

◆ hasLayerState()

bool OdDbLayerStateManager::hasLayerState ( const OdString sName)

Indicates if the layer state with the given name is managed by this layer state manager object.

Parameters
sName[in] Name of the layer state.
Returns
True if the layer state is managed by this layer state manager object; false otherwise.

◆ importLayerState() [1/2]

OdResult OdDbLayerStateManager::importLayerState ( OdStreamBuf pStreamBuf)

Imports a layer state.

Parameters
pStreamBuf[in] Stream buffer to import a layer state from.
Returns
eOk if operation succeeded; error code otherwise.

◆ importLayerState() [2/2]

OdResult OdDbLayerStateManager::importLayerState ( OdStreamBuf pStreamBuf,
OdString sName 
)

Imports a layer state.

Parameters
pStreamBuf[in] Stream buffer to import a layer state from.
sName[out] Name of the imported layer state.
Returns
eOk if operation succeeded; error code otherwise.

◆ importLayerStateFromDb()

OdResult OdDbLayerStateManager::importLayerStateFromDb ( const OdString pStateName,
OdDbDatabase pDb 
)

◆ isDependentLayerState()

bool OdDbLayerStateManager::isDependentLayerState ( const OdString sName)

◆ layerStateHasViewportData()

bool OdDbLayerStateManager::layerStateHasViewportData ( const OdString sName)

◆ layerStatesDictionaryId()

OdDbObjectId OdDbLayerStateManager::layerStatesDictionaryId ( bool  bCreateIfNotPresent = false)

Gets the layer state dictionary ID if present in the current database. The layer state dictionary can be created if it's not present and the bCreateIfNotPresent parameter is set to true.

Parameters
bCreateIfNotPresent[in] Create a layer state dictionary if it's not present in the current database.
Returns
The layer state dictionary ID if it's present in the current database or the bCreateIfNotPresent parameter is set tu true; kNull otherwise.

◆ ODRX_DECLARE_MEMBERS()

OdDbLayerStateManager::ODRX_DECLARE_MEMBERS ( OdDbLayerStateManager  )

◆ removeLayerStateLayers()

OdResult OdDbLayerStateManager::removeLayerStateLayers ( const OdString sName,
const OdStringArray layerNames 
)

◆ removeReactor()

bool OdDbLayerStateManager::removeReactor ( OdDbLayerStateManagerReactor pReactor)

Removes a state manager reactor to this state manager object.

Parameters
OdDbLayerStateManagerReactor[in] Pointer to the state manager reactor object to be removed.
Returns
True if the state manager reactor was removed successfully; false otherwise.

◆ renameLayerState()

OdResult OdDbLayerStateManager::renameLayerState ( const OdString sName,
const OdString sNewName 
)

Renames a layer state.

Parameters
sName[in] Name of the layer state to renamed.
sNewName[in] New name to be assigned to the layer state.
Returns
eOk if operation succeeded; error code otherwise.

◆ restoreLayerState() [1/2]

OdResult OdDbLayerStateManager::restoreLayerState ( const OdString sName)

Restores a layer state from the current database.

Parameters
sName[in] Name of the layer state to be restored.
Returns
eOk if operation succeeded; error code otherwise.

◆ restoreLayerState() [2/2]

OdResult OdDbLayerStateManager::restoreLayerState ( const OdString sName,
const OdDbObjectId idVp,
int  nRestoreFlags = 0,
const LayerStateMask pClientMask = NULL 
)

◆ saveLayerState() [1/2]

OdResult OdDbLayerStateManager::saveLayerState ( const OdString sName,
LayerStateMask  mask 
)

Saves a layer state to the current database.

Parameters
sName[in] Name of the layer state to be saved.
mask[in] Layer state mask.
Remarks
Layer state mask determines which layer attributes are to be stored in the layer state. Layer state mask must be a combination of one or more of the following:

Value kNone 0x0000 kOn 0x0001 kFrozen 0x0002 kLocked 0x0004 kPlot 0x0008 kNewViewport 0x0010 kColor 0x0020 kLineType 0x0040 kLineWeight 0x0080 kPlotStyle 0x0100 kCurrentViewport 0x0200 kTransparency 0x0400 kAll kOn | kFrozen | kLocked | kPlot | kNewViewport | kColor | kLineType | kLineWeight | kPlotStyle | kCurrentViewport | kTransparency kHidden 0x8000

Returns
eOk if operation succeeded; error code otherwise.

◆ saveLayerState() [2/2]

OdResult OdDbLayerStateManager::saveLayerState ( const OdString sName,
LayerStateMask  mask,
const OdDbObjectId idVp 
)

◆ setLayerStateDescription()

OdResult OdDbLayerStateManager::setLayerStateDescription ( const OdString sName,
const OdString sDesc 
)

◆ setLayerStateMask()

OdResult OdDbLayerStateManager::setLayerStateMask ( const OdString sName,
LayerStateMask  mask 
)

Sets the layer state mask for a specific layer state.

Parameters
sName[in] Name of the layer state to set the mask for.
mask[in] Layer state mask.
Remarks
Layer state mask determines which layer attributes are to be stored in the layer state. Layer state mask must be a combination of one or more of the following:

Value kNone 0x0000 kOn 0x0001 kFrozen 0x0002 kLocked 0x0004 kPlot 0x0008 kNewViewport 0x0010 kColor 0x0020 kLineType 0x0040 kLineWeight 0x0080 kPlotStyle 0x0100 kCurrentViewport 0x0200 kTransparency 0x0400 kAll kOn | kFrozen | kLocked | kPlot | kNewViewport | kColor | kLineType | kLineWeight | kPlotStyle | kCurrentViewport | kTransparency kHidden 0x8000

Returns
eOk if operation succeeded; error code otherwise.

Friends And Related Function Documentation

◆ OdDbDatabase

friend class OdDbDatabase
friend

Definition at line 308 of file DbLayerState.h.

◆ OdDbLayerStateManagerImpl

friend class OdDbLayerStateManagerImpl
friend

Definition at line 307 of file DbLayerState.h.

Member Data Documentation

◆ m_pImpl

OdDbLayerStateManagerImpl* OdDbLayerStateManager::m_pImpl
protected

Definition at line 306 of file DbLayerState.h.


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