QCAD
Open Source 2D CAD
|
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc. More...
#include <RDocument.h>
Public Member Functions | |
QString | addAutoVariable (double value) |
bool | addBlockToSpatialIndex (RBlock::Id blockId, RObject::Id ignoreBlockId) |
Add block references that point to blockId, unless they also point to ignoreBlockId. More... | |
void | addToSpatialIndex (QSharedPointer< REntity > entity) |
bool | blockContainsReferences (RBlock::Id blockId, RBlock::Id referencedBlockId) |
void | clear (bool beforeLoad=false) |
Resets this document to its initial, empty state. More... | |
void | clearSelection (QSet< REntity::Id > *affectedEntities=NULL) |
void | clearSpatialIndices () |
void | copyVariablesFrom (const RDocument &other) |
int | countSelectedEntities () const |
int | deselectEntities (const QSet< REntity::Id > &entityId, QSet< REntity::Id > *affectedEntities=NULL) |
Deselects all entities with the given IDs. More... | |
void | deselectEntity (REntity::Id entityId, QSet< REntity::Id > *affectedEntities=NULL) |
Deselects the entity with the given ID. More... | |
void | dump () |
double | eval (const QString &expression, bool *ok=NULL) |
QString | formatAngle (double value) |
QString | formatLinear (double value) |
RS::AngleFormat | getAngleFormat () |
int | getAnglePrecision () |
bool | getAutoTransactionGroup () const |
QStringList | getAutoVariables () const |
RBlock::Id | getBlockId (const QString &blockName) const |
RBlock::Id | getBlockIdAuto (const QString &blockLayoutName) const |
QString | getBlockName (RBlock::Id blockId) const |
QString | getBlockNameFromLayout (const QString &layoutName) const |
QString | getBlockNameFromLayout (RLayout::Id layoutId) const |
QSet< QString > | getBlockNames (const QString &rxStr=RDEFAULT_QSTRING) const |
RBox | getBoundingBox (bool ignoreHiddenLayers=true, bool ignoreEmpty=false) const |
RBlock::Id | getCurrentBlockId () const |
QString | getCurrentBlockName () const |
RColor | getCurrentColor () const |
RLayer::Id | getCurrentLayerId () const |
QString | getCurrentLayerName () const |
RLinetype::Id | getCurrentLinetypeId () const |
RLinetypePattern | getCurrentLinetypePattern () const |
RLineweight::Lineweight | getCurrentLineweight () const |
RView::Id | getCurrentViewId () const |
RObject::Id | getCurrentViewportId () |
char | getDecimalSeparator () |
QList< QSharedPointer< RObject > > | getDefaultLinetypes () |
QString | getDimensionFont () const |
RBox | getEntitiesBox (QSet< REntity::Id > &ids) const |
QString | getFileName () const |
QString | getFileVersion () const |
QVariant | getKnownVariable (RS::KnownVariable key, const QVariant &defaultValue=RDEFAULT_QVARIANT) const |
QString | getLastModified () const |
QDateTime | getLastModifiedDateTime () const |
RLayer::Id | getLayer0Id () const |
RLayer::Id | getLayerId (const QString &layerName) const |
QString | getLayerName (RLayer::Id layerId) const |
QSet< QString > | getLayerNames (const QString &rxStr=RDEFAULT_QSTRING) const |
RLayerState::Id | getLayerStateId (const QString &layerStateName) const |
QString | getLayerStateName (RLayerState::Id layerStateId) const |
QSet< QString > | getLayerStateNames (const QString &rxStr=RDEFAULT_QSTRING) const |
QString | getLayoutName (RLayout::Id layoutId) const |
RS::LinearFormat | getLinearFormat () const |
int | getLinearPrecision () |
RLinetype::Id | getLinetypeByBlockId () const |
RLinetype::Id | getLinetypeByLayerId () const |
QString | getLinetypeDescription (RLinetype::Id linetypeId) const |
RLinetype::Id | getLinetypeId (const QString &linetypeName) const |
QString | getLinetypeLabel (RLinetype::Id linetypeId) const |
QString | getLinetypeName (RLinetype::Id linetypeId) const |
QSet< QString > | getLinetypeNames () const |
QList< RLinetypePattern > | getLinetypePatterns () const |
double | getLinetypeScale () const |
RLineweight::Lineweight | getMaxLineweight () const |
RS::Measurement | getMeasurement () const |
RBlock::Id | getModelSpaceBlockId () const |
RBox | getSelectionBox () const |
RSpatialIndex & | getSpatialIndex () |
const RSpatialIndex & | getSpatialIndex () const |
RSpatialIndex * | getSpatialIndexForBlock (RBlock::Id blockId) const |
RSpatialIndex * | getSpatialIndexForCurrentBlock () const |
RStorage & | getStorage () |
const RStorage & | getStorage () const |
QString | getTempBlockName () const |
int | getTransactionGroup () const |
RTransactionStack & | getTransactionStack () |
RS::Unit | getUnit () const |
QVariant | getVariable (const QString &key, const QVariant &defaultValue=RDEFAULT_QVARIANT, bool useSettings=false) const |
QStringList | getVariables () const |
QSet< QString > | getViewNames () const |
bool | hasBlock (const QString &blockName) const |
bool | hasBlockEntities (RBlock::Id blockId) const |
bool | hasChildEntities (REntity::Id parentId) const |
bool | hasCurrentViewport () |
bool | hasLayer (const QString &layerName) const |
bool | hasLayerState (const QString &layerStateName) const |
bool | hasLayerStates () const |
bool | hasLayout (const QString &layoutName) const |
bool | hasLinetype (const QString &linetypeName) const |
bool | hasSelection () const |
bool | hasVariable (const QString &key) const |
bool | hasView (const QString &viewName) const |
void | init (bool beforeLoad=false) |
void | initLinetypes (RTransaction *transaction=NULL) |
bool | isBlockFrozen (RBlock::Id blockId) const |
bool | isByBlock (RLinetype::Id linetypeId) const |
bool | isByLayer (RLinetype::Id linetypeId) const |
bool | isEditingWorkingSet () const |
bool | isEntityEditable (REntity::Id entityId) const |
bool | isEntityLayerFrozen (REntity::Id entityId) const |
bool | isEntityVisible (const REntity &entity, RBlock::Id blockId=RBlock::INVALID_ID) const |
bool | isLayerFrozen (const RLayer &layer) const |
bool | isLayerFrozen (RLayer::Id layerId) const |
bool | isLayerLocked (const RLayer &layer) const |
bool | isLayerLocked (RLayer::Id layerId) const |
bool | isLayerOff (const RLayer &layer) const |
bool | isLayerOff (RLayer::Id layerId) const |
bool | isLayerOffOrFrozen (const RLayer &layer) const |
bool | isLayerOffOrFrozen (RLayer::Id layerId) const |
bool | isLayerPlottable (const RLayer &layer) const |
bool | isLayerPlottable (RLayer::Id layerId) const |
bool | isLayerSnappable (const RLayer &layer) const |
bool | isLayerSnappable (RLayer::Id layerId) const |
bool | isLayoutBlock (RBlock::Id blockId) const |
bool | isMetric () const |
bool | isModified () const |
bool | isParentLayerFrozen (const RLayer &layer) const |
bool | isParentLayerFrozen (RLayer::Id layerId) const |
bool | isParentLayerLocked (const RLayer &layer) const |
bool | isParentLayerLocked (RLayer::Id layerId) const |
bool | isParentLayerPlottable (const RLayer &layer) const |
bool | isParentLayerPlottable (RLayer::Id layerId) const |
bool | isParentLayerSnappable (const RLayer &layer) const |
bool | isParentLayerSnappable (RLayer::Id layerId) const |
bool | isRedoAvailable () const |
bool | isSelected (REntity::Id entityId) |
bool | isSelectedWorkingSet (REntity::Id entityId) |
bool | isUndoAvailable () const |
QSet< REntity::Id > | queryAllBlockReferences () const |
QSet< RBlock::Id > | queryAllBlocks () const |
QSet< REntity::Id > | queryAllEntities (bool undone, bool allBlocks, QList< RS::EntityType > types) const |
QSet< REntity::Id > | queryAllEntities (bool undone=false, bool allBlocks=false, RS::EntityType type=RS::EntityAll) const |
Queries all entities of this document. More... | |
QSet< RLayer::Id > | queryAllLayers () const |
Queries all layers of this document. More... | |
QSet< RLayerState::Id > | queryAllLayerStates () const |
Queries all layer state objects of this document. More... | |
QSet< RBlock::Id > | queryAllLayoutBlocks (bool includeModelSpace=false) const |
QSet< RBlock::Id > | queryAllLayouts () const |
QSet< RLinetype::Id > | queryAllLinetypes () const |
QSet< RObject::Id > | queryAllObjects () const |
Queries all objects of this document. More... | |
QSet< RUcs::Id > | queryAllUcs () const |
Queries all UCSs of this document. More... | |
QSet< REntity::Id > | queryAllViewports () const |
QSet< RView::Id > | queryAllViews () const |
QSet< REntity::Id > | queryAllVisibleEntities () const |
QSharedPointer< RBlock > | queryBlock (const QString &blockName) const |
Queries the block with the given name. More... | |
QSharedPointer< RBlock > | queryBlock (RBlock::Id blockId) const |
Queries the block with the given ID. More... | |
QSharedPointer< RBlock > | queryBlockDirect (const QString &blockName) const |
Queries the block with the given name direct (no cloning). More... | |
QSharedPointer< RBlock > | queryBlockDirect (RBlock::Id blockId) const |
Queries the block with the given ID direct (no cloning). More... | |
QSet< REntity::Id > | queryBlockEntities (RBlock::Id blockId) const |
QSet< REntity::Id > | queryBlockReferences (RBlock::Id blockId) const |
QSet< REntity::Id > | queryChildEntities (REntity::Id parentId, RS::EntityType type=RS::EntityAll) const |
REntity::Id | queryClosestXY (const RVector &wcsPosition, double range, bool draft, double strictRange=RMAXDOUBLE, bool includeLockedLayers=true, bool selectedOnly=false) |
Queries the one entity that is closest to the given position and within the given range (2d). More... | |
REntity::Id | queryClosestXY (QSet< REntity::Id > &candidates, const RVector &wcsPosition, double range, bool draft, double strictRange=RMAXDOUBLE) |
Queries the entity that is closest to the given position wcsPosition . More... | |
QSet< REntity::Id > | queryConnectedEntities (REntity::Id entityId, double tolerance=RS::PointTolerance, RLayer::Id layerId=RLayer::INVALID_ID) |
QSet< REntity::Id > | queryContainedEntities (const RBox &box) const |
Queries all entities which are completely inside the given box. More... | |
QSet< REntity::Id > | queryContainedEntitiesXY (const RBox &box) const |
QSharedPointer< RBlock > | queryCurrentBlock () |
QSharedPointer< RLayer > | queryCurrentLayer () |
QSharedPointer< RView > | queryCurrentView () |
QSharedPointer< RDocumentVariables > | queryDocumentVariables () const |
QSharedPointer< RDocumentVariables > | queryDocumentVariablesDirect () const |
QSharedPointer< REntity > | queryEntity (REntity::Id entityId) const |
Queries the entity with the given ID. More... | |
QSharedPointer< REntity > | queryEntityDirect (REntity::Id entityId) const |
Queries the entity with the given ID. More... | |
QSet< REntity::Id > | queryInfiniteEntities () const |
QSet< REntity::Id > | queryIntersectedEntitiesXY (const RBox &box, bool checkBoundingBoxOnly=false, bool includeLockedLayers=true, RBlock::Id blockId=RBlock::INVALID_ID, const QList< RS::EntityType > &filter=RDEFAULT_QLIST_RS_ENTITYTYPE, bool selectedOnly=false, RLayer::Id layerId=RLayer::INVALID_ID) const |
QSet< REntity::Id > | queryIntersectedEntitiesXYFast (const RBox &box) |
QMap< REntity::Id, QSet< int > > | queryIntersectedShapesXY (const RBox &box, bool checkBoundingBoxOnly=false, bool includeLockedLayers=true, RBlock::Id blockId=RBlock::INVALID_ID, const QList< RS::EntityType > &filter=RDEFAULT_QLIST_RS_ENTITYTYPE, bool selectedOnly=false, RLayer::Id layerId=RLayer::INVALID_ID) const |
QSet< REntity::Id > | queryIntersectedShapesXYFast (const RBox &box, bool noInfiniteEntities=false) |
QSharedPointer< RLayer > | queryLayer (const QString &layerName) const |
Queries the layer with the given name. More... | |
QSharedPointer< RLayer > | queryLayer (RLayer::Id layerId) const |
Queries the layer with the given ID. More... | |
QSet< REntity::Id > | queryLayerBlockEntities (RLayer::Id layerId, RBlock::Id blockId) const |
QSharedPointer< RLayer > | queryLayerDirect (RLayer::Id layerId) const |
Queries the layer with the given ID direct (no cloning). More... | |
QSet< REntity::Id > | queryLayerEntities (RLayer::Id layerId, bool allBlocks=false) const |
QSharedPointer< RLayerState > | queryLayerState (const QString &layerStateName) const |
Queries the layer state with the given name. More... | |
QSharedPointer< RLayerState > | queryLayerState (RLayerState::Id layerStateId) const |
Queries the layer state with the given ID. More... | |
QSharedPointer< RLayerState > | queryLayerStateDirect (RLayerState::Id layerStateId) const |
Queries the layer state with the given ID direct (no cloning). More... | |
QSharedPointer< RLayout > | queryLayout (const QString &layoutName) const |
Queries the layout with the given name. More... | |
QSharedPointer< RLayout > | queryLayout (RLayout::Id layoutId) const |
Queries the layout with the given ID. More... | |
QSharedPointer< RLayout > | queryLayoutDirect (RLayout::Id layoutId) const |
Queries the layout with the given ID direct (no cloning). More... | |
QSharedPointer< RLinetype > | queryLinetype (const QString &linetypeName) const |
Queries the linetype with the given name. More... | |
QSharedPointer< RLinetype > | queryLinetype (RLinetype::Id linetypeId) const |
Queries the linetype with the given ID. More... | |
QSharedPointer< RObject > | queryObject (RObject::Id objectId) const |
Queries the object with the given ID. More... | |
QSharedPointer< RObject > | queryObjectByHandle (RObject::Handle objectHandle) const |
QSharedPointer< RObject > | queryObjectDirect (RObject::Id objectId) const |
Queries the object with the given ID. More... | |
QSet< RObject::Id > | queryPropertyEditorObjects () |
QSet< REntity::Id > | querySelectedEntities () const |
Queries all selected entities. More... | |
QSet< RObject::Id > | querySelectedLayers () const |
Queries all selected objects. More... | |
QSharedPointer< RUcs > | queryUcs (const QString &ucsName) const |
Queries the UCS with the given name. More... | |
QSharedPointer< RUcs > | queryUcs (RUcs::Id ucsId) const |
Queries the UCS with the given ID. More... | |
QSharedPointer< RView > | queryView (const QString &viewName) const |
Queries the view with the given name. More... | |
QSharedPointer< RView > | queryView (RView::Id viewId) const |
Queries the view with the given ID. More... | |
QSharedPointer< REntity > | queryVisibleEntityDirect (REntity::Id entityId) const |
QSet< REntity::Id > | queryWorkingSetEntities () const |
RDocument (RStorage &storage, RSpatialIndex &spatialIndex) | |
Creates a new document with the given storage as back-end. More... | |
virtual void | rebuildSpatialIndex () |
Rebuilds the entire spatial index from scratch (e.g. More... | |
QList< RTransaction > | redo () |
Redoes a previously undone transaction. More... | |
void | removeBlockFromSpatialIndex (RBlock::Id blockId) |
virtual void | removeFromSpatialIndex (QSharedPointer< REntity > entity, const QList< RBox > &boundingBoxes=RDEFAULT_QLIST_RBOX) |
void | removeVariable (const QString &key) |
Removes the custom variable with the given key. More... | |
void | resetTransactionStack () |
void | selectAllEntities (QSet< REntity::Id > *affectedEntities=NULL) |
Selects all not selected entities. More... | |
int | selectEntities (const QSet< REntity::Id > &entityId, bool add=false, QSet< REntity::Id > *affectedEntities=NULL) |
Selects all entities with the given IDs. More... | |
void | selectEntity (REntity::Id entityId, bool add=false, QSet< REntity::Id > *affectedEntities=NULL) |
Selects the entity with the given ID. More... | |
void | setAutoTransactionGroup (bool on) |
True: add all operations to the current transaction group. More... | |
void | setCurrentBlock (const QString &blockName) |
void | setCurrentBlock (RBlock::Id blockId) |
void | setCurrentColor (const RColor &color) |
void | setCurrentLayer (const QString &layerName, RTransaction *transaction=NULL) |
void | setCurrentLayer (RLayer::Id layerId, RTransaction *transaction=NULL) |
void | setCurrentLinetype (const QString &name) |
void | setCurrentLinetype (RLinetype::Id ltId) |
void | setCurrentLinetypePattern (const RLinetypePattern &p) |
void | setCurrentLineweight (RLineweight::Lineweight lw) |
void | setCurrentView (const QString &viewName) |
void | setCurrentView (RView::Id viewId) |
void | setCurrentViewport (RObject::Id viewportId) |
void | setDimensionFont (const QString &f, RTransaction *transaction=NULL) |
void | setFileName (const QString &fn) |
void | setFileVersion (const QString &fv) |
void | setIgnoreWorkingSet (bool on) |
void | setKnownVariable (RS::KnownVariable key, const QVariant &value, RTransaction *transaction=NULL) |
Sets a known DXF/DWG variable for this document. More... | |
void | setKnownVariable (RS::KnownVariable key, const RVector &value, RTransaction *transaction=NULL) |
Sets a known DXF/DWG variable for this document. More... | |
void | setLinearFormat (RS::LinearFormat f) |
void | setLinetypeScale (double v, RTransaction *transaction=NULL) |
Sets the global linetype scale of this document to the given value. More... | |
void | setMeasurement (RS::Measurement m, RTransaction *transaction=NULL) |
void | setModified (bool m) |
Resets the modified flag. More... | |
void | setUnit (RS::Unit unit, RTransaction *transaction=NULL) |
void | setVariable (const QString &key, const QVariant &value, bool overwrite=true) |
Sets a custom variable in the context of this document. More... | |
bool | showLeadingZeroes () |
bool | showLeadingZeroesAngle () |
bool | showTrailingZeroes () |
bool | showTrailingZeroesAngle () |
QList< RBlock::Id > | sortBlocks (const QList< RBlock::Id > &blockIds) const |
QList< RLayer::Id > | sortLayers (const QList< RLayer::Id > &layerIds) const |
void | startTransactionGroup () |
QString | substituteAutoVariables (const QString &expression) |
QList< RTransaction > | undo () |
Undoes the last transaction. More... | |
void | unsetCurrentViewport () |
void | updateAllEntities () |
virtual | ~RDocument () |
Public Member Functions inherited from RRequireHeap | |
void | doDelete () |
Static Public Member Functions | |
static RDocument & | getClipboard () |
Static Protected Attributes | |
static RDocument * | clipboard = NULL |
Copyright (c) 2011-2018 by Andrew Mustun. More... | |
Private Attributes | |
bool | autoTransactionGroup |
bool | disableSpatialIndicesByBlock |
QString | fileName |
QString | fileVersion |
RLinetype::Id | linetypeByBlockId |
RLinetype::Id | linetypeByLayerId |
RSpatialIndex & | spatialIndex |
QMap< RBlock::Id, RSpatialIndex * > | spatialIndicesByBlock |
RStorage & | storage |
RTransactionStack | transactionStack |
Friends | |
QDebug | operator<< (QDebug dbg, RDocument &d) |
Stream operator for QDebug. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from RRequireHeap | |
virtual | ~RRequireHeap () |
Private Member Functions inherited from RNonCopyable | |
RNonCopyable () | |
~RNonCopyable () | |
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Every document maintains a spatial index for fast entity lookups. Documents also handle transactions through a RTransactionStack. A document is backed by an RStorage implementation to store the document for the duration of the document's lifetime.
RDocument::RDocument | ( | RStorage & | storage, |
RSpatialIndex & | spatialIndex | ||
) |
Creates a new document with the given storage as back-end.
The document takes ownership of the storage and spatial index. A new document contains one layer ("0") and a number of default line types. The default unit is Millimeter.
|
virtual |
QString RDocument::addAutoVariable | ( | double | value | ) |
bool RDocument::addBlockToSpatialIndex | ( | RBlock::Id | blockId, |
RObject::Id | ignoreBlockId | ||
) |
Add block references that point to blockId, unless they also point to ignoreBlockId.
void RDocument::addToSpatialIndex | ( | QSharedPointer< REntity > | entity | ) |
bool RDocument::blockContainsReferences | ( | RBlock::Id | blockId, |
RBlock::Id | referencedBlockId | ||
) |
void RDocument::clear | ( | bool | beforeLoad = false | ) |
Resets this document to its initial, empty state.
void RDocument::clearSelection | ( | QSet< REntity::Id > * | affectedEntities = NULL | ) |
Deselectes all selected entities.
void RDocument::clearSpatialIndices | ( | ) |
void RDocument::copyVariablesFrom | ( | const RDocument & | other | ) |
int RDocument::countSelectedEntities | ( | ) | const |
int RDocument::deselectEntities | ( | const QSet< REntity::Id > & | entityIds, |
QSet< REntity::Id > * | affectedEntities = NULL |
||
) |
Deselects all entities with the given IDs.
affected | Optional pointer to an empty set of entity IDs. After the call, this set will contain all entity IDs of entities that were affected by the call. |
void RDocument::deselectEntity | ( | REntity::Id | entityId, |
QSet< REntity::Id > * | affectedEntities = NULL |
||
) |
Deselects the entity with the given ID.
affected | Optional pointer to an empty set of entity IDs. After the call, this set will contain all entity IDs of entities that were affected by the call. |
void RDocument::dump | ( | ) |
double RDocument::eval | ( | const QString & | expression, |
bool * | ok = NULL |
||
) |
QString RDocument::formatAngle | ( | double | value | ) |
QString RDocument::formatLinear | ( | double | value | ) |
RS::AngleFormat RDocument::getAngleFormat | ( | ) |
int RDocument::getAnglePrecision | ( | ) |
|
inline |
QStringList RDocument::getAutoVariables | ( | ) | const |
RBlock::Id RDocument::getBlockId | ( | const QString & | blockName | ) | const |
RBlock::Id RDocument::getBlockIdAuto | ( | const QString & | blockLayoutName | ) | const |
QString RDocument::getBlockName | ( | RBlock::Id | blockId | ) | const |
QString RDocument::getBlockNameFromLayout | ( | const QString & | layoutName | ) | const |
QString RDocument::getBlockNameFromLayout | ( | RLayout::Id | layoutId | ) | const |
QSet< QString > RDocument::getBlockNames | ( | const QString & | rxStr = RDEFAULT_QSTRING | ) | const |
RBox RDocument::getBoundingBox | ( | bool | ignoreHiddenLayers = true , |
bool | ignoreEmpty = false |
||
) | const |
|
static |
RBlock::Id RDocument::getCurrentBlockId | ( | ) | const |
QString RDocument::getCurrentBlockName | ( | ) | const |
RColor RDocument::getCurrentColor | ( | ) | const |
RLayer::Id RDocument::getCurrentLayerId | ( | ) | const |
QString RDocument::getCurrentLayerName | ( | ) | const |
RLinetype::Id RDocument::getCurrentLinetypeId | ( | ) | const |
RLinetypePattern RDocument::getCurrentLinetypePattern | ( | ) | const |
RLineweight::Lineweight RDocument::getCurrentLineweight | ( | ) | const |
RView::Id RDocument::getCurrentViewId | ( | ) | const |
RObject::Id RDocument::getCurrentViewportId | ( | ) |
char RDocument::getDecimalSeparator | ( | ) |
QList< QSharedPointer< RObject > > RDocument::getDefaultLinetypes | ( | ) |
QString RDocument::getDimensionFont | ( | ) | const |
RBox RDocument::getEntitiesBox | ( | QSet< REntity::Id > & | ids | ) | const |
QString RDocument::getFileName | ( | ) | const |
QString RDocument::getFileVersion | ( | ) | const |
QVariant RDocument::getKnownVariable | ( | RS::KnownVariable | key, |
const QVariant & | defaultValue = RDEFAULT_QVARIANT |
||
) | const |
QString RDocument::getLastModified | ( | ) | const |
QDateTime RDocument::getLastModifiedDateTime | ( | ) | const |
RLayer::Id RDocument::getLayer0Id | ( | ) | const |
RLayer::Id RDocument::getLayerId | ( | const QString & | layerName | ) | const |
QString RDocument::getLayerName | ( | RLayer::Id | layerId | ) | const |
QSet< QString > RDocument::getLayerNames | ( | const QString & | rxStr = RDEFAULT_QSTRING | ) | const |
RLayerState::Id RDocument::getLayerStateId | ( | const QString & | layerStateName | ) | const |
QString RDocument::getLayerStateName | ( | RLayerState::Id | layerStateId | ) | const |
QSet< QString > RDocument::getLayerStateNames | ( | const QString & | rxStr = RDEFAULT_QSTRING | ) | const |
QString RDocument::getLayoutName | ( | RLayout::Id | layoutId | ) | const |
RS::LinearFormat RDocument::getLinearFormat | ( | ) | const |
int RDocument::getLinearPrecision | ( | ) |
|
inline |
|
inline |
QString RDocument::getLinetypeDescription | ( | RLinetype::Id | linetypeId | ) | const |
RLinetype::Id RDocument::getLinetypeId | ( | const QString & | linetypeName | ) | const |
QString RDocument::getLinetypeLabel | ( | RLinetype::Id | linetypeId | ) | const |
QString RDocument::getLinetypeName | ( | RLinetype::Id | linetypeId | ) | const |
QSet< QString > RDocument::getLinetypeNames | ( | ) | const |
QList< RLinetypePattern > RDocument::getLinetypePatterns | ( | ) | const |
double RDocument::getLinetypeScale | ( | ) | const |
RLineweight::Lineweight RDocument::getMaxLineweight | ( | ) | const |
RS::Measurement RDocument::getMeasurement | ( | ) | const |
RBlock::Id RDocument::getModelSpaceBlockId | ( | ) | const |
RBox RDocument::getSelectionBox | ( | ) | const |
RSpatialIndex & RDocument::getSpatialIndex | ( | ) |
const RSpatialIndex & RDocument::getSpatialIndex | ( | ) | const |
RSpatialIndex * RDocument::getSpatialIndexForBlock | ( | RBlock::Id | blockId | ) | const |
RSpatialIndex * RDocument::getSpatialIndexForCurrentBlock | ( | ) | const |
RStorage & RDocument::getStorage | ( | ) |
const RStorage & RDocument::getStorage | ( | ) | const |
QString RDocument::getTempBlockName | ( | ) | const |
int RDocument::getTransactionGroup | ( | ) | const |
RTransactionStack & RDocument::getTransactionStack | ( | ) |
RS::Unit RDocument::getUnit | ( | ) | const |
QVariant RDocument::getVariable | ( | const QString & | key, |
const QVariant & | defaultValue = RDEFAULT_QVARIANT , |
||
bool | useSettings = false |
||
) | const |
QStringList RDocument::getVariables | ( | ) | const |
QSet< QString > RDocument::getViewNames | ( | ) | const |
bool RDocument::hasBlock | ( | const QString & | blockName | ) | const |
bool RDocument::hasBlockEntities | ( | RBlock::Id | blockId | ) | const |
bool RDocument::hasChildEntities | ( | REntity::Id | parentId | ) | const |
bool RDocument::hasCurrentViewport | ( | ) |
bool RDocument::hasLayer | ( | const QString & | layerName | ) | const |
bool RDocument::hasLayerState | ( | const QString & | layerStateName | ) | const |
bool RDocument::hasLayerStates | ( | ) | const |
bool RDocument::hasLayout | ( | const QString & | layoutName | ) | const |
bool RDocument::hasLinetype | ( | const QString & | linetypeName | ) | const |
bool RDocument::hasSelection | ( | ) | const |
bool RDocument::hasVariable | ( | const QString & | key | ) | const |
bool RDocument::hasView | ( | const QString & | viewName | ) | const |
void RDocument::init | ( | bool | beforeLoad = false | ) |
void RDocument::initLinetypes | ( | RTransaction * | transaction = NULL | ) |
bool RDocument::isBlockFrozen | ( | RBlock::Id | blockId | ) | const |
bool RDocument::isByBlock | ( | RLinetype::Id | linetypeId | ) | const |
bool RDocument::isByLayer | ( | RLinetype::Id | linetypeId | ) | const |
bool RDocument::isEditingWorkingSet | ( | ) | const |
bool RDocument::isEntityEditable | ( | REntity::Id | entityId | ) | const |
bool RDocument::isEntityLayerFrozen | ( | REntity::Id | entityId | ) | const |
bool RDocument::isEntityVisible | ( | const REntity & | entity, |
RBlock::Id | blockId = RBlock::INVALID_ID |
||
) | const |
bool RDocument::isLayerFrozen | ( | const RLayer & | layer | ) | const |
bool RDocument::isLayerFrozen | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isLayerLocked | ( | const RLayer & | layer | ) | const |
bool RDocument::isLayerLocked | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isLayerOff | ( | const RLayer & | layer | ) | const |
bool RDocument::isLayerOff | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isLayerOffOrFrozen | ( | const RLayer & | layer | ) | const |
bool RDocument::isLayerOffOrFrozen | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isLayerPlottable | ( | const RLayer & | layer | ) | const |
bool RDocument::isLayerPlottable | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isLayerSnappable | ( | const RLayer & | layer | ) | const |
bool RDocument::isLayerSnappable | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isLayoutBlock | ( | RBlock::Id | blockId | ) | const |
bool RDocument::isMetric | ( | ) | const |
bool RDocument::isModified | ( | ) | const |
bool RDocument::isParentLayerFrozen | ( | const RLayer & | layer | ) | const |
bool RDocument::isParentLayerFrozen | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isParentLayerLocked | ( | const RLayer & | layer | ) | const |
bool RDocument::isParentLayerLocked | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isParentLayerPlottable | ( | const RLayer & | layer | ) | const |
bool RDocument::isParentLayerPlottable | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isParentLayerSnappable | ( | const RLayer & | layer | ) | const |
bool RDocument::isParentLayerSnappable | ( | RLayer::Id | layerId | ) | const |
bool RDocument::isRedoAvailable | ( | ) | const |
bool RDocument::isSelected | ( | REntity::Id | entityId | ) |
bool RDocument::isSelectedWorkingSet | ( | REntity::Id | entityId | ) |
bool RDocument::isUndoAvailable | ( | ) | const |
QSet< REntity::Id > RDocument::queryAllBlockReferences | ( | ) | const |
QSet< RBlock::Id > RDocument::queryAllBlocks | ( | ) | const |
QSet< REntity::Id > RDocument::queryAllEntities | ( | bool | undone, |
bool | allBlocks, | ||
QList< RS::EntityType > | types | ||
) | const |
QSet< REntity::Id > RDocument::queryAllEntities | ( | bool | undone = false , |
bool | allBlocks = false , |
||
RS::EntityType | type = RS::EntityAll |
||
) | const |
Queries all entities of this document.
This operation can be slow, depending on the total number of entities and the storage type that is used for this document.
QSet< RLayer::Id > RDocument::queryAllLayers | ( | ) | const |
Queries all layers of this document.
QSet< RLayer::Id > RDocument::queryAllLayerStates | ( | ) | const |
Queries all layer state objects of this document.
QSet< RBlock::Id > RDocument::queryAllLayoutBlocks | ( | bool | includeModelSpace = false | ) | const |
QSet< RLayout::Id > RDocument::queryAllLayouts | ( | ) | const |
QSet< RLinetype::Id > RDocument::queryAllLinetypes | ( | ) | const |
QSet< RObject::Id > RDocument::queryAllObjects | ( | ) | const |
Queries all objects of this document.
QSet< RUcs::Id > RDocument::queryAllUcs | ( | ) | const |
Queries all UCSs of this document.
QSet< REntity::Id > RDocument::queryAllViewports | ( | ) | const |
QSet< RView::Id > RDocument::queryAllViews | ( | ) | const |
QSet< REntity::Id > RDocument::queryAllVisibleEntities | ( | ) | const |
QSharedPointer< RBlock > RDocument::queryBlock | ( | const QString & | blockName | ) | const |
Queries the block with the given name.
QSharedPointer< RBlock > RDocument::queryBlock | ( | RBlock::Id | blockId | ) | const |
Queries the block with the given ID.
QSharedPointer< RBlock > RDocument::queryBlockDirect | ( | const QString & | blockName | ) | const |
Queries the block with the given name direct (no cloning).
Blocks queried this way should not be modified unless undo / redo functionality is not required.
QSharedPointer< RBlock > RDocument::queryBlockDirect | ( | RBlock::Id | blockId | ) | const |
Queries the block with the given ID direct (no cloning).
Blocks queried this way should not be modified unless undo / redo functionality is not required.
QSet< REntity::Id > RDocument::queryBlockEntities | ( | RBlock::Id | blockId | ) | const |
QSet< REntity::Id > RDocument::queryBlockReferences | ( | RBlock::Id | blockId | ) | const |
QSet< REntity::Id > RDocument::queryChildEntities | ( | REntity::Id | parentId, |
RS::EntityType | type = RS::EntityAll |
||
) | const |
REntity::Id RDocument::queryClosestXY | ( | const RVector & | wcsPosition, |
double | range, | ||
bool | draft, | ||
double | strictRange = RMAXDOUBLE , |
||
bool | includeLockedLayers = true , |
||
bool | selectedOnly = false |
||
) |
Queries the one entity that is closest to the given position and within the given range (2d).
wcsPosition | The position to which the entity has to be close (2d). |
range | The range in which to search. |
REntity::Id RDocument::queryClosestXY | ( | QSet< REntity::Id > & | candidates, |
const RVector & | wcsPosition, | ||
double | range, | ||
bool | draft, | ||
double | strictRange = RMAXDOUBLE |
||
) |
Queries the entity that is closest to the given position wcsPosition
.
Only entities in the given set of candidates
are considered. candidates
is usually the result of an approximate spatial index query.
candidates | Sets of candidates to consider. |
wcsPosition | |
range | Maximum distance between position and entity. |
QSet< REntity::Id > RDocument::queryConnectedEntities | ( | REntity::Id | entityId, |
double | tolerance = RS::PointTolerance , |
||
RLayer::Id | layerId = RLayer::INVALID_ID |
||
) |
QSet< REntity::Id > RDocument::queryContainedEntities | ( | const RBox & | box | ) | const |
Queries all entities which are completely inside the given box.
box | Query box. |
result | Set of IDs of entities that are completely inside the given area. |
QSet< REntity::Id > RDocument::queryContainedEntitiesXY | ( | const RBox & | box | ) | const |
QSharedPointer< RBlock > RDocument::queryCurrentBlock | ( | ) |
QSharedPointer< RLayer > RDocument::queryCurrentLayer | ( | ) |
QSharedPointer< RView > RDocument::queryCurrentView | ( | ) |
QSharedPointer< RDocumentVariables > RDocument::queryDocumentVariables | ( | ) | const |
QSharedPointer< RDocumentVariables > RDocument::queryDocumentVariablesDirect | ( | ) | const |
QSharedPointer< REntity > RDocument::queryEntity | ( | REntity::Id | entityId | ) | const |
Queries the entity with the given ID.
A clone of the actual entity is returned. Clones should always be used when modifying entities.
QSharedPointer< REntity > RDocument::queryEntityDirect | ( | REntity::Id | entityId | ) | const |
Queries the entity with the given ID.
If the storage has the entity instantiated, the instance is returned (rather than a clone). Entities queried this way should not be modified unless undo / redo functionality is not required.
QSet< REntity::Id > RDocument::queryInfiniteEntities | ( | ) | const |
QSet< REntity::Id > RDocument::queryIntersectedEntitiesXY | ( | const RBox & | box, |
bool | checkBoundingBoxOnly = false , |
||
bool | includeLockedLayers = true , |
||
RBlock::Id | blockId = RBlock::INVALID_ID , |
||
const QList< RS::EntityType > & | filter = RDEFAULT_QLIST_RS_ENTITYTYPE , |
||
bool | selectedOnly = false , |
||
RLayer::Id | layerId = RLayer::INVALID_ID |
||
) | const |
QSet< REntity::Id > RDocument::queryIntersectedEntitiesXYFast | ( | const RBox & | box | ) |
QMap< REntity::Id, QSet< int > > RDocument::queryIntersectedShapesXY | ( | const RBox & | box, |
bool | checkBoundingBoxOnly = false , |
||
bool | includeLockedLayers = true , |
||
RBlock::Id | blockId = RBlock::INVALID_ID , |
||
const QList< RS::EntityType > & | filter = RDEFAULT_QLIST_RS_ENTITYTYPE , |
||
bool | selectedOnly = false , |
||
RLayer::Id | layerId = RLayer::INVALID_ID |
||
) | const |
QSet< REntity::Id > RDocument::queryIntersectedShapesXYFast | ( | const RBox & | box, |
bool | noInfiniteEntities = false |
||
) |
QSharedPointer< RLayer > RDocument::queryLayer | ( | const QString & | layerName | ) | const |
Queries the layer with the given name.
QSharedPointer< RLayer > RDocument::queryLayer | ( | RLayer::Id | layerId | ) | const |
Queries the layer with the given ID.
QSet< REntity::Id > RDocument::queryLayerBlockEntities | ( | RLayer::Id | layerId, |
RBlock::Id | blockId | ||
) | const |
QSharedPointer< RLayer > RDocument::queryLayerDirect | ( | RLayer::Id | layerId | ) | const |
Queries the layer with the given ID direct (no cloning).
Layers queried this way should not be modified unless undo / redo functionality is not required.
QSet< REntity::Id > RDocument::queryLayerEntities | ( | RLayer::Id | layerId, |
bool | allBlocks = false |
||
) | const |
QSharedPointer< RLayerState > RDocument::queryLayerState | ( | const QString & | layerStateName | ) | const |
Queries the layer state with the given name.
QSharedPointer< RLayerState > RDocument::queryLayerState | ( | RLayerState::Id | layerStateId | ) | const |
Queries the layer state with the given ID.
QSharedPointer< RLayerState > RDocument::queryLayerStateDirect | ( | RLayerState::Id | layerStateId | ) | const |
Queries the layer state with the given ID direct (no cloning).
Layer states queried this way should not be modified unless undo / redo functionality is not required.
QSharedPointer< RLayout > RDocument::queryLayout | ( | const QString & | layoutName | ) | const |
Queries the layout with the given name.
QSharedPointer< RLayout > RDocument::queryLayout | ( | RLayout::Id | layoutId | ) | const |
Queries the layout with the given ID.
QSharedPointer< RLayout > RDocument::queryLayoutDirect | ( | RLayout::Id | layoutId | ) | const |
Queries the layout with the given ID direct (no cloning).
Layouts queried this way should not be modified unless undo / redo functionality is not required.
QSharedPointer< RLinetype > RDocument::queryLinetype | ( | const QString & | linetypeName | ) | const |
Queries the linetype with the given name.
QSharedPointer< RLinetype > RDocument::queryLinetype | ( | RLinetype::Id | linetypeId | ) | const |
Queries the linetype with the given ID.
QSharedPointer< RObject > RDocument::queryObject | ( | RObject::Id | objectId | ) | const |
Queries the object with the given ID.
QSharedPointer< RObject > RDocument::queryObjectByHandle | ( | RObject::Handle | objectHandle | ) | const |
QSharedPointer< RObject > RDocument::queryObjectDirect | ( | RObject::Id | objectId | ) | const |
Queries the object with the given ID.
If the storage has the object instantiated, the instance is returned (rather than a clone). Objects queried this way should not be modified unless undo / redo functionality is not required.
QSet< RObject::Id > RDocument::queryPropertyEditorObjects | ( | ) |
QSet< REntity::Id > RDocument::querySelectedEntities | ( | ) | const |
Queries all selected entities.
QSet< RObject::Id > RDocument::querySelectedLayers | ( | ) | const |
Queries all selected objects.
QSharedPointer< RUcs > RDocument::queryUcs | ( | const QString & | ucsName | ) | const |
Queries the UCS with the given name.
Queries the UCS with the given ID.
QSharedPointer< RView > RDocument::queryView | ( | const QString & | viewName | ) | const |
Queries the view with the given name.
Queries the view with the given ID.
QSharedPointer< REntity > RDocument::queryVisibleEntityDirect | ( | REntity::Id | entityId | ) | const |
QSet< REntity::Id > RDocument::queryWorkingSetEntities | ( | ) | const |
|
virtual |
Rebuilds the entire spatial index from scratch (e.g.
when current block is changed).
QList< RTransaction > RDocument::redo | ( | ) |
Redoes a previously undone transaction.
void RDocument::removeBlockFromSpatialIndex | ( | RBlock::Id | blockId | ) |
|
virtual |
void RDocument::removeVariable | ( | const QString & | key | ) |
Removes the custom variable with the given key.
void RDocument::resetTransactionStack | ( | ) |
void RDocument::selectAllEntities | ( | QSet< REntity::Id > * | affectedEntities = NULL | ) |
Selects all not selected entities.
int RDocument::selectEntities | ( | const QSet< REntity::Id > & | entityIds, |
bool | add = false , |
||
QSet< REntity::Id > * | affectedEntities = NULL |
||
) |
Selects all entities with the given IDs.
add | True to add the entities to the current selection. False to replace the current selection with the new entities. |
affected | Optional pointer to an empty set of entity IDs. After the call, this set will contain all entity IDs of entities that were affected by the call. |
void RDocument::selectEntity | ( | REntity::Id | entityId, |
bool | add = false , |
||
QSet< REntity::Id > * | affectedEntities = NULL |
||
) |
Selects the entity with the given ID.
add | True to add the entity to the current selection. False to replace the current selection with the given entity. |
affected | Optional pointer to an empty set of entity IDs. After the call, this set will contain all entity IDs of entities that were affected by the call. |
|
inline |
True: add all operations to the current transaction group.
void RDocument::setCurrentBlock | ( | const QString & | blockName | ) |
void RDocument::setCurrentBlock | ( | RBlock::Id | blockId | ) |
void RDocument::setCurrentColor | ( | const RColor & | color | ) |
void RDocument::setCurrentLayer | ( | const QString & | layerName, |
RTransaction * | transaction = NULL |
||
) |
void RDocument::setCurrentLayer | ( | RLayer::Id | layerId, |
RTransaction * | transaction = NULL |
||
) |
void RDocument::setCurrentLinetype | ( | const QString & | name | ) |
void RDocument::setCurrentLinetype | ( | RLinetype::Id | ltId | ) |
void RDocument::setCurrentLinetypePattern | ( | const RLinetypePattern & | p | ) |
void RDocument::setCurrentLineweight | ( | RLineweight::Lineweight | lw | ) |
void RDocument::setCurrentView | ( | const QString & | viewName | ) |
void RDocument::setCurrentView | ( | RView::Id | viewId | ) |
void RDocument::setCurrentViewport | ( | RObject::Id | viewportId | ) |
void RDocument::setDimensionFont | ( | const QString & | f, |
RTransaction * | transaction = NULL |
||
) |
void RDocument::setFileName | ( | const QString & | fn | ) |
void RDocument::setFileVersion | ( | const QString & | fv | ) |
void RDocument::setIgnoreWorkingSet | ( | bool | on | ) |
void RDocument::setKnownVariable | ( | RS::KnownVariable | key, |
const QVariant & | value, | ||
RTransaction * | transaction = NULL |
||
) |
Sets a known DXF/DWG variable for this document.
key | Variable key (see DXF reference) |
value | New value of the variable. |
transaction | RTransaction to use for the change or NULL (default) to create a transaction on the fly. |
void RDocument::setKnownVariable | ( | RS::KnownVariable | key, |
const RVector & | value, | ||
RTransaction * | transaction = NULL |
||
) |
Sets a known DXF/DWG variable for this document.
key | Variable key (see DXF reference) |
value | New value of the variable. |
transaction | RTransaction to use for the change or NULL (default) to create a transaction on the fly. |
void RDocument::setLinearFormat | ( | RS::LinearFormat | f | ) |
void RDocument::setLinetypeScale | ( | double | v, |
RTransaction * | transaction = NULL |
||
) |
Sets the global linetype scale of this document to the given value.
transaction | Transaction to use for the modification or NULL to create a local transaction (default). |
void RDocument::setMeasurement | ( | RS::Measurement | m, |
RTransaction * | transaction = NULL |
||
) |
void RDocument::setModified | ( | bool | m | ) |
Resets the modified flag.
Modification time is stored.
void RDocument::setUnit | ( | RS::Unit | unit, |
RTransaction * | transaction = NULL |
||
) |
void RDocument::setVariable | ( | const QString & | key, |
const QVariant & | value, | ||
bool | overwrite = true |
||
) |
Sets a custom variable in the context of this document.
key | Variable key (name) |
value | Variable value |
overwrite | True to overwrite an existing variable with the same key (default) |
bool RDocument::showLeadingZeroes | ( | ) |
bool RDocument::showLeadingZeroesAngle | ( | ) |
bool RDocument::showTrailingZeroes | ( | ) |
bool RDocument::showTrailingZeroesAngle | ( | ) |
QList< RBlock::Id > RDocument::sortBlocks | ( | const QList< RBlock::Id > & | blockIds | ) | const |
QList< RLayer::Id > RDocument::sortLayers | ( | const QList< RLayer::Id > & | layerIds | ) | const |
void RDocument::startTransactionGroup | ( | ) |
QString RDocument::substituteAutoVariables | ( | const QString & | expression | ) |
QList< RTransaction > RDocument::undo | ( | ) |
Undoes the last transaction.
void RDocument::unsetCurrentViewport | ( | ) |
void RDocument::updateAllEntities | ( | ) |
|
friend |
Stream operator for QDebug.
|
private |
|
staticprotected |
Copyright (c) 2011-2018 by Andrew Mustun.
All rights reserved.
This file is part of the QCAD project.
QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with QCAD.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |