QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RLinkedStorage.h
Go to the documentation of this file.
1 
20 #ifndef RLINKEDSTORAGE_H_
21 #define RLINKEDSTORAGE_H_
22 
23 #include "core_global.h"
24 
25 #include <QSharedPointer>
26 
27 #include "RMemoryStorage.h"
28 #include "RBlockReferenceEntity.h"
29 
40 public:
41  RLinkedStorage(RStorage& backStorage);
42  virtual ~RLinkedStorage();
43 
44  virtual void clear();
45 
46  virtual QSet<RObject::Id> queryAllObjects();
47  virtual QSet<REntity::Id> queryAllEntities(bool undone = false, bool allBlocks = false);
48  virtual QSet<RUcs::Id> queryAllUcs();
49  virtual QSet<RLayer::Id> queryAllLayers(bool undone = false);
50  virtual QSet<RBlock::Id> queryAllBlocks(bool undone = false);
51  virtual QSet<RView::Id> queryAllViews(bool undone = false);
52  virtual QSet<RLinetype::Id> queryAllLinetypes();
53  virtual QSet<REntity::Id> querySelectedEntities();
54 
55  virtual QSet<REntity::Id> queryLayerEntities(RLayer::Id layerId, bool allBlocks = false);
56  virtual QSet<REntity::Id> queryBlockEntities(RBlock::Id blockId);
57  virtual QSet<REntity::Id> queryChildEntities(REntity::Id parentId, RS::EntityType type = RS::EntityAll);
58  virtual bool hasChildEntities(REntity::Id parentId);
59  virtual QSet<REntity::Id> queryBlockReferences(RBlock::Id blockId);
60  virtual QSet<REntity::Id> queryAllBlockReferences();
61 
62  virtual QSharedPointer<RObject> queryObject(RObject::Id objectId) const;
63  virtual QSharedPointer<REntity> queryEntity(REntity::Id objectId) const;
64  virtual QSharedPointer<RObject> queryObjectByHandle(RObject::Handle objectHandle) const;
65  virtual QSharedPointer<RLayer> queryLayer(RLayer::Id layerId) const;
66  virtual QSharedPointer<RLayer> queryLayer(const QString& layerName) const;
67  virtual QSharedPointer<RBlock> queryBlock(RBlock::Id blockId) const;
68  virtual QSharedPointer<RBlock> queryBlock(const QString& blockName) const;
69  virtual QSharedPointer<RView> queryView(RView::Id viewId) const;
70  virtual QSharedPointer<RView> queryView(const QString& viewName) const;
71  virtual QSharedPointer<RUcs> queryUcs(RUcs::Id ucsId) const;
72  virtual QSharedPointer<RUcs> queryUcs(const QString& ucsName) const;
73  virtual QSharedPointer<RLinetype> queryLinetype(RLinetype::Id linetypeId) const;
74  virtual QSharedPointer<RLinetype> queryLinetype(const QString& linetypeName) const;
75 
76  virtual QString getLayerName(RLayer::Id layerId) const;
77  virtual QSet<QString> getLayerNames() const;
78  virtual RLayer::Id getLayerId(const QString& layerName) const;
79 
80  virtual QString getBlockName(RBlock::Id blockId) const;
81  virtual QSet<QString> getBlockNames() const;
82  virtual RBlock::Id getBlockId(const QString& blockName) const;
83 
84  virtual QString getViewName(RView::Id viewId) const;
85  virtual QSet<QString> getViewNames() const;
86  virtual RView::Id getViewId(const QString& viewName) const;
87 
88  virtual QString getLinetypeName(RLinetype::Id linetypeId) const;
89  virtual QSet<QString> getLinetypeNames() const;
90  virtual RLinetype::Id getLinetypeId(const QString& linetypeName) const;
91 
92  virtual QSharedPointer<RObject> queryObjectDirect(RObject::Id objectId) const;
93  virtual QSharedPointer<REntity> queryEntityDirect(REntity::Id objectId) const;
94  virtual QSharedPointer<RUcs> queryUcsDirect(RUcs::Id ucsId) const;
95  virtual QSharedPointer<RLayer> queryLayerDirect(RLayer::Id layerId) const;
96  virtual QSharedPointer<RBlock> queryBlockDirect(RBlock::Id blockId) const;
97 
98  virtual RObject::Id getNewObjectId();
100 
101  virtual RLayer::Id getCurrentLayerId();
102  virtual RBlock::Id getCurrentBlockId() const;
103  virtual RView::Id getCurrentViewId();
104  virtual RColor getCurrentColor();
106  virtual RLinetype getCurrentLinetype() const;
107 
108  virtual bool deleteObject(RObject::Id objectId);
109  virtual bool setUndoStatus(RObject::Id objectId, bool status);
110 
111  virtual bool isInBackStorage(RObject::Id object);
112 
114  return backStorage;
115  }
116 
117 private:
120 };
121 
123 
124 #endif /* RMEMORYSTOARGE_H_ */