Skip to content

RMemoryStorage

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

Basic memory based storage.

Scriptable: This class is available in script environments.

RMemoryStorage()
virtual ~RMemoryStorage()
virtual void beginTransaction()
Starts a new transaction.
bool checkRecursion(RObject::Id blockId, RObject::Id potentialChildBlockId)
Checks recursively, if the given block is allowed to contain references to the potential child block.
virtual void clear()
Resets this storage to its initial, empty state.
virtual void clearEntitySelection(QSet< RObject::Id > *affectedEntities=NULL)
Clears the selection status of all entities.
void clearSelectionCache()
void clearVisibleCache()
virtual void commitTransaction()
Commits the current transaction.
virtual int countSelectedEntities() const
virtual bool deleteObject(RObject::Id objectId)
Deletes the object with the given ID.
virtual void deleteTransactionsFrom(int transactionId)
Deletes all transactions with IDs from transactionId (inclusive) to the maximum transaction ID.
virtual int deselectEntities(const QSet< RObject::Id > &entityIds, QSet< RObject::Id > *affectedEntities=NULL)
Deselects all entities with the given IDs.
virtual void deselectEntity(RObject::Id entityId, QSet< RObject::Id > *affectedEntities=NULL)
Deselects the entity with the given ID.
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 RBox getBoundingBox(bool ignoreHiddenLayers=true, bool ignoreEmpty=false) const
virtual RBox getEntitiesBox(QSet< RObject::Id > &ids) 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 getLayerStateId(const QString &layerStateName) const
virtual QString getLayerStateName(RObject::Id layerStateId) const
virtual QSet< QString > getLayerStateNames(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
virtual RLineweight::Lineweight getMaxLineweight() const
virtual int getMaxTransactionId()
virtual RObject::Handle getNewObjectHandle()
virtual RBox getSelectionBox() const
virtual RTransaction getTransaction(int transactionId)
virtual QVariant getVariable(const QString &key) const
virtual QStringList getVariables() const
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
bool hasBlockReferenceEntities() const
virtual bool hasChildEntities(RObject::Id parentId) const
virtual bool hasSelection() const
virtual bool isEntityVisible(const REntity &entity) const
virtual bool isSelected(RObject::Id entityId)
virtual bool isSelectedWorkingSet(RObject::Id entityId)
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) const
virtual QSet< RObject::Id > queryAllLayoutBlocks(bool includeModelSpace=false, bool undone=false) const
virtual QSet< RObject::Id > queryAllLayouts(bool undone)
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(const QString &blockName) 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 > queryBlockReferencesForLayers(const QSet< RObject::Id > &layerIds) 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 QSharedPointer< RObject > queryObjectByHandleDirect(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
virtual QSharedPointer< REntity > queryVisibleEntityDirect(RObject::Id objectId) const
virtual QSet< RObject::Id > queryWorkingSetEntities()
virtual bool removeObject(QSharedPointer< RObject > object)
virtual void removeVariable(const QString &key)
Removes the custom variable with the given key.
virtual void resetTransactionStack()
virtual void rollbackTransaction()
Rolls the current transaction back in order to cancel it.
virtual bool saveObject(QSharedPointer< RObject > object, bool checkBlockRecursion=true, bool keepHandles=false, bool *overwrite=NULL)
Saves the given object to the storage.
virtual void saveTransaction(RTransaction &transaction)
Saves the given transaction.
virtual void selectAllEntities(QSet< RObject::Id > *affectedEntities=NULL)
Sets the selection status of all entities.
virtual int selectEntities(const QSet< RObject::Id > &entityIds, bool add=false, QSet< RObject::Id > *affectedEntities=NULL)
Selects all entities with the given IDs.
virtual void selectEntity(RObject::Id entityId, bool add=false, QSet< RObject::Id > *affectedEntities=NULL)
Selects the entity with the given ID.
virtual void setCurrentBlock(RObject::Id blockId)
virtual void setEntityParentId(REntity &entity, RObject::Id parentId)
void setEntitySelected(QSharedPointer< REntity > entity, bool on, QSet< RObject::Id > *affectedEntities=NULL, bool onlyDescend=false)
Selects first the top most parent in the entity hierarchy and then all children of it.
virtual void setKnownVariable(RS::KnownVariable key, const QVariant &value, RTransaction *transaction=NULL)
Sets a known DXF/DWG variable for this document.
virtual void setLastTransactionId(int transactionId)
Sets the ID of the last created transaction.
virtual void setObjectHandle(RObject &object, RObject::Handle objectHandle)
virtual void setUndoStatus(RObject &object, bool status)
virtual bool setUndoStatus(RObject::Id objectId, bool status)
virtual void setVariable(const QString &key, const QVariant &value, bool overwrite=true)
Sets a custom variable in the context of this document.
virtual void toggleUndoStatus(QSet< RObject::Id > &objects)
Toggles the current undo status of all given objects.
virtual void toggleUndoStatus(RObject::Id object)
Toggles the current undo status of the given object.
virtual void update()
Clear caches:
void updateSelectedEntityMap() const
void updateSelectedLayerMap() const
void updateVisibleCache() const
QHash< RObject::Id, QHash< RObject::Id, QSharedPointer< REntity > > > blockEntityMap
QHash< RObject::Id, QSharedPointer< RBlock > > blockMap
RBox boundingBox
Bounding boxes for ignoreHiddenLayers on/off and ignoreEmpty on/off.
bool boundingBoxDirty
QMultiHash< RObject::Id, RObject::Id > childMap
maps parent entity IDs to child entity IDs
QSharedPointer< RDimStyle > dimStyle
QSharedPointer< RDocumentVariables > documentVariables
QHash< RObject::Id, QSharedPointer< REntity > > entityMap
bool inTransaction
QHash< RObject::Id, QSharedPointer< RLayer > > layerMap
QHash< QString, QSharedPointer< RLayer > > layerNameMap
QHash< RObject::Id, QSharedPointer< RLayerState > > layerStateMap
QHash< RObject::Id, QSharedPointer< RLayout > > layoutMap
QHash< RObject::Id, QSharedPointer< RLinetype > > linetypeMap
RLineweight::Lineweight maxLineweight
QHash< RObject::Handle, QSharedPointer< RObject > > objectHandleMap
QHash< RObject::Id, QSharedPointer< RObject > > objectMap
QHash< RObject::Id, QSharedPointer< REntity > > selectedEntityMap
bool selectedEntityMapDirty
QHash< RObject::Id, QSharedPointer< RLayer > > selectedLayerMap
bool selectedLayerMapDirty
QHash< int, RTransaction > transactionMap
QHash< RS::EntityType, QHash< RObject::Id, QSharedPointer< RObject > > > typeObjectMap
QMap< QString, QString > variableCaseMap
QHash< QString, QVariant > variables
QHash< RObject::Id, QSharedPointer< REntity > > visibleEntityMap
bool visibleEntityMapDirty

RMemoryStorage::RMemoryStorage()

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 RMemoryStorage::~RMemoryStorage()

virtual

virtual void RMemoryStorage::beginTransaction()

virtual

Starts a new transaction.

This function is called before something is stored in the storage.

Reimplemented from beginTransaction.

bool RMemoryStorage::checkRecursion(RObject::Id blockId, RObject::Id potentialChildBlockId)

Checks recursively, if the given block is allowed to contain references to the potential child block.

Returns: true if a recusrion has been found.

virtual void RMemoryStorage::clear()

virtual

Resets this storage to its initial, empty state.

Reimplemented from clear.

Reimplemented in clear.

virtual void RMemoryStorage::clearEntitySelection(QSet< RObject::Id > *affectedEntities=NULL)

virtual

Clears the selection status of all entities.

Reimplemented from clearEntitySelection.

void RMemoryStorage::clearSelectionCache()

void RMemoryStorage::clearVisibleCache()

virtual void RMemoryStorage::commitTransaction()

virtual

Commits the current transaction.

This function is called after something has been stored in the storage.

Reimplemented from commitTransaction.

virtual int RMemoryStorage::countSelectedEntities() const

virtual const

Returns: Number of selected entities.

Reimplemented from countSelectedEntities.

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

virtual

Deletes the object with the given ID.

Reimplemented from deleteObject.

Reimplemented in deleteObject.

virtual void RMemoryStorage::deleteTransactionsFrom(int transactionId)

virtual

Deletes all transactions with IDs from transactionId (inclusive) to the maximum transaction ID.

This is called if some transactions have been undone and then a redo is triggered. All undone transactions have to be deleted at this point.

Reimplemented from deleteTransactionsFrom.

virtual int RMemoryStorage::deselectEntities(const QSet< RObject::Id > &entityIds, QSet< RObject::Id > *affectedEntities=NULL)

virtual

Deselects all entities with the given IDs.

Parameters:

  • affected: Optional pointer to an empty set of entity IDs. After the call, this set will contain all entity IDs of entities that were affected by the call.

Reimplemented from deselectEntities.

virtual void RMemoryStorage::deselectEntity(RObject::Id entityId, QSet< RObject::Id > *affectedEntities=NULL)

virtual

Deselects the entity with the given ID.

Parameters:

  • affected: Optional pointer to an empty set of entity IDs. After the call, this set will contain all entity IDs of entities that were affected by the call.

Reimplemented from deselectEntity.

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

virtual const

Reimplemented from getBlockId.

Reimplemented in getBlockId.

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

virtual const

Reimplemented from getBlockIdAuto.

Reimplemented in getBlockIdAuto.

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

virtual const

Reimplemented from getBlockName.

Reimplemented in getBlockName.

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

virtual const

Reimplemented from getBlockNameFromHandle.

Reimplemented in getBlockNameFromHandle.

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

virtual const

Reimplemented from getBlockNameFromLayout.

Reimplemented in getBlockNameFromLayout.

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

virtual const

Reimplemented from getBlockNameFromLayout.

Reimplemented in getBlockNameFromLayout.

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

virtual const

Reimplemented from getBlockNames.

Reimplemented in getBlockNames.

virtual RBox RMemoryStorage::getBoundingBox(bool ignoreHiddenLayers=true, bool ignoreEmpty=false) const

virtual const

Returns: The bounding box around all visible entities.

Reimplemented from getBoundingBox.

virtual RBox RMemoryStorage::getEntitiesBox(QSet< RObject::Id > &ids) const

virtual const

Reimplemented from getEntitiesBox.

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

virtual const

Returns: Value for the given DXF/DWG variable.

Reimplemented from getKnownVariable.

Reimplemented in getKnownVariable.

virtual RLayer::Id RMemoryStorage::getLayerId(const QString &layerName) const

virtual const

Reimplemented from getLayerId.

Reimplemented in getLayerId.

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

virtual const

Reimplemented from getLayerName.

Reimplemented in getLayerName.

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

virtual const

Reimplemented from getLayerNames.

Reimplemented in getLayerNames.

virtual RLayerState::Id RMemoryStorage::getLayerStateId(const QString &layerStateName) const

virtual const

Reimplemented from getLayerStateId.

virtual QString RMemoryStorage::getLayerStateName(RObject::Id layerStateId) const

virtual const

Reimplemented from getLayerStateName.

virtual QSet< QString > RMemoryStorage::getLayerStateNames(const QString &rxStr=RDEFAULT_QSTRING) const

virtual const

Reimplemented from getLayerStateNames.

virtual RLayout::Id RMemoryStorage::getLayoutId(const QString &layoutName) const

virtual const

Reimplemented from getLayoutId.

Reimplemented in getLayoutId.

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

virtual const

Reimplemented from getLayoutName.

Reimplemented in getLayoutName.

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

virtual const

Reimplemented from getLayoutNames.

Reimplemented in getLayoutNames.

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

virtual const

Returns: User readable description for the given linetype.

Reimplemented from getLinetypeDescription.

Reimplemented in getLinetypeDescription.

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

virtual const

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

Reimplemented from getLinetypeId.

Reimplemented in getLinetypeId.

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

virtual const

Returns: User readable label for the given linetype.

Reimplemented from getLinetypeLabel.

Reimplemented in getLinetypeLabel.

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

virtual const

Returns: Linetype name of the given linetype.

Reimplemented from getLinetypeName.

Reimplemented in getLinetypeName.

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

virtual const

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

Reimplemented from getLinetypeNames.

Reimplemented in getLinetypeNames.

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

virtual const

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

Reimplemented from getLinetypePatterns.

Reimplemented in getLinetypePatterns.

virtual RLineweight::Lineweight RMemoryStorage::getMaxLineweight() const

virtual const

Reimplemented from getMaxLineweight.

virtual int RMemoryStorage::getMaxTransactionId()

virtual

Returns: The highest transaction ID that is in use. This should be used by deleteTransactionsFrom internally.

Reimplemented from getMaxTransactionId.

virtual RObject::Handle RMemoryStorage::getNewObjectHandle()

virtual

Reimplemented from getNewObjectHandle.

Reimplemented in getNewObjectHandle.

virtual RBox RMemoryStorage::getSelectionBox() const

virtual const

Reimplemented from getSelectionBox.

virtual RTransaction RMemoryStorage::getTransaction(int transactionId)

virtual

Returns: Transaction with the given id.

Reimplemented from getTransaction.

virtual QVariant RMemoryStorage::getVariable(const QString &key) const

virtual const

Returns: The value of the given variable or an invalid variant if the variable does not exist.

Reimplemented from getVariable.

virtual QStringList RMemoryStorage::getVariables() const

virtual const

Returns: List of custom variable names stored in this document.

Reimplemented from getVariables.

virtual RView::Id RMemoryStorage::getViewId(const QString &viewName) const

virtual const

Reimplemented from getViewId.

Reimplemented in getViewId.

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

virtual const

Reimplemented from getViewName.

Reimplemented in getViewName.

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

virtual const

Reimplemented from getViewNames.

Reimplemented in getViewNames.

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

virtual const

Returns: True if the given block contains any entities.

Reimplemented from hasBlockEntities.

Reimplemented in hasBlockEntities.

bool RMemoryStorage::hasBlockReferenceEntities() const

const

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

virtual const

Reimplemented from hasChildEntities.

Reimplemented in hasChildEntities.

virtual bool RMemoryStorage::hasSelection() const

virtual const

Returns: True if at least one entity is selected in this storage.

Reimplemented from hasSelection.

virtual bool RMemoryStorage::isEntityVisible(const REntity &entity) const

virtual const

virtual bool RMemoryStorage::isSelected(RObject::Id entityId)

virtual

Reimplemented from isSelected.

virtual bool RMemoryStorage::isSelectedWorkingSet(RObject::Id entityId)

virtual

Reimplemented from isSelectedWorkingSet.

virtual QSet< REntity::Id > RMemoryStorage::queryAllBlockReferences() const

virtual const

Returns: A set of all block reference entity IDs.

Reimplemented from queryAllBlockReferences.

Reimplemented in queryAllBlockReferences.

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

virtual

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

Reimplemented from queryAllBlocks.

Reimplemented in queryAllBlocks.

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

virtual

Reimplemented from queryAllEntities.

Reimplemented in queryAllEntities.

virtual QSet< REntity::Id > RMemoryStorage::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.

Reimplemented in queryAllEntities.

virtual QSet< RLayer::Id > RMemoryStorage::queryAllLayers(bool undone=false)

virtual

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

Reimplemented from queryAllLayers.

Reimplemented in queryAllLayers.

virtual QSet< RLayerState::Id > RMemoryStorage::queryAllLayerStates(bool undone=false) const

virtual const

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

Reimplemented from queryAllLayerStates.

virtual QSet< RBlock::Id > RMemoryStorage::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.

Reimplemented in queryAllLayoutBlocks.

virtual QSet< RBlock::Id > RMemoryStorage::queryAllLayouts(bool undone)

virtual

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

Reimplemented from queryAllLayouts.

Reimplemented in queryAllLayouts.

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

virtual

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

Reimplemented from queryAllLinetypes.

Reimplemented in queryAllLinetypes.

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

virtual const

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

Reimplemented from queryAllObjects.

Reimplemented in queryAllObjects.

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

virtual

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

Reimplemented from queryAllUcs.

Reimplemented in queryAllUcs.

virtual QSet< REntity::Id > RMemoryStorage::queryAllViewports() const

virtual const

Returns: A set of all viewport entity IDs.

Reimplemented from queryAllViewports.

Reimplemented in queryAllViewports.

virtual QSet< RView::Id > RMemoryStorage::queryAllViews(bool undone=false)

virtual

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

Reimplemented from queryAllViews.

Reimplemented in queryAllViews.

virtual QSet< REntity::Id > RMemoryStorage::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.

Reimplemented in queryAllVisibleEntities.

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

virtual const

Reimplemented from queryBlock.

Reimplemented in queryBlock.

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

virtual const

Reimplemented from queryBlock.

Reimplemented in queryBlock.

virtual QSharedPointer< RBlock > RMemoryStorage::queryBlockDirect(const QString &blockName) const

virtual const

Reimplemented from queryBlockDirect.

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

virtual const

Reimplemented from queryBlockDirect.

Reimplemented in queryBlockDirect.

virtual QSet< REntity::Id > RMemoryStorage::queryBlockEntities(RObject::Id blockId)

virtual

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

Reimplemented from queryBlockEntities.

Reimplemented in queryBlockEntities.

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

virtual const

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

Reimplemented from queryBlockReferences.

Reimplemented in queryBlockReferences.

virtual QSet< REntity::Id > RMemoryStorage::queryBlockReferencesForLayers(const QSet< RObject::Id > &layerIds) const

virtual const

Returns: A set of the IDs of those block reference entities whose visual appearance may change when the visibility of the given layers changes. These are references to blocks which contain entities on one of the given layers (directly or indirectly through nested block references) and block references which are themselves on one of the given layers (the visibility of layer 0 entities in the referenced block depends on the layer of the block reference). The default implementation conservatively returns all block references.

Reimplemented from queryBlockReferencesForLayers.

virtual QSet< REntity::Id > RMemoryStorage::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.

Reimplemented in queryChildEntities.

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

virtual const

Reimplemented from queryDimStyle.

Reimplemented in queryDimStyle.

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

virtual const

Reimplemented from queryDimStyleDirect.

Reimplemented in queryDimStyleDirect.

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

virtual const

Reimplemented from queryDocumentVariables.

Reimplemented in queryDocumentVariables.

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

virtual const

Reimplemented from queryDocumentVariablesDirect.

Reimplemented in queryDocumentVariablesDirect.

virtual QSharedPointer< REntity > RMemoryStorage::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.

Reimplemented in queryEntity.

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

virtual const

Reimplemented from queryEntityDirect.

Reimplemented in queryEntityDirect.

virtual QSet< REntity::Id > RMemoryStorage::queryInfiniteEntities() const

virtual const

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

Reimplemented from queryInfiniteEntities.

Reimplemented in queryInfiniteEntities.

virtual QSharedPointer< RLayer > RMemoryStorage::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.

Reimplemented in queryLayer.

virtual QSharedPointer< RLayer > RMemoryStorage::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.

Reimplemented in queryLayer.

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

virtual

Reimplemented from queryLayerBlockEntities.

Reimplemented in queryLayerBlockEntities.

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

virtual const

Reimplemented from queryLayerDirect.

Reimplemented in queryLayerDirect.

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

virtual

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

Reimplemented from queryLayerEntities.

Reimplemented in queryLayerEntities.

virtual QSharedPointer< RLayerState > RMemoryStorage::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.

Reimplemented in queryLayerState.

virtual QSharedPointer< RLayerState > RMemoryStorage::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.

Reimplemented in queryLayerState.

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

virtual const

Reimplemented from queryLayerStateDirect.

Reimplemented in queryLayerStateDirect.

virtual QSharedPointer< RLayout > RMemoryStorage::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.

Reimplemented in queryLayout.

virtual QSharedPointer< RLayout > RMemoryStorage::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.

Reimplemented in queryLayout.

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

virtual const

Reimplemented from queryLayoutDirect.

Reimplemented in queryLayoutDirect.

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

virtual const

Reimplemented from queryLinetype.

Reimplemented in queryLinetype.

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

virtual const

Reimplemented from queryLinetype.

Reimplemented in queryLinetype.

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

virtual const

Reimplemented from queryLinetypeDirect.

Reimplemented in queryLinetypeDirect.

virtual QSharedPointer< RObject > RMemoryStorage::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.

Reimplemented in queryObject.

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

virtual const

Reimplemented from queryObjectByHandle.

Reimplemented in queryObjectByHandle.

virtual QSharedPointer< RObject > RMemoryStorage::queryObjectByHandleDirect(RObject::Handle objectHandle) const

virtual const

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

virtual const

Reimplemented from queryObjectCC.

Reimplemented in queryObjectCC.

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

virtual const

Reimplemented from queryObjectDirect.

Reimplemented in queryObjectDirect.

virtual QSet< REntity::Id > RMemoryStorage::querySelectedEntities() const

virtual const

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

Reimplemented from querySelectedEntities.

Reimplemented in querySelectedEntities.

virtual QSet< REntity::Id > RMemoryStorage::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.

Reimplemented in querySelectedLayerEntities.

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

virtual const

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

Reimplemented from querySelectedLayers.

Reimplemented in querySelectedLayers.

virtual QSharedPointer< RUcs > RMemoryStorage::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.

Reimplemented in queryUcs.

virtual QSharedPointer< RUcs > RMemoryStorage::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.

Reimplemented in queryUcs.

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

virtual const

Reimplemented from queryUcsDirect.

Reimplemented in queryUcsDirect.

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

virtual const

Reimplemented from queryView.

Reimplemented in queryView.

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

virtual const

Reimplemented from queryView.

Reimplemented in queryView.

virtual QSharedPointer< REntity > RMemoryStorage::queryVisibleEntityDirect(RObject::Id objectId) const

virtual const

Reimplemented from queryVisibleEntityDirect.

virtual QSet< REntity::Id > RMemoryStorage::queryWorkingSetEntities()

virtual

Returns: A set of all entity IDs in the current working set.

Reimplemented from queryWorkingSetEntities.

virtual bool RMemoryStorage::removeObject(QSharedPointer< RObject > object)

virtual

Reimplemented from removeObject.

virtual void RMemoryStorage::removeVariable(const QString &key)

virtual

Removes the custom variable with the given key.

Reimplemented from removeVariable.

virtual void RMemoryStorage::resetTransactionStack()

virtual

Reimplemented from resetTransactionStack.

virtual void RMemoryStorage::rollbackTransaction()

virtual

Rolls the current transaction back in order to cancel it.

This function should never be called under normal circumstances.

Reimplemented from rollbackTransaction.

virtual bool RMemoryStorage::saveObject(QSharedPointer< RObject > object, bool checkBlockRecursion=true, bool keepHandles=false, bool *overwrite=NULL)

virtual

Saves the given object to the storage.

Reimplemented from saveObject.

virtual void RMemoryStorage::saveTransaction(RTransaction &transaction)

virtual

Saves the given transaction.

Transactions need to be stored for undo / redo functionality.

Reimplemented from saveTransaction.

virtual void RMemoryStorage::selectAllEntities(QSet< RObject::Id > *affectedEntities=NULL)

virtual

Sets the selection status of all entities.

Reimplemented from selectAllEntities.

virtual int RMemoryStorage::selectEntities(const QSet< RObject::Id > &entityIds, bool add=false, QSet< RObject::Id > *affectedEntities=NULL)

virtual

Selects all entities with the given IDs.

Parameters:

  • add: True to add the entities to the current selection. False to replace the current selection with the new entities.
  • affected: Optional pointer to an empty set of entity IDs. After the call, this set will contain all entity IDs of entities that were affected by the call.

Reimplemented from selectEntities.

virtual void RMemoryStorage::selectEntity(RObject::Id entityId, bool add=false, QSet< RObject::Id > *affectedEntities=NULL)

virtual

Selects the entity with the given ID.

Parameters:

  • add: True to add the entity to the current selection. False to replace the current selection with the given entity.
  • affected: Optional pointer to an empty set of entity IDs. After the call, this set will contain all entity IDs of entities that were affected by the call.

Reimplemented from selectEntity.

virtual void RMemoryStorage::setCurrentBlock(RObject::Id blockId)

virtual

Reimplemented from setCurrentBlock.

virtual void RMemoryStorage::setEntityParentId(REntity &entity, RObject::Id parentId)

virtual

Reimplemented from setEntityParentId.

void RMemoryStorage::setEntitySelected(QSharedPointer< REntity > entity, bool on, QSet< RObject::Id > *affectedEntities=NULL, bool onlyDescend=false)

Selects first the top most parent in the entity hierarchy and then all children of it.

This is necessary for attributes which are children of block references.

virtual void RMemoryStorage::setKnownVariable(RS::KnownVariable key, const QVariant &value, RTransaction *transaction=NULL)

virtual

Sets a known DXF/DWG variable for this document.

Parameters:

  • key: Variable key (see DXF reference)
  • value: New value of the variable.
  • transaction: RTransaction to use for the change or NULL (default) to create a transaction on the fly.

Reimplemented from setKnownVariable.

virtual void RMemoryStorage::setLastTransactionId(int transactionId)

virtual

Sets the ID of the last created transaction.

This is called when a transaction is undone or redone (the last transaction id indicates where we are in the transaction stack). The default implementation sets the variable “LastTransaction”.

Reimplemented from setLastTransactionId.

virtual void RMemoryStorage::setObjectHandle(RObject &object, RObject::Handle objectHandle)

virtual

Reimplemented from setObjectHandle.

virtual void RMemoryStorage::setUndoStatus(RObject &object, bool status)

virtual

Reimplemented from setUndoStatus.

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

virtual

Reimplemented from setUndoStatus.

Reimplemented in setUndoStatus.

virtual void RMemoryStorage::setVariable(const QString &key, const QVariant &value, bool overwrite=true)

virtual

Sets a custom variable in the context of this document.

Parameters:

  • key: Variable key (name)
  • value: Variable value
  • overwrite: True to overwrite an existing variable with the same key (default)

Reimplemented from setVariable.

virtual void RMemoryStorage::toggleUndoStatus(QSet< RObject::Id > &objects)

virtual

Toggles the current undo status of all given objects.

The undo status can for example be a boolean value that is true if the object is undone or false otherwise.

Reimplemented from toggleUndoStatus.

virtual void RMemoryStorage::toggleUndoStatus(RObject::Id object)

virtual

Toggles the current undo status of the given object.

Reimplemented from toggleUndoStatus.

virtual void RMemoryStorage::update()

virtual

Clear caches:

Reimplemented from update.

void RMemoryStorage::updateSelectedEntityMap() const

const

void RMemoryStorage::updateSelectedLayerMap() const

const

void RMemoryStorage::updateVisibleCache() const

const

QHash<RObject::Id, QHash<RObject::Id, QSharedPointer<REntity> > > RMemoryStorage::blockEntityMap

protected

QHash<RObject::Id, QSharedPointer<RBlock> > RMemoryStorage::blockMap

protected

RBox RMemoryStorage::boundingBox[2][2] [2][2]

protected

Bounding boxes for ignoreHiddenLayers on/off and ignoreEmpty on/off.

bool RMemoryStorage::boundingBoxDirty

protected

QMultiHash<RObject::Id, RObject::Id> RMemoryStorage::childMap

protected

maps parent entity IDs to child entity IDs

QSharedPointer<RDimStyle> RMemoryStorage::dimStyle

protected

QSharedPointer<RDocumentVariables> RMemoryStorage::documentVariables

protected

QHash<RObject::Id, QSharedPointer<REntity> > RMemoryStorage::entityMap

protected

bool RMemoryStorage::inTransaction

protected

QHash<RObject::Id, QSharedPointer<RLayer> > RMemoryStorage::layerMap

protected

QHash<QString, QSharedPointer<RLayer> > RMemoryStorage::layerNameMap

protected

QHash<RObject::Id, QSharedPointer<RLayerState> > RMemoryStorage::layerStateMap

protected

QHash<RObject::Id, QSharedPointer<RLayout> > RMemoryStorage::layoutMap

protected

QHash<RObject::Id, QSharedPointer<RLinetype> > RMemoryStorage::linetypeMap

protected

RLineweight::Lineweight RMemoryStorage::maxLineweight

protected

QHash<RObject::Handle, QSharedPointer<RObject> > RMemoryStorage::objectHandleMap

protected

QHash<RObject::Id, QSharedPointer<RObject> > RMemoryStorage::objectMap

protected

QHash<RObject::Id, QSharedPointer<REntity> > RMemoryStorage::selectedEntityMap

protected

bool RMemoryStorage::selectedEntityMapDirty

protected

QHash<RObject::Id, QSharedPointer<RLayer> > RMemoryStorage::selectedLayerMap

protected

bool RMemoryStorage::selectedLayerMapDirty

protected

QHash<int, RTransaction> RMemoryStorage::transactionMap

protected

QHash<RS::EntityType, QHash<RObject::Id, QSharedPointer<RObject> > > RMemoryStorage::typeObjectMap

protected

QMap<QString, QString> RMemoryStorage::variableCaseMap

protected

QHash<QString, QVariant> RMemoryStorage::variables

protected

QHash<RObject::Id, QSharedPointer<REntity> > RMemoryStorage::visibleEntityMap

protected

bool RMemoryStorage::visibleEntityMapDirty

protected