|
QCAD Application Framework
CAD Application Development and Automation.
|
Basic memory based storage. More...
#include <RMemoryStorage.h>
Public Member Functions | |
| virtual void | beginTransaction () |
| Starts a new transaction. | |
| bool | checkRecursion (RBlock::Id blockId, RBlock::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< REntity::Id > *affectedEntities=NULL) |
| Clears the selection status of all entities. | |
| virtual void | commitTransaction () |
| Commits the current transaction. | |
| 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 void | deselectEntities (const QSet< REntity::Id > &entityIds, QSet< REntity::Id > *affectedEntities=NULL) |
| Deselects all entities with the given IDs. | |
| virtual void | deselectEntity (REntity::Id entityId, QSet< REntity::Id > *affectedEntities=NULL) |
| Deselects the entity with the given ID. | |
| virtual RBlock::Id | getBlockId (const QString &blockName) |
| virtual QString | getBlockName (RBlock::Id blockId) const |
| virtual QSet< QString > | getBlockNames () |
| virtual RBox | getBoundingBox (bool includeHiddenLayer=true) |
| virtual QVariant | getKnownVariable (RS::KnownVariable key) const |
| virtual RLayer::Id | getLayerId (const QString &layerName) |
| virtual QString | getLayerName (RLayer::Id layerId) |
| virtual QSet< QString > | getLayerNames () |
| virtual RLinetype::Id | getLinetypeId (const QString &linetypeName) |
| virtual QString | getLinetypeName (RLinetype::Id linetypeId) |
| virtual QSet< QString > | getLinetypeNames () |
| virtual double | getLinetypeScale () const |
| virtual RLineweight::Lineweight | getMaxLineweight () const |
| virtual int | getMaxTransactionId () |
| virtual RBox | getSelectionBox () |
| virtual RTransaction | getTransaction (int transactionId) |
| virtual RS::Unit | getUnit () const |
| virtual QVariant | getVariable (const QString &key) const |
| virtual QStringList | getVariables () const |
| virtual RView::Id | getViewId (const QString &viewName) |
| virtual QString | getViewName (RView::Id viewId) |
| virtual QSet< QString > | getViewNames () |
| virtual bool | hasSelection () const |
| virtual bool | isSelected (REntity::Id entityId) |
| virtual QSet< REntity::Id > | queryAllBlockReferences () |
| virtual QSet< RBlock::Id > | queryAllBlocks (bool undone=false) |
| virtual QSet< REntity::Id > | queryAllEntities (bool undone=false, bool allBlocks=false) |
| virtual QSet< RLayer::Id > | queryAllLayers (bool undone=false) |
| virtual QSet< RLinetype::Id > | queryAllLinetypes () |
| virtual QSet< RObject::Id > | queryAllObjects () |
| virtual QSet< RUcs::Id > | queryAllUcs () |
| virtual QSet< RView::Id > | queryAllViews (bool undone=false) |
| virtual QSharedPointer< RBlock > | queryBlock (RBlock::Id blockId) const |
| virtual QSharedPointer< RBlock > | queryBlock (const QString &blockName) const |
| virtual QSharedPointer< RBlock > | queryBlockDirect (RBlock::Id blockId) const |
| virtual QSet< REntity::Id > | queryBlockEntities (RBlock::Id blockId) |
| virtual QSet< REntity::Id > | queryBlockReferences (RBlock::Id blockId) |
| virtual QSharedPointer< REntity > | queryEntity (REntity::Id objectId) const |
| virtual QSharedPointer< REntity > | queryEntityDirect (REntity::Id objectId) const |
| virtual QSharedPointer< RLayer > | queryLayer (RLayer::Id layerId) const |
| virtual QSharedPointer< RLayer > | queryLayer (const QString &layerName) const |
| virtual QSharedPointer< RLayer > | queryLayerDirect (RLayer::Id layerId) const |
| virtual QSet< REntity::Id > | queryLayerEntities (RLayer::Id layerId, bool allBlocks=false) |
| virtual QSharedPointer< RLinetype > | queryLinetype (RLinetype::Id linetypeId) const |
| virtual QSharedPointer< RLinetype > | queryLinetype (const QString &linetypeName) const |
| virtual QSharedPointer< RObject > | queryObject (RObject::Id objectId) const |
| virtual QSharedPointer< RObject > | queryObjectDirect (RObject::Id objectId) const |
| virtual QSet< REntity::Id > | querySelectedEntities () |
| virtual QSharedPointer< RUcs > | queryUcs (RUcs::Id ucsId) const |
| virtual QSharedPointer< RUcs > | queryUcs (const QString &ucsName) const |
| virtual QSharedPointer< RUcs > | queryUcsDirect (RUcs::Id ucsId) const |
| virtual QSharedPointer< RView > | queryView (RView::Id viewId) const |
| virtual QSharedPointer< RView > | queryView (const QString &viewName) const |
| virtual void | resetTransactionStack () |
| RMemoryStorage () | |
| virtual void | rollbackTransaction () |
| Rolls the current transaction back in order to cancel it. | |
| virtual bool | saveObject (QSharedPointer< RObject > object) |
| Saves the given object to the storage. | |
| virtual void | saveTransaction (RTransaction &transaction) |
| Saves the given transaction. | |
| virtual void | selectAllEntites (QSet< REntity::Id > *affectedEntities=NULL) |
| Sets the selection status of all entities. | |
| virtual void | selectEntities (const QSet< REntity::Id > &entityIds, bool add=false, QSet< REntity::Id > *affectedEntities=NULL) |
| Selects all entities with the given IDs. | |
| virtual void | selectEntity (REntity::Id entityId, bool add=false, QSet< REntity::Id > *affectedEntities=NULL) |
| Selects the entity with the given ID. | |
| virtual void | setCurrentBlock (RBlock::Id blockId) |
| virtual void | setKnownVariable (RS::KnownVariable key, const QVariant &value) |
| virtual void | setLastTransactionId (int transactionId) |
| Sets the ID of the last created transaction. | |
| virtual void | setLinetypeScale (double v) |
| virtual bool | setUndoStatus (RObject::Id objectId, bool status) |
| virtual void | setUnit (RS::Unit unit) |
| virtual void | setVariable (const QString &key, const QVariant &value) |
| 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 | ~RMemoryStorage () |
Public Member Functions inherited from RStorage | |
| void | addModifiedListener (RModifiedListener *l) |
| Adds a listener for modified status changed events. | |
| virtual RBlock::Id | getCurrentBlockId () const |
| virtual RColor | getCurrentColor () |
| virtual RLayer::Id | getCurrentLayerId () |
| virtual RLinetype | getCurrentLinetype () |
| virtual RLineweight::Lineweight | getCurrentLineweight () |
| virtual RView::Id | getCurrentViewId () |
| virtual RView::Id | getCurrentViewId () const |
| virtual int | getLastTransactionId () |
| virtual int | getMaxDrawOrder () |
| virtual RObject::Handle | getMaxObjectHandle () |
| virtual RObject::Id | getMaxObjectId () |
| virtual int | getMinDrawOrder () |
| virtual RObject::Handle | getNewObjectHandle () |
| virtual RObject::Id | getNewObjectId () |
| virtual bool | hasBlock (const QString &blockName) |
| virtual bool | hasLayer (const QString &layerName) |
| virtual bool | hasLinetype (const QString &linetypeName) |
| virtual bool | hasView (const QString &viewName) |
| virtual bool | isBlockFrozen (RBlock::Id blockId) const |
| virtual bool | isEntity (RObject::Id objectId) |
| virtual bool | isInBackStorage (RObject::Id) |
| Linked storages should return true if the given object is stored in the storage the linked storage links to. | |
| virtual bool | isLayerFrozen (RLayer::Id layerId) const |
| virtual bool | isLayerLocked (RLayer::Id layerId) const |
| bool | isModified () const |
| virtual QList< REntity::Id > | orderBackToFront (const QSet< REntity::Id > &entityIds) const |
| virtual QSharedPointer< RBlock > | queryCurrentBlock () |
| virtual QSharedPointer< RLayer > | queryCurrentLayer () |
| virtual QSharedPointer< RView > | queryCurrentView () |
| RStorage () | |
| void | setCurrentBlock (const QString &blockName) |
| virtual void | setCurrentColor (const RColor &color) |
| void | setCurrentLayer (RLayer::Id layerId) |
| void | setCurrentLayer (const QString &layerName) |
| void | setCurrentLinetype (RLinetype lt) |
| void | setCurrentLineweight (RLineweight::Lineweight lw) |
| void | setCurrentView (RView::Id viewId) |
| void | setCurrentView (const QString &viewName) |
| virtual void | setMaxDrawOrder (int m) |
| void | setModified (bool m) |
| void | setObjectHandle (RObject &object, RObject::Handle objectHandle) |
| void | setObjectId (RObject &object, RObject::Id objectId) |
| virtual | ~RStorage () |
Public Member Functions inherited from RRequireHeap | |
| void | doDelete () |
Protected Attributes | |
| RBox | boundingBox |
| bool | boundingBoxChanged |
| QHash< REntity::Id, QSharedPointer< REntity > > | entityMap |
| bool | inTransaction |
| QHash< RS::KnownVariable, QVariant > | knownVariables |
| double | linetypeScale |
| RLineweight::Lineweight | maxLineweight |
| QHash< RObject::Id, QSharedPointer< RObject > > | objectMap |
| QHash< int, RTransaction > | transactionMap |
| RS::Unit | unit |
| QMap< QString, QString > | variableCaseMap |
| QHash< QString, QVariant > | variables |
Protected Attributes inherited from RStorage | |
| bool | modified |
Additional Inherited Members | |
Static Public Member Functions inherited from RStorage | |
| static QString | getKnownVariableName (RS::KnownVariable n) |
Basic memory based storage.
| RMemoryStorage::RMemoryStorage | ( | ) |
|
virtual |
|
virtual |
Starts a new transaction.
This function is called before something is stored in the storage.
Implements RStorage.
| bool RMemoryStorage::checkRecursion | ( | RBlock::Id | blockId, |
| RBlock::Id | potentialChildBlockId | ||
| ) |
Checks recursively, if the given block is allowed to contain references to the potential child block.
|
virtual |
Resets this storage to its initial, empty state.
Reimplemented from RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Clears the selection status of all entities.
Implements RStorage.
|
virtual |
Commits the current transaction.
This function is called after something has been stored in the storage.
Implements RStorage.
|
virtual |
|
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 triggerd. All undone transactions have to be deleted at this point.
Implements RStorage.
|
virtual |
Deselects all entities with the given IDs.
| 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. |
Implements RStorage.
|
virtual |
Deselects the entity with the given ID.
| 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. |
Implements RStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
|
virtual |
Implements RStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Reimplemented from RStorage.
|
virtual |
Implements RStorage.
|
virtual |
Implements RStorage.
|
virtual |
Implements RStorage.
|
virtual |
Implements RStorage.
|
virtual |
Implements RStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
|
virtual |
Reimplemented from RStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
entityId or NULL if no such entity exists. Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Reimplemented from RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
layerId or NULL if no such layer exists. Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
layerName or NULL if no such layer exists. Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Reimplemented from RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
objectId or null pointer if the object is no available in this storage. Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Reimplemented from RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
ucsId or NULL if no such UCS exists. Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
ucsName or NULL if no such UCS exists. Implements RStorage.
Reimplemented in RLinkedStorage.
Reimplemented from RStorage.
Reimplemented in RLinkedStorage.
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
|
virtual |
Rolls the current transaction back in order to cancel it.
This function should never be called under normal circumstances.
Implements RStorage.
|
virtual |
Saves the given object to the storage.
Implements RStorage.
|
virtual |
Saves the given transaction.
Transactions need to be stored for undo / redo functionality.
Implements RStorage.
|
virtual |
Sets the selection status of all entities.
isLayerLocked(e->getLayerId()) && !isLayerFrozen(e->getLayerId())) {
Implements RStorage.
|
virtual |
Selects all entities with the given IDs.
| 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. |
Implements RStorage.
|
virtual |
Selects the entity with the given ID.
| 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. |
Implements RStorage.
|
virtual |
Reimplemented from RStorage.
|
virtual |
Implements RStorage.
|
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 RStorage.
|
virtual |
Reimplemented from RStorage.
|
virtual |
Implements RStorage.
Reimplemented in RLinkedStorage.
|
virtual |
Implements RStorage.
|
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.
Implements RStorage.
|
virtual |
Toggles the current undo status of the given object.
Implements RStorage.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |