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