24 #ifndef DBLAYERSTATEMANAGER_H
25 #define DBLAYERSTATEMANAGER_H
41 kDefMask = (long)0xFFFFFFFF,
47 kNewViewport = 0x0010,
52 kCurrentViewport = 0x0200,
55 kAll = kOn | kFrozen | kLocked | kPlot | kNewViewport |
56 kColor | kLineType | kLineWeight | kPlotStyle |
61 kLastRestored = 0x10000
67 kUndefDoNothing = 0x00,
70 kRestoreAsOverrides = 0x04
341 int includedLayersState = kOn,
int otherLayersState =
kNone);
345 class OdDbLayerStateManagerImpl;
366 kNewViewport = 0x0010,
369 kLineWeight = 0x0080,
371 kCurrentViewport = 0x0200,
373 kAll = kOn | kFrozen | kLocked | kPlot | kNewViewport |
374 kColor | kLineType | kLineWeight | kPlotStyle |
376 kStateIsHidden = 0x8000,
377 kLastRestored = 0x10000,
378 kDecomposition =
kAll | 0x20000
385 kRestoreAsOverrides = 4
418 friend class OdDbLayerStateManagerImpl;
TOOLKIT_EXPORT OdDbLayerStateProperties * fxGetLayerStateProperties(OdDbDatabase *pDb, const OdString &layerState)
OdSmartPtr< OdDbLayerStateManagerReactor > OdDbLayerStateManagerReactorPtr
static OdString description(OdDbDatabase *pDb, const OdString &layerStateName)
static ImportResult importData(OdDbDatabase *pDb, OdStreamBuf *pStreamBuf, OdString *pName=0)
static void remove(OdDbDatabase *pDb, const OdString &layerStateName)
static OdResult saveGroup(OdDbDatabase *pDb, const OdString &sName, const OdDbObjectIdArray &pLayers, int mask=kOn, int includedLayersState=kOn, int otherLayersState=kNone)
static OdResult addLayerStateLayers(const OdString &sName, OdDbObjectIdArray layerIds)
static OdResult removeLayerStateLayers(OdDbDatabase *pDb, const OdString sName, const OdStringArray &layerNames)
static bool hasViewportData(OdDbDatabase *pDb, const OdString &layerStateName)
static void exportData(OdDbDatabase *pDb, const OdString &layerStateName, OdStreamBuf *pStreamBuf)
static OdDbObjectId dictionaryId(OdDbDatabase *pDb, bool createIfNotFound=false)
static void setMask(OdDbDatabase *pDb, const OdString &layerStateName, int layerStateMask)
static int mask(OdDbDatabase *pDb, const OdString &layerStateName)
static bool has(OdDbDatabase *pDb, const OdString &layerStateName)
static void restore(OdDbDatabase *pDb, const OdString &layerStateName, int flags=kUndefDoNothing, const int layerStateMask=kDefMask, const OdDbObjectId &viewportId=OdDbObjectId::kNull)
static void setDescription(OdDbDatabase *pDb, const OdString &layerStateName, const OdString &description)
static void rename(OdDbDatabase *pDb, const OdString &oldName, const OdString &newName)
static void save(OdDbDatabase *pDb, const OdString &layerStateName, int layerStateMask, const OdDbObjectId &viewportId=OdDbObjectId::kNull)
OdResult renameLayerState(const OdString &sName, const OdString &sNewName)
OdResult getLayerStateDescription(const OdString &sName, OdString &sDesc)
OdResult getLastRestoredLayerState(OdString &sName, OdDbObjectId &restoredLSId)
OdResult setLayerStateDescription(const OdString &sName, const OdString &sDesc)
OdResult saveLayerState(const OdString &sName, LayerStateMask mask)
bool compareLayerStateToDb(const OdString &sName, const OdDbObjectId &idVp)
bool addReactor(OdDbLayerStateManagerReactor *pReactor)
OdResult getLayerStateMask(const OdString &sName, LayerStateMask &returnMask)
OdResult restoreLayerState(const OdString &sName, const OdDbObjectId &idVp, int nRestoreFlags=0, const LayerStateMask *pClientMask=NULL)
OdResult importLayerStateFromDb(const OdString &pStateName, OdDbDatabase *pDb)
OdResult setLayerStateMask(const OdString &sName, LayerStateMask mask)
bool layerStateHasViewportData(const OdString &sName)
OdResult importLayerState(OdStreamBuf *pStreamBuf, OdString &sName)
OdResult removeLayerStateLayers(const OdString &sName, const OdStringArray &layerNames)
OdResult restoreLayerState(const OdString &sName)
OdResult exportLayerState(const OdString &sNameToExport, OdStreamBuf *pStreamBuf)
OdResult saveLayerState(const OdString &sName, LayerStateMask mask, const OdDbObjectId &idVp)
OdResult getLayerStateLayers(OdStringArray &layerArray, const OdString &sName, bool bInvert=false)
OdDbLayerStateManagerImpl * m_pImpl
OdResult addLayerStateLayers(const OdString &sName, const OdDbObjectIdArray &layerIds)
OdDbDatabase * getDatabase() const
OdResult getLayerStateNames(OdStringArray &lsArray, bool bIncludeHidden=true, bool bIncludeXref=true)
bool isDependentLayerState(const OdString &sName)
bool hasLayerState(const OdString &sName)
OdResult importLayerState(OdStreamBuf *pStreamBuf)
OdResult deleteLayerState(const OdString &sName)
OdDbLayerStateManager(OdDbLayerStateManagerImpl *)
OdDbObjectId layerStatesDictionaryId(bool bCreateIfNotPresent=false)
ODRX_DECLARE_MEMBERS(OdDbLayerStateManager)
bool removeReactor(OdDbLayerStateManagerReactor *pReactor)
virtual void layerStateCompareFailed(const OdString &layerStateName, const OdDbObjectId &layerStateId)
virtual void abortLayerStateDelete(const OdString &layerStateName, const OdDbObjectId &layerStateId)
virtual void layerStateDeleted(const OdString &layerStateName)
virtual void layerStateRestored(const OdString &layerStateName, const OdDbObjectId &layerStateId)
virtual void layerStateToBeRenamed(const OdString &oldLayerStateName, const OdString &newLayerStateName)
virtual void layerStateToBeRestored(const OdString &layerStateName, const OdDbObjectId &layerStateId)
virtual void layerStateRenamed(const OdString &oldLayerStateName, const OdString &newLayerStateName)
virtual void layerStateToBeDeleted(const OdString &layerStateName, const OdDbObjectId &layerStateId)
virtual void abortLayerStateRename(const OdString &oldLayerStateName, const OdString &newLayerStateName)
virtual void abortLayerStateRestore(const OdString &layerStateName, const OdDbObjectId &layerStateId)
ODRX_DECLARE_MEMBERS(OdDbLayerStateManagerReactor)
virtual void layerStateCreated(const OdString &layerStateName, const OdDbObjectId &layerStateId)
virtual OdDbObjectId getLineType(const OdString &layerName) const =0
virtual OdResult setOn(const OdString &layerName, const bool &bOn)=0
virtual OdResult setNewVPFreeze(const OdString &layerName, const bool &bNewVPFreeze)=0
virtual OdResult setFreeze(const OdString &layerName, const bool &bFreeze, OdDbObjectId id=NULL)=0
virtual OdDbDatabase * database() const =0
virtual OdResult setLineColor(const OdString &layerName, const OdCmColor &color)=0
virtual bool isNewVPFreeze(const OdString &layerName) const =0
virtual OdCmTransparency getTransparency(const OdString &layerName) const =0
virtual OdString getActiveLayer() const =0
virtual bool isLocked(const OdString &layerName) const =0
virtual OdResult setLineWeight(const OdString &layerName, const OdDb::LineWeight &lweight)=0
virtual bool isFreezed(const OdString &layerName, OdDbObjectId id=NULL) const =0
virtual OdResult setLineType(const OdString &layerName, const OdDbObjectId <ype)=0
virtual OdResult setPlotStyle(const OdString &layerName, const OdString &plotStyle)=0
virtual OdString getPlotStyle(const OdString &layerName) const =0
virtual OdResult setLocked(const OdString &layerName, const bool &bLock)=0
virtual bool isPlotable(const OdString &layerName) const =0
virtual ~OdDbLayerStateProperties()
virtual OdResult setPlotable(const OdString &layerName, const bool &bPlot)=0
virtual OdString getLayerStateName() const =0
virtual OdDb::LineWeight getLineWeight(const OdString &layerName) const =0
virtual OdResult setTransparency(const OdString &layerName, const OdCmTransparency &transparency)=0
OdDbLayerStateProperties()
virtual OdResult setActiveLayer(const OdString &layerStateName)=0
virtual bool isOn(const OdString &layerName) const =0
virtual OdCmColor getLineColor(const OdString &layerName) const =0
bool hasLegacyLayerStates()
OdDbLegacyLayerStateImporter(OdDbDatabasePtr pDb)
OdResult importLegacyLayerStates()
virtual ~OdDbLegacyLayerStateImporter()
static TOOLKIT_EXPORT_STATIC const OdDbObjectId kNull
@ kNone
Light mode is inherited from the annotation.