#include <DbLayerState.h>
|
| enum | Mask {
kDefMask = (long)0xFFFFFFFF
, 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
, kHidden = 0x8000
, kLastRestored = 0x10000
} |
| |
| enum | { kUndefDoNothing = 0x00
, kUndefTurnOff = 0x01
, kUndefFreeze = 0x02
, kRestoreAsOverrides = 0x04
} |
| |
| enum | ImportResult { kImported
, kAlreadyExists
} |
| |
|
| static OdDbObjectId | dictionaryId (OdDbDatabase *pDb, bool createIfNotFound=false) |
| |
| static bool | has (OdDbDatabase *pDb, const OdString &layerStateName) |
| |
| static void | save (OdDbDatabase *pDb, const OdString &layerStateName, int layerStateMask, const OdDbObjectId &viewportId=OdDbObjectId::kNull) |
| |
| static void | restore (OdDbDatabase *pDb, const OdString &layerStateName, int flags=kUndefDoNothing, const int layerStateMask=kDefMask, const OdDbObjectId &viewportId=OdDbObjectId::kNull) |
| |
| static void | setMask (OdDbDatabase *pDb, const OdString &layerStateName, int layerStateMask) |
| |
| static int | mask (OdDbDatabase *pDb, const OdString &layerStateName) |
| |
| static void | remove (OdDbDatabase *pDb, const OdString &layerStateName) |
| |
| static void | rename (OdDbDatabase *pDb, const OdString &oldName, const OdString &newName) |
| |
| static ImportResult | importData (OdDbDatabase *pDb, OdStreamBuf *pStreamBuf, OdString *pName=0) |
| |
| static void | exportData (OdDbDatabase *pDb, const OdString &layerStateName, OdStreamBuf *pStreamBuf) |
| |
| static void | setDescription (OdDbDatabase *pDb, const OdString &layerStateName, const OdString &description) |
| |
| static OdString | description (OdDbDatabase *pDb, const OdString &layerStateName) |
| |
| static bool | hasViewportData (OdDbDatabase *pDb, const OdString &layerStateName) |
| |
| static OdResult | addLayerStateLayers (const OdString &sName, OdDbObjectIdArray layerIds) |
| |
| static OdResult | removeLayerStateLayers (OdDbDatabase *pDb, const OdString sName, const OdStringArray &layerNames) |
| |
| static OdResult | saveGroup (OdDbDatabase *pDb, const OdString &sName, const OdDbObjectIdArray &pLayers, int mask=kOn, int includedLayersState=kOn, int otherLayersState=kNone) |
| |
This class implements an interface for manipulating LayerStates in multiple OdDbDatabase instances.
Library: TD_Db <group OdDb_Classes>
Definition at line 36 of file DbLayerState.h.
◆ anonymous enum
| Enumerator |
|---|
| kUndefDoNothing | |
| kUndefTurnOff | |
| kUndefFreeze | |
| kRestoreAsOverrides | |
Definition at line 65 of file DbLayerState.h.
◆ ImportResult
◆ Mask
| Enumerator |
|---|
| kDefMask | |
| kNone | |
| kOn | |
| kFrozen | |
| kLocked | |
| kPlot | |
| kNewViewport | |
| kColor | |
| kLineType | |
| kLineWeight | |
| kPlotStyle | |
| kCurrentViewport | |
| kTransparency | |
| kAll | |
| kHidden | |
| kLastRestored | |
Definition at line 39 of file DbLayerState.h.
◆ addLayerStateLayers()
Adds more layers to a layer state.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
| layerIds | [in] Array of object Ids of layers to be added to the layer state |
◆ description()
Returns the description of the specified LayerState in the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
◆ dictionaryId()
Returns the Object ID of the LayerStates dictionary for the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| createIfNotFound | [in] Controls the creation of the dictionary if it does not exist. |
◆ exportData()
Exports the LayerState from the specified database to the specified file.
- Parameters
-
| pDb | [in] Pointer to the database. |
| pStreamBuf | [in] Pointer to the StreamBuf object to which the data are to be written. |
| layerStateName | [in] LayerState name. |
◆ has()
Returns true if and only if the specified database has a LayerState with the specified name.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
◆ hasViewportData()
Returns true if and only if there is viewport data associated with specified LayerState in the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
◆ importData()
Imports the LayerState from the specified file to the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| pStreamBuf | [in] Pointer to the StreamBuf object from which the data are to be read.
|
| pName | [out] Optional pointer to the string where imported layer state name will be stored. |
Returns one of the following:
Value
kImported 0
kAlreadyExists 1
◆ mask()
Returns the LayerState mask for the specified LayerState in the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
mask() returns 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
◆ remove()
Removes the specified LayerState from the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
◆ removeLayerStateLayers()
Removes layers from a layer state.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
| layerNames | [in] Array of names of layers to be removed from the layer state. |
◆ rename()
Renames the specified LayerState in the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| oldName | [in] Old name. |
| newName | [in] New name. |
◆ restore()
Restores the specified LayerState of the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
| layerStateMask | [in] LayerState mask. |
| viewportId | [in] Viewport whose LayerState is to be saved. |
| undefAction | [in] Action for undefined layers. |
Value
kUndefDoNothing 0
kUndefTurnOff 1
kUndefFreeze 2
layerStateMask determines which layer attributes are to be restored from the LayerState.
layerStateMask must be a combination of one or more of the following:
Value
kDefMask 0xFFFFFFFF
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
◆ save()
Saves the current LayerState of the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
| layerStateMask | [in] LayerState mask. |
| viewportId | [in] Viewport whose LayerState is to be saved. |
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
◆ saveGroup()
Creates a layer state where specified layers are assigned one state (e.g. ON), and all the others are assigned other state (e.g. OFF).
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
| layerIds | [in] Array of object Ids of layers to be added to the layer state |
| mask | [in] created |
◆ setDescription()
Sets the description of the specified LayerState in the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
| description | [in] Description. |
◆ setMask()
Sets the LayerState mask for the specified LayerState in the specified database.
- Parameters
-
| pDb | [in] Pointer to the database. |
| layerStateName | [in] LayerState name. |
| layerStateMask | [in] LayerState mask. |
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
The documentation for this class was generated from the following file: