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

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

#include <RStorage.h>

Inheritance diagram for RStorage:
RNonCopyable RRequireHeap RMemoryStorage RLinkedStorage

List of all members.

Public Member Functions

void addModifiedListener (RModifiedListener *l)
 Adds a listener for modified status changed events.
virtual void beginTransaction ()=0
 Starts a new transaction.
virtual void clear ()
 Resets this storage to its initial, empty state.
virtual void clearEntitySelection (QSet< REntity::Id > *affectedEntities=NULL)=0
 Clears the selection status of all entities.
virtual void commitTransaction ()=0
 Commits the current transaction.
virtual bool deleteObject (RObject::Id objectId)=0
 Deletes the object with the given ID.
virtual void deleteTransactionsFrom (int transactionId)=0
 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)=0
 Deselects all entities with the given IDs.
virtual void deselectEntity (REntity::Id entityId, QSet< REntity::Id > *affectedEntities=NULL)=0
 Deselects the entity with the given ID.
void endDocumentVariablesTransaction (RTransaction *transaction, bool useLocalTransaction, QSharedPointer< RDocumentVariables > docVars)
virtual RBlock::Id getBlockId (const QString &blockName) const =0
virtual QString getBlockName (RBlock::Id blockId) const =0
virtual QSet< QString > getBlockNames () const =0
virtual RBox getBoundingBox (bool ignoreHiddenLayers=true, bool ignoreEmpty=false) const =0
virtual RBlock::Id getCurrentBlockId () const
virtual RColor getCurrentColor () const
virtual RLayer::Id getCurrentLayerId () const
virtual RLinetype::Id getCurrentLinetypeId () const
virtual RLinetypePattern getCurrentLinetypePattern () const
virtual RLineweight::Lineweight getCurrentLineweight () const
virtual RView::Id getCurrentViewId () const
virtual QString getDimensionFont () const
RDocumentgetDocument () const
virtual QVariant getKnownVariable (RS::KnownVariable key) const =0
virtual int getLastTransactionId ()
virtual RLayer::Id getLayerId (const QString &layerName) const =0
virtual QString getLayerName (RLayer::Id layerId) const =0
virtual QSet< QString > getLayerNames () const =0
virtual QString getLinetypeDescription (RLinetype::Id linetypeId) const =0
virtual RLinetype::Id getLinetypeId (const QString &linetypeName) const =0
virtual QString getLinetypeLabel (RLinetype::Id linetypeId) const =0
virtual QString getLinetypeName (RLinetype::Id linetypeId) const =0
virtual QSet< QString > getLinetypeNames () const =0
virtual QList< RLinetypePatterngetLinetypePatterns () const =0
virtual double getLinetypeScale () const
virtual int getMaxDrawOrder ()
virtual RLineweight::Lineweight getMaxLineweight () const =0
virtual RObject::Handle getMaxObjectHandle ()
virtual RObject::Id getMaxObjectId ()
virtual int getMaxTransactionId ()=0
virtual int getMinDrawOrder ()
virtual RObject::Handle getNewObjectHandle ()
virtual RObject::Id getNewObjectId ()
virtual RBox getSelectionBox () const =0
virtual RTransaction getTransaction (int transactionId)=0
RS::Unit getUnit () const
virtual QVariant getVariable (const QString &key) const =0
virtual QStringList getVariables () const =0
virtual RView::Id getViewId (const QString &viewName) const =0
virtual QString getViewName (RView::Id viewId) const =0
virtual QSet< QString > getViewNames () const =0
virtual bool hasBlock (const QString &blockName) const
virtual bool hasChildEntities (REntity::Id parentId)=0
virtual bool hasLayer (const QString &layerName) const
virtual bool hasLinetype (const QString &linetypeName) const
virtual bool hasSelection () const =0
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 bool isSelected (REntity::Id entityId)
virtual QList< REntity::IdorderBackToFront (const QSet< REntity::Id > &entityIds) const
virtual QSet< REntity::IdqueryAllBlockReferences ()=0
virtual QSet< RBlock::IdqueryAllBlocks (bool undone=false)=0
virtual QSet< REntity::IdqueryAllEntities (bool undone=false, bool allBlocks=false, RS::EntityType type=RS::EntityAll)=0
virtual QSet< RLayer::IdqueryAllLayers (bool undone=false)=0
virtual QSet< RLinetype::IdqueryAllLinetypes ()=0
virtual QSet< RObject::IdqueryAllObjects ()=0
virtual QSet< RUcs::IdqueryAllUcs ()=0
virtual QSet< RView::IdqueryAllViews (bool undone=false)=0
virtual QSharedPointer< RBlockqueryBlock (RBlock::Id blockId) const =0
virtual QSharedPointer< RBlockqueryBlock (const QString &blockName) const =0
virtual QSharedPointer< RBlockqueryBlockDirect (RBlock::Id blockId) const =0
virtual QSet< REntity::IdqueryBlockEntities (RBlock::Id blockId)=0
virtual QSet< REntity::IdqueryBlockReferences (RBlock::Id blockId)=0
virtual QSet< REntity::IdqueryChildEntities (REntity::Id parentId, RS::EntityType type=RS::EntityAll)=0
virtual QSharedPointer< RBlockqueryCurrentBlock ()
virtual QSharedPointer< RLayerqueryCurrentLayer ()
virtual QSharedPointer< RLinetypequeryCurrentLinetype () const
virtual QSharedPointer< RViewqueryCurrentView ()
virtual QSharedPointer
< RDocumentVariables
queryDocumentVariables () const =0
virtual QSharedPointer
< RDocumentVariables
queryDocumentVariablesDirect () const =0
virtual QSharedPointer< REntityqueryEntity (REntity::Id entityId) const =0
virtual QSharedPointer< REntityqueryEntityDirect (REntity::Id entityId) const
virtual QSet< REntity::IdqueryInfiniteEntities ()=0
virtual QSharedPointer< RLayerqueryLayer (RLayer::Id layerId) const =0
virtual QSharedPointer< RLayerqueryLayer (const QString &layerName) const =0
virtual QSharedPointer< RLayerqueryLayerDirect (RLayer::Id layerId) const
virtual QSet< REntity::IdqueryLayerEntities (RLayer::Id layerId, bool allBlocks=false)=0
virtual QSharedPointer< RLinetypequeryLinetype (RLinetype::Id linetypeId) const =0
virtual QSharedPointer< RLinetypequeryLinetype (const QString &linetypeName) const =0
virtual QSharedPointer< RLinetypequeryLinetypeDirect (RLinetype::Id linetypeId) const =0
virtual QSharedPointer< RObjectqueryObject (RObject::Id objectId) const =0
virtual QSharedPointer< RObjectqueryObjectByHandle (RObject::Handle objectHandle) const =0
virtual QSharedPointer< RObjectqueryObjectDirect (RObject::Id objectId) const
virtual QSet< REntity::IdquerySelectedEntities ()=0
virtual QSharedPointer< RUcsqueryUcs (RUcs::Id ucsId) const =0
virtual QSharedPointer< RUcsqueryUcs (const QString &ucsName) const =0
virtual QSharedPointer< RUcsqueryUcsDirect (RUcs::Id ucsId) const
virtual QSharedPointer< RViewqueryView (RView::Id viewId) const =0
virtual QSharedPointer< RViewqueryView (const QString &viewName) const =0
virtual bool removeObject (QSharedPointer< RObject > object)=0
virtual void resetTransactionStack ()=0
virtual void rollbackTransaction ()=0
 Rolls the current transaction back in order to cancel it.
 RStorage ()
 Copyright (c) 2011-2014 by Andrew Mustun.
virtual bool saveObject (QSharedPointer< RObject > object, bool checkBlockRecursion=true, bool keepHandles=false)=0
 Saves the given object to the storage.
virtual void saveTransaction (RTransaction &transaction)=0
 Saves the given transaction.
virtual void selectAllEntites (QSet< REntity::Id > *affectedEntities=NULL)=0
 Sets the selection status of all entities.
virtual void selectEntities (const QSet< REntity::Id > &entityIds, bool add=false, QSet< REntity::Id > *affectedEntities=NULL)=0
 Selects all entities with the given IDs.
virtual void selectEntity (REntity::Id entityId, bool add=false, QSet< REntity::Id > *affectedEntities=NULL)=0
 Selects the entity with the given ID.
virtual void setCurrentBlock (RBlock::Id blockId)
void setCurrentBlock (const QString &blockName)
virtual void setCurrentColor (const RColor &color)
void setCurrentLayer (RLayer::Id layerId, RTransaction *transaction=NULL)
void setCurrentLayer (const QString &layerName, RTransaction *transaction=NULL)
void setCurrentLinetype (RLinetype::Id ltId)
void setCurrentLinetype (const QString &name)
void setCurrentLinetypePattern (const RLinetypePattern &p)
void setCurrentLineweight (RLineweight::Lineweight lw)
void setCurrentView (RView::Id viewId)
void setCurrentView (const QString &viewName)
virtual void setDimensionFont (const QString &f, RTransaction *transaction=NULL)
void setDocument (RDocument *doc)
virtual void setKnownVariable (RS::KnownVariable key, const QVariant &value, RTransaction *transaction=NULL)=0
virtual void setLastTransactionId (int transactionId)
 Sets the ID of the last created transaction.
virtual void setLinetypeScale (double v, RTransaction *transaction=NULL)
virtual void setMaxDrawOrder (int m)
void setModified (bool m)
void setObjectHandle (RObject &object, RObject::Handle objectHandle)
void setObjectId (RObject &object, RObject::Id objectId)
virtual bool setUndoStatus (RObject::Id object, bool status)=0
void setUnit (RS::Unit unit, RTransaction *transaction=NULL)
virtual void setVariable (const QString &key, const QVariant &value, bool overwrite=true)=0
QSharedPointer
< RDocumentVariables
startDocumentVariablesTransaction (RTransaction *&transaction, bool &useLocalTransaction)
virtual void toggleUndoStatus (QSet< RObject::Id > &objects)=0
 Toggles the current undo status of all given objects.
virtual void toggleUndoStatus (RObject::Id object)=0
 Toggles the current undo status of the given object.
virtual void update ()
 Clear caches:
virtual ~RStorage ()
- Public Member Functions inherited from RRequireHeap
void doDelete ()

Static Public Member Functions

static QString getKnownVariableName (RS::KnownVariable n)

Protected Attributes

bool modified

Private Attributes

RBlock::Id currentBlockId
RColor currentColor
RLinetype::Id currentLinetypeId
RLineweight::Lineweight currentLineweight
RView::Id currentViewId
RDocumentdocument
RObject::Handle handleCounter
RObject::Id idCounter
int lastTransactionId
int maxDrawOrder
QList< RModifiedListener * > modifiedListeners

Friends

QDebug operator<< (QDebug dbg, RStorage &s)
 Stream operator for QDebug.

Additional Inherited Members

- Protected Member Functions inherited from RRequireHeap
virtual ~RRequireHeap ()

Detailed Description

Copyright (c) 2011-2014 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. This is the abstract base class for all storage implementations. A storage is used to store documents (entities, layers, blocks, transactions) in memory or on disk. Every document is backed by a storage object.

A storage implementation is available in the qcaddbstorage.

Scriptable:
This class is wrapped for script environments.

Constructor & Destructor Documentation

RStorage::RStorage ( )

Copyright (c) 2011-2014 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.

virtual RStorage::~RStorage ( )
inlinevirtual

Member Function Documentation

void RStorage::addModifiedListener ( RModifiedListener l)

Adds a listener for modified status changed events.

This can for example be a modification indication widget.

virtual void RStorage::beginTransaction ( )
pure virtual

Starts a new transaction.

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

Implemented in RMemoryStorage.

void RStorage::clear ( )
virtual

Resets this storage to its initial, empty state.

Reimplemented in RLinkedStorage, and RMemoryStorage.

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

Clears the selection status of all entities.

Implemented in RMemoryStorage.

virtual void RStorage::commitTransaction ( )
pure virtual

Commits the current transaction.

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

Implemented in RMemoryStorage.

virtual bool RStorage::deleteObject ( RObject::Id  objectId)
pure virtual

Deletes the object with the given ID.

Implemented in RLinkedStorage, and RMemoryStorage.

virtual void RStorage::deleteTransactionsFrom ( int  transactionId)
pure 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.

Implemented in RMemoryStorage.

virtual void RStorage::deselectEntities ( const QSet< REntity::Id > &  entityIds,
QSet< REntity::Id > *  affectedEntities = NULL 
)
pure 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.

Implemented in RMemoryStorage.

virtual void RStorage::deselectEntity ( REntity::Id  entityId,
QSet< REntity::Id > *  affectedEntities = NULL 
)
pure 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.

Implemented in RMemoryStorage.

void RStorage::endDocumentVariablesTransaction ( RTransaction transaction,
bool  useLocalTransaction,
QSharedPointer< RDocumentVariables docVars 
)
virtual RBlock::Id RStorage::getBlockId ( const QString &  blockName) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QString RStorage::getBlockName ( RBlock::Id  blockId) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QSet<QString> RStorage::getBlockNames ( ) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual RBox RStorage::getBoundingBox ( bool  ignoreHiddenLayers = true,
bool  ignoreEmpty = false 
) const
pure virtual
Returns:
The bounding box around all visible entities.

Implemented in RMemoryStorage.

virtual RBlock::Id RStorage::getCurrentBlockId ( ) const
inlinevirtual

Reimplemented in RLinkedStorage.

RColor RStorage::getCurrentColor ( ) const
virtual
RLayer::Id RStorage::getCurrentLayerId ( ) const
virtual
RLinetype::Id RStorage::getCurrentLinetypeId ( ) const
virtual

Reimplemented in RLinkedStorage.

RLinetypePattern RStorage::getCurrentLinetypePattern ( ) const
virtual
RLineweight::Lineweight RStorage::getCurrentLineweight ( ) const
virtual

Reimplemented in RLinkedStorage.

virtual RView::Id RStorage::getCurrentViewId ( ) const
inlinevirtual
QString RStorage::getDimensionFont ( ) const
virtual

Reimplemented in RLinkedStorage.

RDocument* RStorage::getDocument ( ) const
inline
virtual QVariant RStorage::getKnownVariable ( RS::KnownVariable  key) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

QString RStorage::getKnownVariableName ( RS::KnownVariable  n)
static
Returns:
Name of the given known variable enum. Used for debugging.
virtual int RStorage::getLastTransactionId ( )
inlinevirtual
Returns:
The ID of the last completed transaction. The default implementation reads variable "LastTransaction".
virtual RLayer::Id RStorage::getLayerId ( const QString &  layerName) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QString RStorage::getLayerName ( RLayer::Id  layerId) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QSet<QString> RStorage::getLayerNames ( ) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QString RStorage::getLinetypeDescription ( RLinetype::Id  linetypeId) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual RLinetype::Id RStorage::getLinetypeId ( const QString &  linetypeName) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QString RStorage::getLinetypeLabel ( RLinetype::Id  linetypeId) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QString RStorage::getLinetypeName ( RLinetype::Id  linetypeId) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QSet<QString> RStorage::getLinetypeNames ( ) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QList<RLinetypePattern> RStorage::getLinetypePatterns ( ) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

double RStorage::getLinetypeScale ( ) const
virtual
virtual int RStorage::getMaxDrawOrder ( )
inlinevirtual
virtual RLineweight::Lineweight RStorage::getMaxLineweight ( ) const
pure virtual

Implemented in RMemoryStorage.

RObject::Handle RStorage::getMaxObjectHandle ( )
virtual
RObject::Id RStorage::getMaxObjectId ( )
virtual
virtual int RStorage::getMaxTransactionId ( )
pure virtual
Returns:
The highest transaction ID that is in use. This should be used by deleteTransactionsFrom internally.

Implemented in RMemoryStorage.

int RStorage::getMinDrawOrder ( )
virtual
RObject::Handle RStorage::getNewObjectHandle ( )
virtual

Reimplemented in RLinkedStorage.

RObject::Id RStorage::getNewObjectId ( )
virtual

Reimplemented in RLinkedStorage.

virtual RBox RStorage::getSelectionBox ( ) const
pure virtual

Implemented in RMemoryStorage.

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

Implemented in RMemoryStorage.

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

Implemented in RMemoryStorage.

virtual QStringList RStorage::getVariables ( ) const
pure virtual

Implemented in RMemoryStorage.

virtual RView::Id RStorage::getViewId ( const QString &  viewName) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QString RStorage::getViewName ( RView::Id  viewId) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QSet<QString> RStorage::getViewNames ( ) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

bool RStorage::hasBlock ( const QString &  blockName) const
virtual
virtual bool RStorage::hasChildEntities ( REntity::Id  parentId)
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

bool RStorage::hasLayer ( const QString &  layerName) const
virtual
bool RStorage::hasLinetype ( const QString &  linetypeName) const
virtual
virtual bool RStorage::hasSelection ( ) const
pure virtual
Returns:
True if at least one entity is selected in this storage.

Implemented in RMemoryStorage.

virtual bool RStorage::hasVariable ( const QString &  key) const
inlinevirtual
Returns:
True if the given variable exists in this storage.
bool RStorage::hasView ( const QString &  viewName) const
virtual
virtual bool RStorage::isBlockFrozen ( RBlock::Id  blockId) const
inlinevirtual
virtual bool RStorage::isEntity ( RObject::Id  objectId)
inlinevirtual
virtual bool RStorage::isInBackStorage ( RObject::Id  )
inlinevirtual

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

Reimplemented in RLinkedStorage.

virtual bool RStorage::isLayerFrozen ( RLayer::Id  layerId) const
inlinevirtual
virtual bool RStorage::isLayerLocked ( RLayer::Id  layerId) const
inlinevirtual
bool RStorage::isModified ( ) const
inline
virtual bool RStorage::isSelected ( REntity::Id  entityId)
inlinevirtual

Reimplemented in RMemoryStorage.

QList< REntity::Id > RStorage::orderBackToFront ( const QSet< REntity::Id > &  entityIds) const
virtual
Returns:
Ordered list of given IDs for display purposes.
virtual QSet<REntity::Id> RStorage::queryAllBlockReferences ( )
pure virtual
Returns:
A set of all block reference entity IDs.

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QSet<REntity::Id> RStorage::queryAllEntities ( bool  undone = false,
bool  allBlocks = false,
RS::EntityType  type = RS::EntityAll 
)
pure virtual
Returns:
A set of all entity IDs of the document.

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RLinkedStorage, and RMemoryStorage.

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

Implemented in RLinkedStorage, and RMemoryStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QSet<REntity::Id> RStorage::queryChildEntities ( REntity::Id  parentId,
RS::EntityType  type = RS::EntityAll 
)
pure 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.

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QSharedPointer<RBlock> RStorage::queryCurrentBlock ( )
inlinevirtual
virtual QSharedPointer<RLayer> RStorage::queryCurrentLayer ( )
inlinevirtual
virtual QSharedPointer<RLinetype> RStorage::queryCurrentLinetype ( ) const
inlinevirtual
virtual QSharedPointer<RView> RStorage::queryCurrentView ( )
inlinevirtual
virtual QSharedPointer<RDocumentVariables> RStorage::queryDocumentVariables ( ) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QSharedPointer<RDocumentVariables> RStorage::queryDocumentVariablesDirect ( ) const
pure virtual

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

virtual QSharedPointer<REntity> RStorage::queryEntityDirect ( REntity::Id  entityId) const
inlinevirtual

Reimplemented in RMemoryStorage, and RLinkedStorage.

virtual QSet<REntity::Id> RStorage::queryInfiniteEntities ( )
pure virtual
Returns:
A set of entity IDs of all infinite entities (xlines).

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Reimplemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RLinkedStorage, and RMemoryStorage.

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

Implemented in RLinkedStorage, and RMemoryStorage.

virtual QSharedPointer<RLinetype> RStorage::queryLinetypeDirect ( RLinetype::Id  linetypeId) const
pure virtual

Implemented in RLinkedStorage, and RMemoryStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Reimplemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RLinkedStorage, and RMemoryStorage.

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

Implemented in RLinkedStorage, and RMemoryStorage.

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

Reimplemented in RMemoryStorage, and RLinkedStorage.

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

Implemented in RLinkedStorage, and RMemoryStorage.

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

Implemented in RLinkedStorage, and RMemoryStorage.

virtual bool RStorage::removeObject ( QSharedPointer< RObject object)
pure virtual

Implemented in RMemoryStorage.

virtual void RStorage::resetTransactionStack ( )
pure virtual

Implemented in RMemoryStorage.

virtual void RStorage::rollbackTransaction ( )
pure virtual

Rolls the current transaction back in order to cancel it.

This function should never be called under normal circumstances.

Implemented in RMemoryStorage.

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

Saves the given object to the storage.

Implemented in RMemoryStorage.

virtual void RStorage::saveTransaction ( RTransaction transaction)
pure virtual

Saves the given transaction.

Transactions need to be stored for undo / redo functionality.

Implemented in RMemoryStorage.

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

Sets the selection status of all entities.

Implemented in RMemoryStorage.

virtual void RStorage::selectEntities ( const QSet< REntity::Id > &  entityIds,
bool  add = false,
QSet< REntity::Id > *  affectedEntities = NULL 
)
pure 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.

Implemented in RMemoryStorage.

virtual void RStorage::selectEntity ( REntity::Id  entityId,
bool  add = false,
QSet< REntity::Id > *  affectedEntities = NULL 
)
pure 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.

Implemented in RMemoryStorage.

virtual void RStorage::setCurrentBlock ( RBlock::Id  blockId)
inlinevirtual

Reimplemented in RMemoryStorage.

void RStorage::setCurrentBlock ( const QString &  blockName)
inline
void RStorage::setCurrentColor ( const RColor color)
virtual
void RStorage::setCurrentLayer ( RLayer::Id  layerId,
RTransaction transaction = NULL 
)
void RStorage::setCurrentLayer ( const QString &  layerName,
RTransaction transaction = NULL 
)
void RStorage::setCurrentLinetype ( RLinetype::Id  ltId)
void RStorage::setCurrentLinetype ( const QString &  name)
void RStorage::setCurrentLinetypePattern ( const RLinetypePattern p)
void RStorage::setCurrentLineweight ( RLineweight::Lineweight  lw)
void RStorage::setCurrentView ( RView::Id  viewId)
inline
void RStorage::setCurrentView ( const QString &  viewName)
inline
void RStorage::setDimensionFont ( const QString &  f,
RTransaction transaction = NULL 
)
virtual
void RStorage::setDocument ( RDocument doc)
inline
virtual void RStorage::setKnownVariable ( RS::KnownVariable  key,
const QVariant &  value,
RTransaction transaction = NULL 
)
pure virtual

Implemented in RMemoryStorage.

virtual void RStorage::setLastTransactionId ( int  transactionId)
inlinevirtual

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 in RMemoryStorage.

void RStorage::setLinetypeScale ( double  v,
RTransaction transaction = NULL 
)
virtual
virtual void RStorage::setMaxDrawOrder ( int  m)
inlinevirtual
void RStorage::setModified ( bool  m)
void RStorage::setObjectHandle ( RObject object,
RObject::Handle  objectHandle 
)
void RStorage::setObjectId ( RObject object,
RObject::Id  objectId 
)
virtual bool RStorage::setUndoStatus ( RObject::Id  object,
bool  status 
)
pure virtual

Implemented in RLinkedStorage, and RMemoryStorage.

void RStorage::setUnit ( RS::Unit  unit,
RTransaction transaction = NULL 
)
virtual void RStorage::setVariable ( const QString &  key,
const QVariant &  value,
bool  overwrite = true 
)
pure virtual

Implemented in RMemoryStorage.

QSharedPointer< RDocumentVariables > RStorage::startDocumentVariablesTransaction ( RTransaction *&  transaction,
bool &  useLocalTransaction 
)
virtual void RStorage::toggleUndoStatus ( QSet< RObject::Id > &  objects)
pure 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.

Implemented in RMemoryStorage.

virtual void RStorage::toggleUndoStatus ( RObject::Id  object)
pure virtual

Toggles the current undo status of the given object.

Implemented in RMemoryStorage.

virtual void RStorage::update ( )
inlinevirtual

Clear caches:

Reimplemented in RMemoryStorage.


Friends And Related Function Documentation

QDebug operator<< ( QDebug  dbg,
RStorage s 
)
friend

Stream operator for QDebug.

   \par Non-Scriptable:

This function is not available in script environments.


Member Data Documentation

RBlock::Id RStorage::currentBlockId
private
RColor RStorage::currentColor
private
RLinetype::Id RStorage::currentLinetypeId
private
RLineweight::Lineweight RStorage::currentLineweight
private
RView::Id RStorage::currentViewId
private
RDocument* RStorage::document
private
RObject::Handle RStorage::handleCounter
private
RObject::Id RStorage::idCounter
private
int RStorage::lastTransactionId
private
int RStorage::maxDrawOrder
private
bool RStorage::modified
protected
QList<RModifiedListener*> RStorage::modifiedListeners
private

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