83 void init(
bool beforeLoad=
false);
85 QList<QSharedPointer<RObject> > getDefaultLinetypes();
95 void clear(
bool beforeLoad=
false);
102 bool includeLockedLayers =
true,
103 bool selectedOnly =
false
105 QPair<RObject::Id, QSet<int> > queryClosestXYWithIndices(
110 bool includeLockedLayers =
true,
111 bool selectedOnly =
false
115 QSet<RObject::Id>& candidates,
121 QPair<RObject::Id, QSet<int> > queryClosestXYWithIndices(
128 QSet<RObject::Id> queryAllObjects()
const;
129 QSet<RObject::Id> querySelectedLayers()
const;
130 QSet<RObject::Id> queryAllVisibleEntities()
const;
132 QSet<RObject::Id> queryAllEntities(
bool undone,
bool allBlocks, QList<RS::EntityType> types)
const;
133 QSet<RObject::Id> queryWorkingSetEntities()
const;
134 QSet<RObject::Id> queryAllUcs()
const;
135 QSet<RObject::Id> queryAllLayers()
const;
136 QSet<RObject::Id> queryAllLayerStates()
const;
137 QSet<RObject::Id> queryAllBlocks()
const;
138 QSet<RObject::Id> queryAllLayoutBlocks(
bool includeModelSpace =
false)
const;
139 QSet<RObject::Id> queryAllLayouts()
const;
140 QSet<RObject::Id> queryAllViews()
const;
141 QSet<RObject::Id> queryAllLinetypes()
const;
143 QSet<RObject::Id> queryLayerEntities(
RObject::Id layerId,
bool allBlocks =
false)
const;
144 QSet<RObject::Id> querySelectedLayerEntities(
RObject::Id layerId,
bool allBlocks =
false)
const;
146 QSet<RObject::Id> queryBlockEntities(
RObject::Id blockId)
const;
150 QSet<RObject::Id> queryBlockReferences(
RObject::Id blockId)
const;
151 QSet<RObject::Id> queryAllBlockReferences()
const;
152 QSet<RObject::Id> queryAllViewports()
const;
154 QSet<RObject::Id> queryContainedEntities(
const RBox& box)
const;
156 QSet<RObject::Id> queryInfiniteEntities()
const;
158 QSet<RObject::Id> queryIntersectedEntitiesXYFast(
const RBox& box);
159 QSet<RObject::Id> queryIntersectedShapesXYFast(
const RBox& box,
bool noInfiniteEntities =
false);
161 QSet<RObject::Id> queryIntersectedEntitiesXY(
const RBox& box,
162 bool checkBoundingBoxOnly=
false,
163 bool includeLockedLayers=
true,
166 bool selectedOnly =
false,
170 bool checkBoundingBoxOnly=
false,
171 bool includeLockedLayers=
true,
174 bool selectedOnly =
false,
178 bool checkBoundingBoxOnly=
false,
179 bool includeLockedLayers=
true,
182 bool selectedOnly =
false,
185 QSet<RObject::Id> queryContainedEntitiesXY(
const RBox& box)
const;
187 QSet<RObject::Id> querySelectedEntities()
const;
191 QSet<RObject::Id> queryPropertyEditorObjects();
193 QSharedPointer<RDocumentVariables> queryDocumentVariables()
const;
194 QSharedPointer<RDocumentVariables> queryDocumentVariablesDirect()
const;
195 QSharedPointer<RDimStyle> queryDimStyle()
const;
196 QSharedPointer<RDimStyle> queryDimStyleDirect()
const;
197 QSharedPointer<RObject> queryObject(
RObject::Id objectId)
const;
198 QSharedPointer<RObject> queryObjectDirect(
RObject::Id objectId)
const;
200 QSharedPointer<RObject> queryObjectByHandle(
RObject::Handle objectHandle)
const;
201 QSharedPointer<REntity> queryEntity(
RObject::Id entityId)
const;
202 QSharedPointer<REntity> queryEntityDirect(
RObject::Id entityId)
const;
203 QSharedPointer<REntity> queryVisibleEntityDirect(
RObject::Id entityId)
const;
204 QSharedPointer<RUcs> queryUcs(
RObject::Id ucsId)
const;
205 QSharedPointer<RUcs> queryUcs(
const QString& ucsName)
const;
206 QSharedPointer<RLayer> queryLayer(
RObject::Id layerId)
const;
207 QSharedPointer<RLayer> queryLayerDirect(
RObject::Id layerId)
const;
208 QSharedPointer<RLayer> queryLayer(
const QString& layerName)
const;
209 QSharedPointer<RLayerState> queryLayerState(
RObject::Id layerStateId)
const;
210 QSharedPointer<RLayerState> queryLayerStateDirect(
RObject::Id layerStateId)
const;
211 QSharedPointer<RLayerState> queryLayerState(
const QString& layerStateName)
const;
212 QSharedPointer<RLayout> queryLayout(
RObject::Id layoutId)
const;
213 QSharedPointer<RLayout> queryLayoutDirect(
RObject::Id layoutId)
const;
214 QSharedPointer<RLayout> queryLayout(
const QString& layoutName)
const;
215 QSharedPointer<RBlock> queryBlock(
RObject::Id blockId)
const;
216 QSharedPointer<RBlock> queryBlockDirect(
RObject::Id blockId)
const;
217 QSharedPointer<RBlock> queryBlockDirect(
const QString& blockName)
const;
218 QSharedPointer<RBlock> queryBlock(
const QString& blockName)
const;
219 QSharedPointer<RView> queryView(
RObject::Id viewId)
const;
220 QSharedPointer<RView> queryView(
const QString& viewName)
const;
221 QSharedPointer<RLinetype> queryLinetype(
RObject::Id linetypeId)
const;
222 QSharedPointer<RLinetype> queryLinetype(
const QString& linetypeName)
const;
224 int countSelectedEntities()
const;
227 QSet<RObject::Id>* affectedEntities=
NULL
230 void selectAllEntities(QSet<RObject::Id>* affectedEntities =
NULL);
235 QSet<RObject::Id>* affectedEntities=
NULL
239 QSet<RObject::Id>* affectedEntities=
NULL
242 const QSet<RObject::Id>& entityId,
244 QSet<RObject::Id>* affectedEntities=
NULL
246 int deselectEntities(
247 const QSet<RObject::Id>& entityId,
248 QSet<RObject::Id>* affectedEntities=
NULL
253 bool isLayerLocked(
const RLayer& layer)
const;
254 bool isParentLayerLocked(
RObject::Id layerId)
const;
255 bool isParentLayerLocked(
const RLayer& layer)
const;
262 bool isLayerOff(
const RLayer& layer)
const;
264 bool isLayerOffOrFrozen(
RObject::Id layerId)
const;
265 bool isLayerOffOrFrozen(
const RLayer& layer)
const;
268 bool isLayerFrozen(
const RLayer& layer)
const;
270 bool isLayerPlottable(
const RLayer& layer)
const;
272 bool isLayerSnappable(
const RLayer& layer)
const;
273 bool isParentLayerFrozen(
RObject::Id layerId)
const;
274 bool isParentLayerFrozen(
const RLayer& layer)
const;
277 bool isEntityLayerFrozen(
RObject::Id entityId)
const;
281 bool isParentLayerSnappable(
RObject::Id layerId)
const;
282 bool isParentLayerSnappable(
const RLayer& layer)
const;
284 bool isParentLayerPlottable(
RObject::Id layerId)
const;
285 bool isParentLayerPlottable(
const RLayer& layer)
const;
287 bool hasSelection()
const;
289 RBox getBoundingBox(
bool ignoreHiddenLayers =
true,
bool ignoreEmpty =
false)
const;
290 RBox getSelectionBox()
const;
291 RBox getEntitiesBox(QSet<RObject::Id>& ids)
const;
294 void clearSpatialIndices();
295 virtual void rebuildSpatialIndex();
297 void addToSpatialIndex(QSharedPointer<REntity> entity);
301 void removeBlockFromSpatialIndex(
RObject::Id blockId);
303 virtual void removeFromSpatialIndex(QSharedPointer<REntity> entity,
const QList<RBox>& boundingBoxes);
304 void removeFromSpatialIndex(QSharedPointer<REntity> entity);
306 void updateAllEntities();
308 QList<RTransaction> undo();
309 QList<RTransaction> redo();
310 bool isUndoAvailable()
const;
311 bool isRedoAvailable()
const;
313 void startTransactionGroup();
314 int getTransactionGroup()
const;
320 autoTransactionGroup = on;
323 return autoTransactionGroup;
326 void resetTransactionStack();
328 void setFileName(
const QString& fn);
329 QString getFileName()
const;
331 void setFileVersion(
const QString& fv);
332 QString getFileVersion()
const;
334 QSharedPointer<RLayer> queryCurrentLayer();
342 QString getCurrentLayerName()
const;
345 RColor getCurrentColor()
const;
351 void setCurrentLinetype(
const QString& name);
356 QSharedPointer<RBlock> queryCurrentBlock();
358 void setCurrentBlock(
const QString& blockName);
360 QString getCurrentBlockName()
const;
364 bool hasCurrentViewport();
365 void unsetCurrentViewport();
371 QSharedPointer<RView> queryCurrentView();
373 void setCurrentView(
const QString& viewName);
376 QString getTempBlockName()
const;
377 QString getUniqueBlockName(
const QString& currentName,
const QStringList& usedBlockNames =
RDEFAULT_QSTRINGLIST)
const;
380 QString getBlockNameFromLayout(
const QString& layoutName)
const;
381 QString getBlockNameFromLayout(
RObject::Id layoutId)
const;
382 QSet<QString> getBlockNames(
const QString& rxStr =
RDEFAULT_QSTRING,
bool undone =
false)
const;
383 QList<RObject::Id> sortBlocks(
const QList<RObject::Id>& blockIds)
const;
384 QList<RObject::Id> sortLayers(
const QList<RObject::Id>& layerIds)
const;
387 QString getLayerStateName(
RObject::Id layerStateId)
const;
388 QSet<QString> getLayerStateNames(
const QString& rxStr =
RDEFAULT_QSTRING)
const;
390 QSet<QString> getViewNames()
const;
392 bool hasLayer(
const QString& layerName)
const;
393 bool hasLayerStates()
const;
394 bool hasLayerState(
const QString& layerStateName)
const;
395 bool hasBlock(
const QString& blockName)
const;
396 bool hasLayout(
const QString& layoutName)
const;
397 bool hasView(
const QString& viewName)
const;
398 bool hasLinetype(
const QString& linetypeName)
const;
400 RObject::Id getLayerId(
const QString& layerName)
const;
403 RObject::Id getLayerStateId(
const QString& layerStateName)
const;
405 RObject::Id getBlockId(
const QString& blockName)
const;
406 RObject::Id getBlockIdAuto(
const QString& blockLayoutName)
const;
409 RObject::Id getLinetypeId(
const QString& linetypeName)
const;
411 return linetypeByLayerId;
414 return linetypeByBlockId;
416 QString getLinetypeName(
RObject::Id linetypeId)
const;
417 QString getLinetypeDescription(
RObject::Id linetypeId)
const;
418 QString getLinetypeLabel(
RObject::Id linetypeId)
const;
419 QSet<QString> getLinetypeNames()
const;
420 QList<RLinetypePattern> getLinetypePatterns()
const;
426 QStringList getVariables()
const;
427 void setVariable(
const QString& key,
const QVariant& value,
bool overwrite=
true);
428 QVariant getVariable(
const QString& key,
const QVariant& defaultValue =
RDEFAULT_QVARIANT,
bool useSettings =
false)
const;
429 bool hasVariable(
const QString& key)
const;
430 void removeVariable(
const QString& key);
442 bool isMetric()
const;
445 QString getDimensionFont()
const;
448 double getLinetypeScale()
const;
450 QString formatLinear(
double value);
451 QString formatAngle(
double value);
455 int getLinearPrecision();
456 bool showLeadingZeroes();
457 bool showTrailingZeroes();
458 bool showLeadingZeroesAngle();
459 bool showTrailingZeroesAngle();
461 int getAnglePrecision();
462 char getDecimalSeparator();
464 bool isModified()
const;
465 QDateTime getLastModifiedDateTime()
const;
466 QString getLastModified()
const;
467 void setModified(
bool m);
469 void copyVariablesFrom(
const RDocument& other);
471 QString addAutoVariable(
double value);
472 QStringList getAutoVariables()
const;
473 QString substituteAutoVariables(
const QString& expression);
474 double eval(
const QString& expression,
bool* ok =
NULL);
476 bool isEditingWorkingSet()
const;
477 void setIgnoreWorkingSet(
bool on);
479 void setNotifyListeners(
bool on);
480 bool getNotifyListeners()
const;