Skip to content

RLinkedStorage

Class in Core Module
Header: #include <src/core/RLinkedStorage.h>
Inherits: RMemoryStorage

Memory based storage that is linked to another storage.

The other storage is read only and only used to read objects that are not available in this storage. All added objects are stored in this storage directly.

Scriptable: This class is available in script environments.

RLinkedStorage(RStorage &backStorage)
virtual ~RLinkedStorage()
virtual void clear()
Resets this storage to its initial, empty state.
virtual void clearLinked()
Clears only contents of this linkes storage, essentailly resetting the linked storage to the back storage.
virtual bool deleteObject(RObject::Id objectId)
Deletes the object with the given ID.
RStorage * getBackStorage() const
virtual RObject::Id getBlockId(const QString &blockName) const
virtual RObject::Id getBlockIdAuto(const QString &blockLayoutName) const
virtual QString getBlockName(RObject::Id blockId) const
virtual QString getBlockNameFromHandle(RObject::Handle blockHandle) const
virtual QString getBlockNameFromLayout(const QString &layoutName) const
virtual QString getBlockNameFromLayout(RObject::Id layoutId) const
virtual QSet< QString > getBlockNames(const QString &rxStr=RDEFAULT_QSTRING, bool undone=false) const
virtual RObject::Id getCurrentBlockId() const
virtual RColor getCurrentColor() const
virtual RObject::Id getCurrentLayerId() const
virtual RObject::Id getCurrentLinetypeId() const
virtual RLineweight::Lineweight getCurrentLineweight() const
virtual RObject::Id getCurrentViewId() const
virtual QString getDimensionFont() const
virtual QVariant getKnownVariable(RS::KnownVariable key) const
virtual RObject::Id getLayerId(const QString &layerName) const
virtual QString getLayerName(RObject::Id layerId) const
virtual QSet< QString > getLayerNames(const QString &rxStr=RDEFAULT_QSTRING) const
virtual RObject::Id getLayoutId(const QString &layoutName) const
virtual QString getLayoutName(RObject::Id layoutId) const
virtual QSet< QString > getLayoutNames(const QString &rxStr=RDEFAULT_QSTRING) const
virtual QString getLinetypeDescription(RObject::Id linetypeId) const
virtual RObject::Id getLinetypeId(const QString &linetypeName) const
virtual QString getLinetypeLabel(RObject::Id linetypeId) const
virtual QString getLinetypeName(RObject::Id linetypeId) const
virtual QSet< QString > getLinetypeNames() const
virtual QList< RLinetypePattern > getLinetypePatterns() const
bool getLinkedEntityQueriesEnabled() const
virtual RObject::Handle getNewObjectHandle()
virtual RObject::Id getNewObjectId()
IDs are handled by the back storage exclusively.
virtual RObject::Id getViewId(const QString &viewName) const
virtual QString getViewName(RObject::Id viewId) const
virtual QSet< QString > getViewNames() const
virtual bool hasBlockEntities(RObject::Id blockId) const
virtual bool hasChildEntities(RObject::Id parentId) const
virtual bool isInBackStorage(RObject::Id object)
Linked storages should return true if the given object is stored in the storage the linked storage links to.
virtual QSet< RObject::Id > queryAllBlockReferences() const
virtual QSet< RObject::Id > queryAllBlocks(bool undone=false)
virtual QSet< RObject::Id > queryAllEntities(bool undone, bool allBlocks, QList< RS::EntityType > types)
virtual QSet< RObject::Id > queryAllEntities(bool undone=false, bool allBlocks=false, RS::EntityType type=RS::EntityAll)
virtual QSet< RObject::Id > queryAllLayers(bool undone=false)
virtual QSet< RObject::Id > queryAllLayerStates(bool undone=false)
virtual QSet< RObject::Id > queryAllLayoutBlocks(bool includeModelSpace=false, bool undone=false) const
virtual QSet< RObject::Id > queryAllLayouts(bool undone=false)
virtual QSet< RObject::Id > queryAllLinetypes()
virtual QSet< RObject::Id > queryAllObjects() const
virtual QSet< RObject::Id > queryAllUcs()
virtual QSet< RObject::Id > queryAllViewports() const
virtual QSet< RObject::Id > queryAllViews(bool undone=false)
virtual QSet< RObject::Id > queryAllVisibleEntities()
virtual QSharedPointer< RBlock > queryBlock(const QString &blockName) const
virtual QSharedPointer< RBlock > queryBlock(RObject::Id blockId) const
virtual QSharedPointer< RBlock > queryBlockDirect(RObject::Id blockId) const
virtual QSet< RObject::Id > queryBlockEntities(RObject::Id blockId)
virtual QSet< RObject::Id > queryBlockReferences(RObject::Id blockId) const
virtual QSet< RObject::Id > queryChildEntities(RObject::Id parentId, RS::EntityType type=RS::EntityAll)
virtual QSharedPointer< RDimStyle > queryDimStyle() const
virtual QSharedPointer< RDimStyle > queryDimStyleDirect() const
virtual QSharedPointer< RDocumentVariables > queryDocumentVariables() const
virtual QSharedPointer< RDocumentVariables > queryDocumentVariablesDirect() const
virtual QSharedPointer< REntity > queryEntity(RObject::Id objectId) const
virtual QSharedPointer< REntity > queryEntityDirect(RObject::Id objectId) const
virtual QSet< RObject::Id > queryInfiniteEntities() const
virtual QSharedPointer< RLayer > queryLayer(const QString &layerName) const
virtual QSharedPointer< RLayer > queryLayer(RObject::Id layerId) const
virtual QSet< RObject::Id > queryLayerBlockEntities(RObject::Id layerId, RObject::Id blockId)
virtual QSharedPointer< RLayer > queryLayerDirect(RObject::Id layerId) const
virtual QSet< RObject::Id > queryLayerEntities(RObject::Id layerId, bool allBlocks=false)
virtual QSharedPointer< RLayerState > queryLayerState(const QString &layerStateName) const
virtual QSharedPointer< RLayerState > queryLayerState(RObject::Id layerStateId) const
virtual QSharedPointer< RLayerState > queryLayerStateDirect(RObject::Id layerStateId) const
virtual QSharedPointer< RLayout > queryLayout(const QString &layoutName) const
virtual QSharedPointer< RLayout > queryLayout(RObject::Id layoutId) const
virtual QSharedPointer< RLayout > queryLayoutDirect(RObject::Id layoutId) const
virtual QSharedPointer< RLinetype > queryLinetype(const QString &linetypeName) const
virtual QSharedPointer< RLinetype > queryLinetype(RObject::Id linetypeId) const
virtual QSharedPointer< RLinetype > queryLinetypeDirect(RObject::Id linetypeId) const
virtual QSharedPointer< RObject > queryObject(RObject::Id objectId) const
virtual QSharedPointer< RObject > queryObjectByHandle(RObject::Handle objectHandle) const
virtual RObject * queryObjectCC(RObject::Id objectId) const
virtual QSharedPointer< RObject > queryObjectDirect(RObject::Id objectId) const
virtual QSet< RObject::Id > querySelectedEntities() const
virtual QSet< RObject::Id > querySelectedLayerEntities(RObject::Id layerId, bool allBlocks=false)
virtual QSet< RObject::Id > querySelectedLayers() const
virtual QSharedPointer< RUcs > queryUcs(const QString &ucsName) const
virtual QSharedPointer< RUcs > queryUcs(RObject::Id ucsId) const
virtual QSharedPointer< RUcs > queryUcsDirect(RObject::Id ucsId) const
virtual QSharedPointer< RView > queryView(const QString &viewName) const
virtual QSharedPointer< RView > queryView(RObject::Id viewId) const
void setLinkedEntityQueriesEnabled(bool on)
virtual bool setUndoStatus(RObject::Id objectId, bool status)
RStorage * backStorage
bool linkedEntityQueriesEnabled
int objectIdOffset

RLinkedStorage::RLinkedStorage(RStorage &backStorage)

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.

virtual RLinkedStorage::~RLinkedStorage()

virtual

virtual void RLinkedStorage::clear()

virtual

Resets this storage to its initial, empty state.

Reimplemented from clear.

virtual void RLinkedStorage::clearLinked()

virtual

Clears only contents of this linkes storage, essentailly resetting the linked storage to the back storage.

virtual bool RLinkedStorage::deleteObject(RObject::Id objectId)

virtual

Deletes the object with the given ID.

Reimplemented from deleteObject.

RStorage * RLinkedStorage::getBackStorage() const

inline const

virtual RBlock::Id RLinkedStorage::getBlockId(const QString &blockName) const

virtual const

Reimplemented from getBlockId.

virtual RBlock::Id RLinkedStorage::getBlockIdAuto(const QString &blockLayoutName) const

virtual const

Reimplemented from getBlockIdAuto.

virtual QString RLinkedStorage::getBlockName(RObject::Id blockId) const

virtual const

Reimplemented from getBlockName.

virtual QString RLinkedStorage::getBlockNameFromHandle(RObject::Handle blockHandle) const

virtual const

Reimplemented from getBlockNameFromHandle.

virtual QString RLinkedStorage::getBlockNameFromLayout(const QString &layoutName) const

virtual const

Reimplemented from getBlockNameFromLayout.

virtual QString RLinkedStorage::getBlockNameFromLayout(RObject::Id layoutId) const

virtual const

Reimplemented from getBlockNameFromLayout.

virtual QSet< QString > RLinkedStorage::getBlockNames(const QString &rxStr=RDEFAULT_QSTRING, bool undone=false) const

virtual const

Reimplemented from getBlockNames.

virtual RBlock::Id RLinkedStorage::getCurrentBlockId() const

virtual const

Reimplemented from getCurrentBlockId.

virtual RColor RLinkedStorage::getCurrentColor() const

virtual const

Reimplemented from getCurrentColor.

virtual RObject::Id RLinkedStorage::getCurrentLayerId() const

virtual const

Reimplemented from getCurrentLayerId.

virtual RLinetype::Id RLinkedStorage::getCurrentLinetypeId() const

virtual const

Reimplemented from getCurrentLinetypeId.

virtual RLineweight::Lineweight RLinkedStorage::getCurrentLineweight() const

virtual const

Reimplemented from getCurrentLineweight.

virtual RObject::Id RLinkedStorage::getCurrentViewId() const

virtual const

Reimplemented from getCurrentViewId.

virtual QString RLinkedStorage::getDimensionFont() const

virtual const

Reimplemented from getDimensionFont.

virtual QVariant RLinkedStorage::getKnownVariable(RS::KnownVariable key) const

virtual const

Returns: Value for the given DXF/DWG variable.

Reimplemented from getKnownVariable.

virtual RObject::Id RLinkedStorage::getLayerId(const QString &layerName) const

virtual const

Reimplemented from getLayerId.

virtual QString RLinkedStorage::getLayerName(RObject::Id layerId) const

virtual const

Reimplemented from getLayerName.

virtual QSet< QString > RLinkedStorage::getLayerNames(const QString &rxStr=RDEFAULT_QSTRING) const

virtual const

Reimplemented from getLayerNames.

virtual RObject::Id RLinkedStorage::getLayoutId(const QString &layoutName) const

virtual const

Reimplemented from getLayoutId.

virtual QString RLinkedStorage::getLayoutName(RObject::Id layoutId) const

virtual const

Reimplemented from getLayoutName.

virtual QSet< QString > RLinkedStorage::getLayoutNames(const QString &rxStr=RDEFAULT_QSTRING) const

virtual const

Reimplemented from getLayoutNames.

virtual QString RLinkedStorage::getLinetypeDescription(RObject::Id linetypeId) const

virtual const

Returns: User readable description for the given linetype.

Reimplemented from getLinetypeDescription.

virtual RLinetype::Id RLinkedStorage::getLinetypeId(const QString &linetypeName) const

virtual const

Returns: Linetype ID of the given linetype name or RObject::INVALID_ID.

Reimplemented from getLinetypeId.

virtual QString RLinkedStorage::getLinetypeLabel(RObject::Id linetypeId) const

virtual const

Returns: User readable label for the given linetype.

Reimplemented from getLinetypeLabel.

virtual QString RLinkedStorage::getLinetypeName(RObject::Id linetypeId) const

virtual const

Returns: Linetype name of the given linetype.

Reimplemented from getLinetypeName.

virtual QSet< QString > RLinkedStorage::getLinetypeNames() const

virtual const

Returns: List of all available linetype pattern names in this document.

Reimplemented from getLinetypeNames.

virtual QList< RLinetypePattern > RLinkedStorage::getLinetypePatterns() const

virtual const

Returns: List of all available linetype patterns in this document.

Reimplemented from getLinetypePatterns.

bool RLinkedStorage::getLinkedEntityQueriesEnabled() const

inline const

virtual RObject::Handle RLinkedStorage::getNewObjectHandle()

virtual

Reimplemented from getNewObjectHandle.

virtual RObject::Id RLinkedStorage::getNewObjectId()

virtual

IDs are handled by the back storage exclusively.

Reimplemented from getNewObjectId.

virtual RObject::Id RLinkedStorage::getViewId(const QString &viewName) const

virtual const

Reimplemented from getViewId.

virtual QString RLinkedStorage::getViewName(RObject::Id viewId) const

virtual const

Reimplemented from getViewName.

virtual QSet< QString > RLinkedStorage::getViewNames() const

virtual const

Reimplemented from getViewNames.

virtual bool RLinkedStorage::hasBlockEntities(RObject::Id blockId) const

virtual const

Returns: True if the given block contains any entities.

Reimplemented from hasBlockEntities.

virtual bool RLinkedStorage::hasChildEntities(RObject::Id parentId) const

virtual const

Reimplemented from hasChildEntities.

virtual bool RLinkedStorage::isInBackStorage(RObject::Id object)

virtual

Linked storages should return true if the given object is stored in the storage the linked storage links to.

Reimplemented from isInBackStorage.

virtual QSet< RObject::Id > RLinkedStorage::queryAllBlockReferences() const

virtual const

Returns: A set of all block reference entity IDs.

Reimplemented from queryAllBlockReferences.

virtual QSet< RBlock::Id > RLinkedStorage::queryAllBlocks(bool undone=false)

virtual

Returns: A set of all block IDs of the document.

Reimplemented from queryAllBlocks.

virtual QSet< RObject::Id > RLinkedStorage::queryAllEntities(bool undone, bool allBlocks, QList< RS::EntityType > types)

virtual

Reimplemented from queryAllEntities.

virtual QSet< RObject::Id > RLinkedStorage::queryAllEntities(bool undone=false, bool allBlocks=false, RS::EntityType type=RS::EntityAll)

virtual

Returns: A set of all entity IDs of the document.

Reimplemented from queryAllEntities.

virtual QSet< RObject::Id > RLinkedStorage::queryAllLayers(bool undone=false)

virtual

Returns: A set of all layer IDs of the document.

Reimplemented from queryAllLayers.

virtual QSet< RObject::Id > RLinkedStorage::queryAllLayerStates(bool undone=false)

virtual

virtual QSet< RBlock::Id > RLinkedStorage::queryAllLayoutBlocks(bool includeModelSpace=false, bool undone=false) const

virtual const

Returns: A set of all block IDs of layout blocks of the document.

Reimplemented from queryAllLayoutBlocks.

virtual QSet< RObject::Id > RLinkedStorage::queryAllLayouts(bool undone=false)

virtual

Returns: A set of all layout IDs of layouts of the document.

Reimplemented from queryAllLayouts.

virtual QSet< RLinetype::Id > RLinkedStorage::queryAllLinetypes()

virtual

Returns: A set of all linetype IDs of the document.

Reimplemented from queryAllLinetypes.

virtual QSet< RObject::Id > RLinkedStorage::queryAllObjects() const

virtual const

Returns: A set of all object IDs of the document.

Reimplemented from queryAllObjects.

virtual QSet< RUcs::Id > RLinkedStorage::queryAllUcs()

virtual

Returns: A set of all UCS IDs of the document.

Reimplemented from queryAllUcs.

virtual QSet< RObject::Id > RLinkedStorage::queryAllViewports() const

virtual const

Returns: A set of all viewport entity IDs.

Reimplemented from queryAllViewports.

virtual QSet< RObject::Id > RLinkedStorage::queryAllViews(bool undone=false)

virtual

Returns: A set of all view IDs of the document.

Reimplemented from queryAllViews.

virtual QSet< RObject::Id > RLinkedStorage::queryAllVisibleEntities()

virtual

Returns: IDs of all visible entities (current block only, no frozen or off layers, no frozen blocks, no undone entities).

Reimplemented from queryAllVisibleEntities.

virtual QSharedPointer< RBlock > RLinkedStorage::queryBlock(const QString &blockName) const

virtual const

Reimplemented from queryBlock.

virtual QSharedPointer< RBlock > RLinkedStorage::queryBlock(RObject::Id blockId) const

virtual const

Reimplemented from queryBlock.

virtual QSharedPointer< RBlock > RLinkedStorage::queryBlockDirect(RObject::Id blockId) const

virtual const

Reimplemented from queryBlockDirect.

virtual QSet< RObject::Id > RLinkedStorage::queryBlockEntities(RObject::Id blockId)

virtual

Returns: A set of all entity IDs that are part of the given block.

Reimplemented from queryBlockEntities.

virtual QSet< RObject::Id > RLinkedStorage::queryBlockReferences(RObject::Id blockId) const

virtual const

Returns: A set of all block reference entity IDs that reference the given block.

Reimplemented from queryBlockReferences.

virtual QSet< RObject::Id > RLinkedStorage::queryChildEntities(RObject::Id parentId, RS::EntityType type=RS::EntityAll)

virtual

Returns: A set of all block attributes which are not stored in the block definition but as separate entities on the same level as the block reference.

Reimplemented from queryChildEntities.

virtual QSharedPointer< RDimStyle > RLinkedStorage::queryDimStyle() const

virtual const

Reimplemented from queryDimStyle.

virtual QSharedPointer< RDimStyle > RLinkedStorage::queryDimStyleDirect() const

virtual const

Reimplemented from queryDimStyleDirect.

virtual QSharedPointer< RDocumentVariables > RLinkedStorage::queryDocumentVariables() const

virtual const

Reimplemented from queryDocumentVariables.

virtual QSharedPointer< RDocumentVariables > RLinkedStorage::queryDocumentVariablesDirect() const

virtual const

Reimplemented from queryDocumentVariablesDirect.

virtual QSharedPointer< REntity > RLinkedStorage::queryEntity(RObject::Id objectId) const

virtual const

Returns: A pointer to the entity with the given entityId or NULL if no such entity exists.

Reimplemented from queryEntity.

virtual QSharedPointer< REntity > RLinkedStorage::queryEntityDirect(RObject::Id objectId) const

virtual const

Reimplemented from queryEntityDirect.

virtual QSet< RObject::Id > RLinkedStorage::queryInfiniteEntities() const

virtual const

Returns: A set of entity IDs of all infinite entities (xlines).

Reimplemented from queryInfiniteEntities.

virtual QSharedPointer< RLayer > RLinkedStorage::queryLayer(const QString &layerName) const

virtual const

Returns: A pointer to the layer with the given layerName or NULL if no such layer exists.

Reimplemented from queryLayer.

virtual QSharedPointer< RLayer > RLinkedStorage::queryLayer(RObject::Id layerId) const

virtual const

Returns: A pointer to the layer with the given layerId or NULL if no such layer exists.

Reimplemented from queryLayer.

virtual QSet< RObject::Id > RLinkedStorage::queryLayerBlockEntities(RObject::Id layerId, RObject::Id blockId)

virtual

Reimplemented from queryLayerBlockEntities.

virtual QSharedPointer< RLayer > RLinkedStorage::queryLayerDirect(RObject::Id layerId) const

virtual const

Reimplemented from queryLayerDirect.

virtual QSet< RObject::Id > RLinkedStorage::queryLayerEntities(RObject::Id layerId, bool allBlocks=false)

virtual

Returns: A set of all entity IDs on the given layer.

Reimplemented from queryLayerEntities.

virtual QSharedPointer< RLayerState > RLinkedStorage::queryLayerState(const QString &layerStateName) const

virtual const

Returns: A pointer to the layer with the given layerName or NULL if no such layer exists.

Reimplemented from queryLayerState.

virtual QSharedPointer< RLayerState > RLinkedStorage::queryLayerState(RObject::Id layerStateId) const

virtual const

Returns: A pointer to the layer state with the given layerStateId or NULL if no such layer state exists.

Reimplemented from queryLayerState.

virtual QSharedPointer< RLayerState > RLinkedStorage::queryLayerStateDirect(RObject::Id layerStateId) const

virtual const

Reimplemented from queryLayerStateDirect.

virtual QSharedPointer< RLayout > RLinkedStorage::queryLayout(const QString &layoutName) const

virtual const

Returns: A pointer to the layout with the given layoutName or NULL if no such layout exists.

Reimplemented from queryLayout.

virtual QSharedPointer< RLayout > RLinkedStorage::queryLayout(RObject::Id layoutId) const

virtual const

Returns: A pointer to the layout with the given layoutId or NULL if no such layout exists.

Reimplemented from queryLayout.

virtual QSharedPointer< RLayout > RLinkedStorage::queryLayoutDirect(RObject::Id layoutId) const

virtual const

Reimplemented from queryLayoutDirect.

virtual QSharedPointer< RLinetype > RLinkedStorage::queryLinetype(const QString &linetypeName) const

virtual const

Reimplemented from queryLinetype.

virtual QSharedPointer< RLinetype > RLinkedStorage::queryLinetype(RObject::Id linetypeId) const

virtual const

Reimplemented from queryLinetype.

virtual QSharedPointer< RLinetype > RLinkedStorage::queryLinetypeDirect(RObject::Id linetypeId) const

virtual const

Reimplemented from queryLinetypeDirect.

virtual QSharedPointer< RObject > RLinkedStorage::queryObject(RObject::Id objectId) const

virtual const

Returns: A shared pointer to the object with the given objectId or null pointer if the object is no available in this storage.

Reimplemented from queryObject.

virtual QSharedPointer< RObject > RLinkedStorage::queryObjectByHandle(RObject::Handle objectHandle) const

virtual const

Reimplemented from queryObjectByHandle.

virtual RObject * RLinkedStorage::queryObjectCC(RObject::Id objectId) const

virtual const

Reimplemented from queryObjectCC.

virtual QSharedPointer< RObject > RLinkedStorage::queryObjectDirect(RObject::Id objectId) const

virtual const

Reimplemented from queryObjectDirect.

virtual QSet< RObject::Id > RLinkedStorage::querySelectedEntities() const

virtual const

Returns: A set of entity IDs of all selected entities.

Reimplemented from querySelectedEntities.

virtual QSet< RObject::Id > RLinkedStorage::querySelectedLayerEntities(RObject::Id layerId, bool allBlocks=false)

virtual

Returns: A set of all entity IDs of selected entities on the given layer.

Reimplemented from querySelectedLayerEntities.

virtual QSet< RObject::Id > RLinkedStorage::querySelectedLayers() const

virtual const

Returns: A set of object IDs of all selected objects (layers, …).

Reimplemented from querySelectedLayers.

virtual QSharedPointer< RUcs > RLinkedStorage::queryUcs(const QString &ucsName) const

virtual const

Returns: A pointer to the UCS with the given ucsName or NULL if no such UCS exists.

Reimplemented from queryUcs.

virtual QSharedPointer< RUcs > RLinkedStorage::queryUcs(RObject::Id ucsId) const

virtual const

Returns: A pointer to the UCS with the given ucsId or NULL if no such UCS exists.

Reimplemented from queryUcs.

virtual QSharedPointer< RUcs > RLinkedStorage::queryUcsDirect(RObject::Id ucsId) const

virtual const

Reimplemented from queryUcsDirect.

virtual QSharedPointer< RView > RLinkedStorage::queryView(const QString &viewName) const

virtual const

Reimplemented from queryView.

virtual QSharedPointer< RView > RLinkedStorage::queryView(RObject::Id viewId) const

virtual const

Reimplemented from queryView.

void RLinkedStorage::setLinkedEntityQueriesEnabled(bool on)

inline

virtual bool RLinkedStorage::setUndoStatus(RObject::Id objectId, bool status)

virtual

Reimplemented from setUndoStatus.

RStorage* RLinkedStorage::backStorage

private

bool RLinkedStorage::linkedEntityQueriesEnabled

private

int RLinkedStorage::objectIdOffset

private