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, RS::EntityType type = RS::EntityAll);
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> queryInfiniteEntities();
54  virtual QSet<REntity::Id> querySelectedEntities();
55 
56  virtual QSet<REntity::Id> queryLayerEntities(RLayer::Id layerId, bool allBlocks = false);
57  virtual QSet<REntity::Id> queryBlockEntities(RBlock::Id blockId);
58  virtual QSet<REntity::Id> queryChildEntities(REntity::Id parentId, RS::EntityType type = RS::EntityAll);
59  virtual bool hasChildEntities(REntity::Id parentId);
60  virtual QSet<REntity::Id> queryBlockReferences(RBlock::Id blockId);
61  virtual QSet<REntity::Id> queryAllBlockReferences();
62 
63  virtual QSharedPointer<RObject> queryObject(RObject::Id objectId) const;
64  virtual QSharedPointer<REntity> queryEntity(REntity::Id objectId) const;
65  virtual QSharedPointer<RObject> queryObjectByHandle(RObject::Handle objectHandle) const;
66  virtual QSharedPointer<RLayer> queryLayer(RLayer::Id layerId) const;
67  virtual QSharedPointer<RLayer> queryLayer(const QString& layerName) const;
68  virtual QSharedPointer<RBlock> queryBlock(RBlock::Id blockId) const;
69  virtual QSharedPointer<RBlock> queryBlock(const QString& blockName) const;
70  virtual QSharedPointer<RView> queryView(RView::Id viewId) const;
71  virtual QSharedPointer<RView> queryView(const QString& viewName) const;
72  virtual QSharedPointer<RUcs> queryUcs(RUcs::Id ucsId) const;
73  virtual QSharedPointer<RUcs> queryUcs(const QString& ucsName) const;
74  virtual QSharedPointer<RLinetype> queryLinetype(RLinetype::Id linetypeId) const;
75  virtual QSharedPointer<RLinetype> queryLinetype(const QString& linetypeName) const;
76 
77  virtual QString getLayerName(RLayer::Id layerId) const;
78  virtual QSet<QString> getLayerNames() const;
79  virtual RLayer::Id getLayerId(const QString& layerName) const;
80 
81  virtual QString getBlockName(RBlock::Id blockId) const;
82  virtual QSet<QString> getBlockNames() const;
83  virtual RBlock::Id getBlockId(const QString& blockName) const;
84 
85  virtual QString getViewName(RView::Id viewId) const;
86  virtual QSet<QString> getViewNames() const;
87  virtual RView::Id getViewId(const QString& viewName) const;
88 
89  virtual QString getLinetypeName(RLinetype::Id linetypeId) const;
90  virtual QSet<QString> getLinetypeNames() const;
91  virtual RLinetype::Id getLinetypeId(const QString& linetypeName) const;
92 
93  virtual QSharedPointer<RObject> queryObjectDirect(RObject::Id objectId) const;
94  virtual QSharedPointer<REntity> queryEntityDirect(REntity::Id objectId) const;
95  virtual QSharedPointer<RUcs> queryUcsDirect(RUcs::Id ucsId) const;
96  virtual QSharedPointer<RLayer> queryLayerDirect(RLayer::Id layerId) const;
97  virtual QSharedPointer<RBlock> queryBlockDirect(RBlock::Id blockId) const;
98 
99  virtual RObject::Id getNewObjectId();
101 
102  virtual RLayer::Id getCurrentLayerId();
103  virtual RBlock::Id getCurrentBlockId() const;
104  virtual RView::Id getCurrentViewId();
105  virtual RColor getCurrentColor();
107  virtual RLinetype getCurrentLinetype() const;
108 
109  virtual bool deleteObject(RObject::Id objectId);
110  virtual bool setUndoStatus(RObject::Id objectId, bool status);
111  virtual QString getDimensionFont() const;
112 
113  virtual QVariant getKnownVariable(RS::KnownVariable key) const;
114 
115  virtual bool isInBackStorage(RObject::Id object);
116 
118  return backStorage;
119  }
120 
121 private:
124 };
125 
127 
128 #endif /* RMEMORYSTOARGE_H_ */