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> queryObjectDirect(RObject::Id objectId) const;
64  virtual QSharedPointer<RObject> queryObject(RObject::Id objectId) const;
65  virtual QSharedPointer<RObject> queryObjectByHandle(RObject::Handle objectHandle) const;
66 
67  virtual QSharedPointer<REntity> queryEntityDirect(REntity::Id objectId) const;
68  virtual QSharedPointer<REntity> queryEntity(REntity::Id objectId) const;
69 
70  virtual QSharedPointer<RLayer> queryLayerDirect(RLayer::Id layerId) const;
71  virtual QSharedPointer<RLayer> queryLayer(RLayer::Id layerId) const;
72  virtual QSharedPointer<RLayer> queryLayer(const QString& layerName) const;
73 
74  virtual QSharedPointer<RBlock> queryBlockDirect(RBlock::Id blockId) const;
75  virtual QSharedPointer<RBlock> queryBlock(RBlock::Id blockId) const;
76  virtual QSharedPointer<RBlock> queryBlock(const QString& blockName) const;
77 
78  virtual QSharedPointer<RView> queryView(RView::Id viewId) const;
79  virtual QSharedPointer<RView> queryView(const QString& viewName) const;
80 
81  virtual QSharedPointer<RUcs> queryUcsDirect(RUcs::Id ucsId) const;
82  virtual QSharedPointer<RUcs> queryUcs(RUcs::Id ucsId) const;
83  virtual QSharedPointer<RUcs> queryUcs(const QString& ucsName) const;
84 
85  virtual QSharedPointer<RLinetype> queryLinetypeDirect(RLinetype::Id linetypeId) const;
86  virtual QSharedPointer<RLinetype> queryLinetype(RLinetype::Id linetypeId) const;
87  virtual QSharedPointer<RLinetype> queryLinetype(const QString& linetypeName) const;
88 
89  virtual QString getLayerName(RLayer::Id layerId) const;
90  virtual QSet<QString> getLayerNames() const;
91  virtual RLayer::Id getLayerId(const QString& layerName) const;
92 
93  virtual QString getBlockName(RBlock::Id blockId) const;
94  virtual QSet<QString> getBlockNames() const;
95  virtual RBlock::Id getBlockId(const QString& blockName) const;
96 
97  virtual QString getViewName(RView::Id viewId) const;
98  virtual QSet<QString> getViewNames() const;
99  virtual RView::Id getViewId(const QString& viewName) const;
100 
101  virtual QString getLinetypeName(RLinetype::Id linetypeId) const;
102  virtual QString getLinetypeDescription(RLinetype::Id linetypeId) const;
103  virtual QString getLinetypeLabel(RLinetype::Id linetypeId) const;
104  virtual QSet<QString> getLinetypeNames() const;
105  virtual QList<RLinetypePattern> getLinetypePatterns() const;
106  virtual RLinetype::Id getLinetypeId(const QString& linetypeName) const;
107 
108 
109  virtual RObject::Id getNewObjectId();
111 
112  virtual RLayer::Id getCurrentLayerId();
113  virtual RBlock::Id getCurrentBlockId() const;
114  virtual RView::Id getCurrentViewId();
115  virtual RColor getCurrentColor();
117  virtual RLinetype::Id getCurrentLinetypeId() const;
118 
119  virtual bool deleteObject(RObject::Id objectId);
120  virtual bool setUndoStatus(RObject::Id objectId, bool status);
121  virtual QString getDimensionFont() const;
122 
123  virtual QVariant getKnownVariable(RS::KnownVariable key) const;
124 
125  virtual bool isInBackStorage(RObject::Id object);
126 
128  return backStorage;
129  }
130 
131 private:
134 };
135 
137 
138 #endif /* RMEMORYSTOARGE_H_ */