QCAD
Open Source 2D CAD
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() const;
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() const;
117  virtual RBlock::Id getCurrentBlockId() const;
118  virtual RView::Id getCurrentViewId() const;
119  virtual RColor getCurrentColor() const;
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_ */
virtual QSet< QString > getViewNames() const
Definition: RMemoryStorage.cpp:546
virtual QSet< QString > getBlockNames() const
Definition: RMemoryStorage.cpp:526
virtual QSet< RBlock::Id > queryAllBlocks(bool undone=false)
Definition: RMemoryStorage.cpp:199
int Handle
Definition: RObject.h:55
virtual RLineweight::Lineweight getCurrentLineweight() const
Definition: RStorage.cpp:150
virtual QSharedPointer< RUcs > queryUcs(RUcs::Id ucsId) const
Definition: RMemoryStorage.cpp:589
virtual QSharedPointer< REntity > queryEntityDirect(REntity::Id objectId) const
Definition: RMemoryStorage.cpp:446
virtual QSet< REntity::Id > queryAllBlockReferences()
Definition: RMemoryStorage.cpp:343
virtual QSharedPointer< RObject > queryObjectByHandle(RObject::Handle objectHandle) const
Definition: RMemoryStorage.cpp:401
virtual QSet< RLinetype::Id > queryAllLinetypes()
Definition: RMemoryStorage.cpp:223
virtual bool hasChildEntities(REntity::Id parentId)
Definition: RMemoryStorage.cpp:317
virtual QSharedPointer< RUcs > queryUcsDirect(RUcs::Id ucsId) const
Definition: RMemoryStorage.cpp:582
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:75
RStorage * getBackStorage() const
Definition: RLinkedStorage.h:131
virtual QSet< QString > getLayerNames() const
Definition: RMemoryStorage.cpp:1254
#define QCADCORE_EXPORT
Definition: core_global.h:10
virtual QSet< REntity::Id > queryBlockReferences(RBlock::Id blockId)
Definition: RMemoryStorage.cpp:331
virtual QSet< REntity::Id > queryInfiniteEntities()
Definition: RMemoryStorage.cpp:235
virtual QSet< QString > getLinetypeNames() const
Definition: RMemoryStorage.cpp:1314
int Id
Definition: RObject.h:53
virtual RView::Id getViewId(const QString &viewName) const
Definition: RMemoryStorage.cpp:1282
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RStorage.h:55
virtual QString getLinetypeName(RLinetype::Id linetypeId) const
Definition: RMemoryStorage.cpp:1290
int objectIdOffset
Definition: RLinkedStorage.h:137
virtual QSet< REntity::Id > queryLayerEntities(RLayer::Id layerId, bool allBlocks=false)
Definition: RMemoryStorage.cpp:265
virtual QSet< RObject::Id > queryAllObjects()
Definition: RMemoryStorage.cpp:126
virtual QSharedPointer< RObject > queryObject(RObject::Id objectId) const
Definition: RMemoryStorage.cpp:384
virtual QSet< REntity::Id > queryChildEntities(REntity::Id parentId, RS::EntityType type=RS::EntityAll)
Definition: RMemoryStorage.cpp:296
virtual RBlock::Id getCurrentBlockId() const
Definition: RStorage.h:294
virtual RView::Id getCurrentViewId() const
Definition: RStorage.h:257
virtual QSharedPointer< RLinetype > queryLinetype(RLinetype::Id linetypeId) const
Definition: RMemoryStorage.cpp:618
Lineweight
Definition: RLineweight.h:42
virtual QSet< RLayer::Id > queryAllLayers(bool undone=false)
Definition: RMemoryStorage.cpp:187
virtual RLayer::Id getCurrentLayerId() const
Definition: RStorage.cpp:130
Color.
Definition: RColor.h:42
virtual bool isInBackStorage(RObject::Id)
Linked storages should return true if the given object is stored in the storage the linked storage li...
Definition: RStorage.h:610
virtual QVariant getKnownVariable(RS::KnownVariable key) const
Definition: RMemoryStorage.cpp:1238
virtual QSharedPointer< RView > queryView(RView::Id viewId) const
Definition: RMemoryStorage.cpp:558
virtual RLinetype::Id getCurrentLinetypeId() const
Definition: RStorage.cpp:174
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RMemoryStorage.h:37
virtual QString getBlockName(RBlock::Id blockId) const
Definition: RMemoryStorage.cpp:518
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RLinkedStorage.h:39
virtual QSharedPointer< RLinetype > queryLinetypeDirect(RLinetype::Id linetypeId) const
Definition: RMemoryStorage.cpp:611
Q_DECLARE_METATYPE(RMath *)
virtual QSharedPointer< RLayer > queryLayerDirect(RLayer::Id layerId) const
Definition: RMemoryStorage.cpp:453
virtual QSet< REntity::Id > queryAllEntities(bool undone=false, bool allBlocks=false, RS::EntityType type=RS::EntityAll)
Definition: RMemoryStorage.cpp:138
virtual RObject::Id getNewObjectId()
Definition: RStorage.cpp:65
virtual RColor getCurrentColor() const
Definition: RStorage.cpp:142
virtual QString getViewName(RView::Id viewId) const
Definition: RMemoryStorage.cpp:538
virtual bool deleteObject(RObject::Id objectId)
Deletes the object with the given ID.
Definition: RMemoryStorage.cpp:1047
virtual QSharedPointer< RObject > queryObjectDirect(RObject::Id objectId) const
Definition: RMemoryStorage.cpp:394
virtual QSharedPointer< RDocumentVariables > queryDocumentVariablesDirect() const
Definition: RMemoryStorage.cpp:377
virtual QSharedPointer< RLayer > queryLayer(RLayer::Id layerId) const
Definition: RMemoryStorage.cpp:460
KnownVariable
Well established document variables.
Definition: RS.h:282
virtual QSet< REntity::Id > queryBlockEntities(RBlock::Id blockId)
Definition: RMemoryStorage.cpp:279
virtual RObject::Handle getNewObjectHandle()
Definition: RStorage.cpp:73
virtual QString getLinetypeLabel(RLinetype::Id linetypeId) const
Definition: RMemoryStorage.cpp:1306
All entities (for filters)
Definition: RS.h:76
RStorage * backStorage
Definition: RLinkedStorage.h:136
virtual QSharedPointer< RBlock > queryBlockDirect(RBlock::Id blockId) const
Definition: RMemoryStorage.cpp:500
virtual QString getLinetypeDescription(RLinetype::Id linetypeId) const
Definition: RMemoryStorage.cpp:1298
virtual RLinetype::Id getLinetypeId(const QString &linetypeName) const
Definition: RMemoryStorage.cpp:1338
virtual QSharedPointer< REntity > queryEntity(REntity::Id objectId) const
Definition: RMemoryStorage.cpp:436
virtual QSharedPointer< RBlock > queryBlock(RBlock::Id blockId) const
Definition: RMemoryStorage.cpp:487
virtual QSet< RView::Id > queryAllViews(bool undone=false)
Definition: RMemoryStorage.cpp:211
virtual QSharedPointer< RDocumentVariables > queryDocumentVariables() const
Definition: RMemoryStorage.cpp:369
virtual QList< RLinetypePattern > getLinetypePatterns() const
Definition: RMemoryStorage.cpp:1326
virtual QString getLayerName(RLayer::Id layerId) const
Definition: RMemoryStorage.cpp:1246
virtual bool setUndoStatus(RObject::Id objectId, bool status)
Definition: RMemoryStorage.cpp:1162
virtual QString getDimensionFont() const
Definition: RStorage.cpp:284
virtual QSet< RUcs::Id > queryAllUcs()
Definition: RMemoryStorage.cpp:175
virtual QSet< REntity::Id > querySelectedEntities() const
Definition: RMemoryStorage.cpp:251
virtual RLayer::Id getLayerId(const QString &layerName) const
Definition: RMemoryStorage.cpp:1266
virtual void clear()
Resets this storage to its initial, empty state.
Definition: RMemoryStorage.cpp:38
virtual RBlock::Id getBlockId(const QString &blockName) const
Definition: RMemoryStorage.cpp:1274