QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RMemoryStorage Class Reference

Copyright (c) 2011-2013 by Andrew Mustun. More...

#include <RMemoryStorage.h>

Inheritance diagram for RMemoryStorage:
RStorage RNonCopyable RRequireHeap RLinkedStorage

List of all members.

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) const
virtual QString getBlockName (RBlock::Id blockId) const
virtual QSet< QString > getBlockNames () const
virtual RBox getBoundingBox (bool includeHiddenLayer=true)
virtual QVariant getKnownVariable (RS::KnownVariable key) const
virtual RLayer::Id getLayerId (const QString &layerName) const
virtual QString getLayerName (RLayer::Id layerId) const
virtual QSet< QString > getLayerNames () const
virtual RLinetype::Id getLinetypeId (const QString &linetypeName) const
virtual QString getLinetypeName (RLinetype::Id linetypeId) const
virtual QSet< QString > getLinetypeNames () const
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) const
virtual QString getViewName (RView::Id viewId) const
virtual QSet< QString > getViewNames () const
virtual bool hasChildEntities (REntity::Id parentId)
virtual bool hasSelection () const
virtual bool isSelected (REntity::Id entityId)
virtual QSet< REntity::IdqueryAllBlockReferences ()
virtual QSet< RBlock::IdqueryAllBlocks (bool undone=false)
virtual QSet< REntity::IdqueryAllEntities (bool undone=false, bool allBlocks=false)
virtual QSet< RLayer::IdqueryAllLayers (bool undone=false)
virtual QSet< RLinetype::IdqueryAllLinetypes ()
virtual QSet< RObject::IdqueryAllObjects ()
virtual QSet< RUcs::IdqueryAllUcs ()
virtual QSet< RView::IdqueryAllViews (bool undone=false)
virtual QSharedPointer< RBlockqueryBlock (RBlock::Id blockId) const
virtual QSharedPointer< RBlockqueryBlock (const QString &blockName) const
virtual QSharedPointer< RBlockqueryBlockDirect (RBlock::Id blockId) const
virtual QSet< REntity::IdqueryBlockEntities (RBlock::Id blockId)
virtual QSet< REntity::IdqueryBlockReferences (RBlock::Id blockId)
virtual QSet< REntity::IdqueryChildEntities (REntity::Id parentId, RS::EntityType type=RS::EntityAll)
virtual QSharedPointer< REntityqueryEntity (REntity::Id objectId) const
virtual QSharedPointer< REntityqueryEntityDirect (REntity::Id objectId) const
virtual QSharedPointer< RLayerqueryLayer (RLayer::Id layerId) const
virtual QSharedPointer< RLayerqueryLayer (const QString &layerName) const
virtual QSharedPointer< RLayerqueryLayerDirect (RLayer::Id layerId) const
virtual QSet< REntity::IdqueryLayerEntities (RLayer::Id layerId, bool allBlocks=false)
virtual QSharedPointer< RLinetypequeryLinetype (RLinetype::Id linetypeId) const
virtual QSharedPointer< RLinetypequeryLinetype (const QString &linetypeName) const
virtual QSharedPointer< RObjectqueryObject (RObject::Id objectId) const
virtual QSharedPointer< RObjectqueryObjectByHandle (RObject::Handle objectHandle) const
virtual QSharedPointer< RObjectqueryObjectDirect (RObject::Id objectId) const
virtual QSet< REntity::IdquerySelectedEntities ()
virtual QSharedPointer< RUcsqueryUcs (RUcs::Id ucsId) const
virtual QSharedPointer< RUcsqueryUcs (const QString &ucsName) const
virtual QSharedPointer< RUcsqueryUcsDirect (RUcs::Id ucsId) const
virtual QSharedPointer< RViewqueryView (RView::Id viewId) const
virtual QSharedPointer< RViewqueryView (const QString &viewName) const
virtual bool removeObject (QSharedPointer< RObject > object)
virtual void resetTransactionStack ()
 RMemoryStorage ()
 Copyright (c) 2011-2013 by Andrew Mustun.
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)
 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)
void setEntitySelected (QSharedPointer< REntity > entity, bool on, QSet< REntity::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)
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, bool overwrite=true)
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 () const
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) const
virtual bool hasLayer (const QString &layerName) const
virtual bool hasLinetype (const QString &linetypeName) const
virtual bool hasVariable (const QString &key) const
virtual bool hasView (const QString &viewName) const
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::IdorderBackToFront (const QSet< REntity::Id > &entityIds) const
virtual QSharedPointer< RBlockqueryCurrentBlock ()
virtual QSharedPointer< RLayerqueryCurrentLayer ()
virtual QSharedPointer< RViewqueryCurrentView ()
 RStorage ()
 Copyright (c) 2011-2013 by Andrew Mustun.
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

QMultiHash< RBlock::Id,
QSharedPointer< REntity > > 
blockEntityMap
QHash< RBlock::Id,
QSharedPointer< RBlock > > 
blockMap
RBox boundingBox
bool boundingBoxChanged
QHash< REntity::Id,
QSharedPointer< REntity > > 
entityMap
bool inTransaction
QHash< RS::KnownVariable,
QVariant > 
knownVariables
QHash< RLayer::Id,
QSharedPointer< RLayer > > 
layerMap
double linetypeScale
RLineweight::Lineweight maxLineweight
QHash< RObject::Id,
QSharedPointer< RObject > > 
objectMap
QHash< int, RTransactiontransactionMap
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)

Detailed Description

Copyright (c) 2011-2013 by Andrew Mustun.

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. Basic memory based storage.

Scriptable:
This class is wrapped for script environments.

Constructor & Destructor Documentation

RMemoryStorage::RMemoryStorage ( )

Copyright (c) 2011-2013 by Andrew Mustun.

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.

RMemoryStorage::~RMemoryStorage ( )
virtual

Member Function Documentation

void RMemoryStorage::beginTransaction ( )
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.

Returns:
true if a recusrion has been found.
void RMemoryStorage::clear ( )
virtual

Resets this storage to its initial, empty state.

Reimplemented from RStorage.

Reimplemented in RLinkedStorage.

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

Clears the selection status of all entities.

Implements RStorage.

void RMemoryStorage::commitTransaction ( )
virtual

Commits the current transaction.

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

Implements RStorage.

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

Deletes the object with the given ID.

Implements RStorage.

Reimplemented in RLinkedStorage.

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 triggerd. All undone transactions have to be deleted at this point.

Implements RStorage.

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

Deselects all entities with the given IDs.

Parameters:
affectedOptional 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.

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

Deselects the entity with the given ID.

Parameters:
affectedOptional 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.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

RBox RMemoryStorage::getBoundingBox ( bool  includeHiddenLayer = true)
virtual
Returns:
The bounding box around all visible entities.

Implements RStorage.

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

Implements RStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

double RMemoryStorage::getLinetypeScale ( ) const
virtual

Reimplemented from RStorage.

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

Implements RStorage.

int RMemoryStorage::getMaxTransactionId ( )
virtual
Returns:
The highest transaction ID that is in use. This should be used by deleteTransactionsFrom internally.

Implements RStorage.

RBox RMemoryStorage::getSelectionBox ( )
virtual

Implements RStorage.

RTransaction RMemoryStorage::getTransaction ( int  transactionId)
virtual
Returns:
Transaction with the given id.

Implements RStorage.

RS::Unit RMemoryStorage::getUnit ( ) const
virtual

Reimplemented from RStorage.

QVariant RMemoryStorage::getVariable ( const QString &  key) const
virtual
Returns:
The value of the given variable or an invalid variant if the variable does not exist.

Implements RStorage.

QStringList RMemoryStorage::getVariables ( ) const
virtual

Implements RStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

bool RMemoryStorage::hasChildEntities ( REntity::Id  parentId)
virtual

Implements RStorage.

Reimplemented in RLinkedStorage.

bool RMemoryStorage::hasSelection ( ) const
virtual
Returns:
True if at least one entity is selected in this storage.

Implements RStorage.

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

Reimplemented from RStorage.

QSet< REntity::Id > RMemoryStorage::queryAllBlockReferences ( )
virtual
Returns:
A set of all block reference entity IDs.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSet< RBlock::Id > RMemoryStorage::queryAllBlocks ( bool  undone = false)
virtual
Returns:
A set of all block IDs of the document.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSet< REntity::Id > RMemoryStorage::queryAllEntities ( bool  undone = false,
bool  allBlocks = false 
)
virtual
Returns:
A set of all entity IDs of the document.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSet< RLayer::Id > RMemoryStorage::queryAllLayers ( bool  undone = false)
virtual
Returns:
A set of all layer IDs of the document.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSet< RLinetype::Id > RMemoryStorage::queryAllLinetypes ( )
virtual
Returns:
A set of all linetype IDs of the document.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSet< RObject::Id > RMemoryStorage::queryAllObjects ( )
virtual
Returns:
A set of all object IDs of the document.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSet< RUcs::Id > RMemoryStorage::queryAllUcs ( )
virtual
Returns:
A set of all UCS IDs of the document.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSet< RView::Id > RMemoryStorage::queryAllViews ( bool  undone = false)
virtual
Returns:
A set of all view IDs of the document.

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

QSet< REntity::Id > RMemoryStorage::queryBlockEntities ( RBlock::Id  blockId)
virtual
Returns:
A set of all entity IDs that are part of the given block.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSet< REntity::Id > RMemoryStorage::queryBlockReferences ( RBlock::Id  blockId)
virtual
Returns:
A set of all block reference entity IDs that reference the given block.

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

QSharedPointer< REntity > RMemoryStorage::queryEntity ( REntity::Id  entityId) const
virtual
Returns:
A pointer to the enitity with the given entityId or NULL if no such entity exists.

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Reimplemented from RStorage.

Reimplemented in RLinkedStorage.

QSharedPointer< RLayer > RMemoryStorage::queryLayer ( RLayer::Id  layerId) const
virtual
Returns:
A pointer to the layer with the given layerId or NULL if no such layer exists.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSharedPointer< RLayer > RMemoryStorage::queryLayer ( const QString &  layerName) const
virtual
Returns:
A pointer to the layer with the given layerName or NULL if no such layer exists.

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Reimplemented from RStorage.

Reimplemented in RLinkedStorage.

QSet< REntity::Id > RMemoryStorage::queryLayerEntities ( RLayer::Id  layerId,
bool  allBlocks = false 
)
virtual
Returns:
A set of all entity IDs on the given layer.

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

QSharedPointer< RObject > RMemoryStorage::queryObject ( RObject::Id  objectId) const
virtual
Returns:
A shared pointer to the object with the given objectId or null pointer if the object is no available in this storage.

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Reimplemented from RStorage.

Reimplemented in RLinkedStorage.

QSet< REntity::Id > RMemoryStorage::querySelectedEntities ( )
virtual
Returns:
A set of entity IDs of all selected entities.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSharedPointer< RUcs > RMemoryStorage::queryUcs ( RUcs::Id  ucsId) const
virtual
Returns:
A pointer to the UCS with the given ucsId or NULL if no such UCS exists.

Implements RStorage.

Reimplemented in RLinkedStorage.

QSharedPointer< RUcs > RMemoryStorage::queryUcs ( const QString &  ucsName) const
virtual
Returns:
A pointer to the UCS with the given ucsName or NULL if no such UCS exists.

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Reimplemented from RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

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

Implements RStorage.

void RMemoryStorage::resetTransactionStack ( )
virtual

Implements RStorage.

void RMemoryStorage::rollbackTransaction ( )
virtual

Rolls the current transaction back in order to cancel it.

This function should never be called under normal circumstances.

Implements RStorage.

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

Saves the given object to the storage.

Implements RStorage.

void RMemoryStorage::saveTransaction ( RTransaction transaction)
virtual

Saves the given transaction.

Transactions need to be stored for undo / redo functionality.

Implements RStorage.

void RMemoryStorage::selectAllEntites ( QSet< REntity::Id > *  affectedEntities = NULL)
virtual

Sets the selection status of all entities.

isLayerLocked(e->getLayerId()) && !isLayerFrozen(e->getLayerId())) {

Implements RStorage.

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

Selects all entities with the given IDs.

Parameters:
addTrue to add the entities to the current selection. False to replace the current selection with the new entities.
affectedOptional 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.

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

Selects the entity with the given ID.

Parameters:
addTrue to add the entity to the current selection. False to replace the current selection with the given entity.
affectedOptional 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.

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

Reimplemented from RStorage.

void RMemoryStorage::setEntitySelected ( QSharedPointer< REntity entity,
bool  on,
QSet< REntity::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.

void RMemoryStorage::setKnownVariable ( RS::KnownVariable  key,
const QVariant &  value 
)
virtual

Implements RStorage.

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 RStorage.

void RMemoryStorage::setLinetypeScale ( double  v)
virtual

Reimplemented from RStorage.

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

Implements RStorage.

Reimplemented in RLinkedStorage.

void RMemoryStorage::setUnit ( RS::Unit  unit)
virtual

Reimplemented from RStorage.

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

Implements RStorage.

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.

Implements RStorage.

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

Toggles the current undo status of the given object.

Implements RStorage.


Member Data Documentation

QMultiHash<RBlock::Id, QSharedPointer<REntity> > RMemoryStorage::blockEntityMap
protected
QHash<RBlock::Id, QSharedPointer<RBlock> > RMemoryStorage::blockMap
protected
RBox RMemoryStorage::boundingBox
protected
bool RMemoryStorage::boundingBoxChanged
protected
QHash<REntity::Id, QSharedPointer<REntity> > RMemoryStorage::entityMap
protected
bool RMemoryStorage::inTransaction
protected
QHash<RS::KnownVariable, QVariant> RMemoryStorage::knownVariables
protected
QHash<RLayer::Id, QSharedPointer<RLayer> > RMemoryStorage::layerMap
protected
double RMemoryStorage::linetypeScale
protected
RLineweight::Lineweight RMemoryStorage::maxLineweight
protected
QHash<RObject::Id, QSharedPointer<RObject> > RMemoryStorage::objectMap
protected
QHash<int, RTransaction> RMemoryStorage::transactionMap
protected
RS::Unit RMemoryStorage::unit
protected
QMap<QString, QString> RMemoryStorage::variableCaseMap
protected
QHash<QString, QVariant> RMemoryStorage::variables
protected

The documentation for this class was generated from the following files: