QCAD
Open Source 2D CAD
RDocument Class Reference

A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc. More...

#include <RDocument.h>

Inheritance diagram for RDocument:
RRequireHeap RNonCopyable

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< RLinetypePatterngetLinetypePatterns () const
 
double getLinetypeScale () const
 
RLineweight::Lineweight getMaxLineweight () const
 
RS::Measurement getMeasurement () const
 
RBlock::Id getModelSpaceBlockId () const
 
RBox getSelectionBox () const
 
RSpatialIndexgetSpatialIndex ()
 
const RSpatialIndexgetSpatialIndex () const
 
RSpatialIndexgetSpatialIndexForBlock (RBlock::Id blockId) const
 
RSpatialIndexgetSpatialIndexForCurrentBlock () const
 
RStoragegetStorage ()
 
const RStoragegetStorage () const
 
QString getTempBlockName () const
 
int getTransactionGroup () const
 
RTransactionStackgetTransactionStack ()
 
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::IdqueryAllBlockReferences () const
 
QSet< RBlock::IdqueryAllBlocks () const
 
QSet< REntity::IdqueryAllEntities (bool undone, bool allBlocks, QList< RS::EntityType > types) const
 
QSet< REntity::IdqueryAllEntities (bool undone=false, bool allBlocks=false, RS::EntityType type=RS::EntityAll) const
 Queries all entities of this document. More...
 
QSet< RLayer::IdqueryAllLayers () const
 Queries all layers of this document. More...
 
QSet< RLayerState::IdqueryAllLayerStates () const
 Queries all layer state objects of this document. More...
 
QSet< RBlock::IdqueryAllLayoutBlocks (bool includeModelSpace=false) const
 
QSet< RBlock::IdqueryAllLayouts () const
 
QSet< RLinetype::IdqueryAllLinetypes () const
 
QSet< RObject::IdqueryAllObjects () const
 Queries all objects of this document. More...
 
QSet< RUcs::IdqueryAllUcs () const
 Queries all UCSs of this document. More...
 
QSet< REntity::IdqueryAllViewports () const
 
QSet< RView::IdqueryAllViews () const
 
QSet< REntity::IdqueryAllVisibleEntities () const
 
QSharedPointer< RBlockqueryBlock (const QString &blockName) const
 Queries the block with the given name. More...
 
QSharedPointer< RBlockqueryBlock (RBlock::Id blockId) const
 Queries the block with the given ID. More...
 
QSharedPointer< RBlockqueryBlockDirect (const QString &blockName) const
 Queries the block with the given name direct (no cloning). More...
 
QSharedPointer< RBlockqueryBlockDirect (RBlock::Id blockId) const
 Queries the block with the given ID direct (no cloning). More...
 
QSet< REntity::IdqueryBlockEntities (RBlock::Id blockId) const
 
QSet< REntity::IdqueryBlockReferences (RBlock::Id blockId) const
 
QSet< REntity::IdqueryChildEntities (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::IdqueryConnectedEntities (REntity::Id entityId, double tolerance=RS::PointTolerance, RLayer::Id layerId=RLayer::INVALID_ID)
 
QSet< REntity::IdqueryContainedEntities (const RBox &box) const
 Queries all entities which are completely inside the given box. More...
 
QSet< REntity::IdqueryContainedEntitiesXY (const RBox &box) const
 
QSharedPointer< RBlockqueryCurrentBlock ()
 
QSharedPointer< RLayerqueryCurrentLayer ()
 
QSharedPointer< RViewqueryCurrentView ()
 
QSharedPointer< RDocumentVariablesqueryDocumentVariables () const
 
QSharedPointer< RDocumentVariablesqueryDocumentVariablesDirect () const
 
QSharedPointer< REntityqueryEntity (REntity::Id entityId) const
 Queries the entity with the given ID. More...
 
QSharedPointer< REntityqueryEntityDirect (REntity::Id entityId) const
 Queries the entity with the given ID. More...
 
QSet< REntity::IdqueryInfiniteEntities () const
 
QSet< REntity::IdqueryIntersectedEntitiesXY (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::IdqueryIntersectedEntitiesXYFast (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::IdqueryIntersectedShapesXYFast (const RBox &box, bool noInfiniteEntities=false)
 
QSharedPointer< RLayerqueryLayer (const QString &layerName) const
 Queries the layer with the given name. More...
 
QSharedPointer< RLayerqueryLayer (RLayer::Id layerId) const
 Queries the layer with the given ID. More...
 
QSet< REntity::IdqueryLayerBlockEntities (RLayer::Id layerId, RBlock::Id blockId) const
 
QSharedPointer< RLayerqueryLayerDirect (RLayer::Id layerId) const
 Queries the layer with the given ID direct (no cloning). More...
 
QSet< REntity::IdqueryLayerEntities (RLayer::Id layerId, bool allBlocks=false) const
 
QSharedPointer< RLayerStatequeryLayerState (const QString &layerStateName) const
 Queries the layer state with the given name. More...
 
QSharedPointer< RLayerStatequeryLayerState (RLayerState::Id layerStateId) const
 Queries the layer state with the given ID. More...
 
QSharedPointer< RLayerStatequeryLayerStateDirect (RLayerState::Id layerStateId) const
 Queries the layer state with the given ID direct (no cloning). More...
 
QSharedPointer< RLayoutqueryLayout (const QString &layoutName) const
 Queries the layout with the given name. More...
 
QSharedPointer< RLayoutqueryLayout (RLayout::Id layoutId) const
 Queries the layout with the given ID. More...
 
QSharedPointer< RLayoutqueryLayoutDirect (RLayout::Id layoutId) const
 Queries the layout with the given ID direct (no cloning). More...
 
QSharedPointer< RLinetypequeryLinetype (const QString &linetypeName) const
 Queries the linetype with the given name. More...
 
QSharedPointer< RLinetypequeryLinetype (RLinetype::Id linetypeId) const
 Queries the linetype with the given ID. More...
 
QSharedPointer< RObjectqueryObject (RObject::Id objectId) const
 Queries the object with the given ID. More...
 
QSharedPointer< RObjectqueryObjectByHandle (RObject::Handle objectHandle) const
 
QSharedPointer< RObjectqueryObjectDirect (RObject::Id objectId) const
 Queries the object with the given ID. More...
 
QSet< RObject::IdqueryPropertyEditorObjects ()
 
QSet< REntity::IdquerySelectedEntities () const
 Queries all selected entities. More...
 
QSet< RObject::IdquerySelectedLayers () const
 Queries all selected objects. More...
 
QSharedPointer< RUcsqueryUcs (const QString &ucsName) const
 Queries the UCS with the given name. More...
 
QSharedPointer< RUcsqueryUcs (RUcs::Id ucsId) const
 Queries the UCS with the given ID. More...
 
QSharedPointer< RViewqueryView (const QString &viewName) const
 Queries the view with the given name. More...
 
QSharedPointer< RViewqueryView (RView::Id viewId) const
 Queries the view with the given ID. More...
 
QSharedPointer< REntityqueryVisibleEntityDirect (REntity::Id entityId) const
 
QSet< REntity::IdqueryWorkingSetEntities () 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< RTransactionredo ()
 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::IdsortBlocks (const QList< RBlock::Id > &blockIds) const
 
QList< RLayer::IdsortLayers (const QList< RLayer::Id > &layerIds) const
 
void startTransactionGroup ()
 
QString substituteAutoVariables (const QString &expression)
 
QList< RTransactionundo ()
 Undoes the last transaction. More...
 
void unsetCurrentViewport ()
 
void updateAllEntities ()
 
virtual ~RDocument ()
 
- Public Member Functions inherited from RRequireHeap
void doDelete ()
 

Static Public Member Functions

static RDocumentgetClipboard ()
 

Static Protected Attributes

static RDocumentclipboard = 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
 
RSpatialIndexspatialIndex
 
QMap< RBlock::Id, RSpatialIndex * > spatialIndicesByBlock
 
RStoragestorage
 
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 ()
 

Detailed Description

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.

Scriptable:\nThis class is available in script environments.\n

Constructor & Destructor Documentation

◆ RDocument()

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.

◆ ~RDocument()

RDocument::~RDocument ( )
virtual

Member Function Documentation

◆ addAutoVariable()

QString RDocument::addAutoVariable ( double  value)

◆ addBlockToSpatialIndex()

bool RDocument::addBlockToSpatialIndex ( RBlock::Id  blockId,
RObject::Id  ignoreBlockId 
)

Add block references that point to blockId, unless they also point to ignoreBlockId.

◆ addToSpatialIndex()

void RDocument::addToSpatialIndex ( QSharedPointer< REntity entity)

◆ blockContainsReferences()

bool RDocument::blockContainsReferences ( RBlock::Id  blockId,
RBlock::Id  referencedBlockId 
)

◆ clear()

void RDocument::clear ( bool  beforeLoad = false)

Resets this document to its initial, empty state.

◆ clearSelection()

void RDocument::clearSelection ( QSet< REntity::Id > *  affectedEntities = NULL)
Todo:
refactoring to operation

Deselectes all selected entities.

◆ clearSpatialIndices()

void RDocument::clearSpatialIndices ( )

◆ copyVariablesFrom()

void RDocument::copyVariablesFrom ( const RDocument other)

◆ countSelectedEntities()

int RDocument::countSelectedEntities ( ) const

Returns
Number of selected entities.

◆ deselectEntities()

int RDocument::deselectEntities ( const QSet< REntity::Id > &  entityIds,
QSet< REntity::Id > *  affectedEntities = NULL 
)

Deselects all entities with the given IDs.

Todo:
refactoring to operation
Parameters
affectedOptional 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.

◆ deselectEntity()

void RDocument::deselectEntity ( REntity::Id  entityId,
QSet< REntity::Id > *  affectedEntities = NULL 
)

Deselects the entity with the given ID.

Parameters
affectedOptional 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.

◆ dump()

void RDocument::dump ( )

◆ eval()

double RDocument::eval ( const QString &  expression,
bool *  ok = NULL 
)

◆ formatAngle()

QString RDocument::formatAngle ( double  value)

◆ formatLinear()

QString RDocument::formatLinear ( double  value)

◆ getAngleFormat()

RS::AngleFormat RDocument::getAngleFormat ( )
Returns
The angle format type for this document. This is determined by the variable "$DIMAUNIT".

◆ getAnglePrecision()

int RDocument::getAnglePrecision ( )
Returns
The angular precision for this document. This is determined by the variable "$DIMADEC".

◆ getAutoTransactionGroup()

bool RDocument::getAutoTransactionGroup ( ) const
inline

◆ getAutoVariables()

QStringList RDocument::getAutoVariables ( ) const

◆ getBlockId()

RBlock::Id RDocument::getBlockId ( const QString &  blockName) const

◆ getBlockIdAuto()

RBlock::Id RDocument::getBlockIdAuto ( const QString &  blockLayoutName) const

◆ getBlockName()

QString RDocument::getBlockName ( RBlock::Id  blockId) const

◆ getBlockNameFromLayout() [1/2]

QString RDocument::getBlockNameFromLayout ( const QString &  layoutName) const

◆ getBlockNameFromLayout() [2/2]

QString RDocument::getBlockNameFromLayout ( RLayout::Id  layoutId) const

◆ getBlockNames()

QSet< QString > RDocument::getBlockNames ( const QString &  rxStr = RDEFAULT_QSTRING) const

◆ getBoundingBox()

RBox RDocument::getBoundingBox ( bool  ignoreHiddenLayers = true,
bool  ignoreEmpty = false 
) const

Returns
The bounding box around all visible entities.

◆ getClipboard()

RDocument & RDocument::getClipboard ( )
static

◆ getCurrentBlockId()

RBlock::Id RDocument::getCurrentBlockId ( ) const

◆ getCurrentBlockName()

QString RDocument::getCurrentBlockName ( ) const

◆ getCurrentColor()

RColor RDocument::getCurrentColor ( ) const

◆ getCurrentLayerId()

RLayer::Id RDocument::getCurrentLayerId ( ) const

◆ getCurrentLayerName()

QString RDocument::getCurrentLayerName ( ) const

◆ getCurrentLinetypeId()

RLinetype::Id RDocument::getCurrentLinetypeId ( ) const

◆ getCurrentLinetypePattern()

RLinetypePattern RDocument::getCurrentLinetypePattern ( ) const

◆ getCurrentLineweight()

RLineweight::Lineweight RDocument::getCurrentLineweight ( ) const

◆ getCurrentViewId()

RView::Id RDocument::getCurrentViewId ( ) const

◆ getCurrentViewportId()

RObject::Id RDocument::getCurrentViewportId ( )

◆ getDecimalSeparator()

char RDocument::getDecimalSeparator ( )
Returns
The decimal separator for this document. This is determined by the variable "$DIMDSEP". 0 means '.'.

◆ getDefaultLinetypes()

QList< QSharedPointer< RObject > > RDocument::getDefaultLinetypes ( )

◆ getDimensionFont()

QString RDocument::getDimensionFont ( ) const

◆ getEntitiesBox()

RBox RDocument::getEntitiesBox ( QSet< REntity::Id > &  ids) const

◆ getFileName()

QString RDocument::getFileName ( ) const

◆ getFileVersion()

QString RDocument::getFileVersion ( ) const

◆ getKnownVariable()

QVariant RDocument::getKnownVariable ( RS::KnownVariable  key,
const QVariant &  defaultValue = RDEFAULT_QVARIANT 
) const

Returns
Value for the given DXF/DWG variable.

◆ getLastModified()

QString RDocument::getLastModified ( ) const

◆ getLastModifiedDateTime()

QDateTime RDocument::getLastModifiedDateTime ( ) const

Non-Scriptable:\nThis function is not available in script environments.\n

◆ getLayer0Id()

RLayer::Id RDocument::getLayer0Id ( ) const

◆ getLayerId()

RLayer::Id RDocument::getLayerId ( const QString &  layerName) const

◆ getLayerName()

QString RDocument::getLayerName ( RLayer::Id  layerId) const

◆ getLayerNames()

QSet< QString > RDocument::getLayerNames ( const QString &  rxStr = RDEFAULT_QSTRING) const

◆ getLayerStateId()

RLayerState::Id RDocument::getLayerStateId ( const QString &  layerStateName) const

◆ getLayerStateName()

QString RDocument::getLayerStateName ( RLayerState::Id  layerStateId) const

◆ getLayerStateNames()

QSet< QString > RDocument::getLayerStateNames ( const QString &  rxStr = RDEFAULT_QSTRING) const

◆ getLayoutName()

QString RDocument::getLayoutName ( RLayout::Id  layoutId) const

◆ getLinearFormat()

RS::LinearFormat RDocument::getLinearFormat ( ) const
Returns
The linear format type for this document. This is determined by the variable "$DIMLUNIT".

◆ getLinearPrecision()

int RDocument::getLinearPrecision ( )
Returns
The linear precision for this document. This is determined by the variable "$DIMDEC".

◆ getLinetypeByBlockId()

RLinetype::Id RDocument::getLinetypeByBlockId ( ) const
inline

◆ getLinetypeByLayerId()

RLinetype::Id RDocument::getLinetypeByLayerId ( ) const
inline

◆ getLinetypeDescription()

QString RDocument::getLinetypeDescription ( RLinetype::Id  linetypeId) const

Returns
User readable description for the given linetype.

◆ getLinetypeId()

RLinetype::Id RDocument::getLinetypeId ( const QString &  linetypeName) const

Returns
Linetype ID of the given linetype name or RObject::INVALID_ID.

◆ getLinetypeLabel()

QString RDocument::getLinetypeLabel ( RLinetype::Id  linetypeId) const

Returns
User readable label for the given linetype.

◆ getLinetypeName()

QString RDocument::getLinetypeName ( RLinetype::Id  linetypeId) const

Returns
Linetype name of the given linetype.

◆ getLinetypeNames()

QSet< QString > RDocument::getLinetypeNames ( ) const

Returns
List of all available linetype pattern names in this document.

◆ getLinetypePatterns()

QList< RLinetypePattern > RDocument::getLinetypePatterns ( ) const

Returns
List of all available linetype patterns in this document.

◆ getLinetypeScale()

double RDocument::getLinetypeScale ( ) const

◆ getMaxLineweight()

RLineweight::Lineweight RDocument::getMaxLineweight ( ) const

◆ getMeasurement()

RS::Measurement RDocument::getMeasurement ( ) const

◆ getModelSpaceBlockId()

RBlock::Id RDocument::getModelSpaceBlockId ( ) const

◆ getSelectionBox()

RBox RDocument::getSelectionBox ( ) const

◆ getSpatialIndex() [1/2]

RSpatialIndex & RDocument::getSpatialIndex ( )
Returns
Reference to the spatial index.

◆ getSpatialIndex() [2/2]

const RSpatialIndex & RDocument::getSpatialIndex ( ) const

◆ getSpatialIndexForBlock()

RSpatialIndex * RDocument::getSpatialIndexForBlock ( RBlock::Id  blockId) const

◆ getSpatialIndexForCurrentBlock()

RSpatialIndex * RDocument::getSpatialIndexForCurrentBlock ( ) const

◆ getStorage() [1/2]

RStorage & RDocument::getStorage ( )
Returns
Reference to storage that backs the document.

◆ getStorage() [2/2]

const RStorage & RDocument::getStorage ( ) const

◆ getTempBlockName()

QString RDocument::getTempBlockName ( ) const

◆ getTransactionGroup()

int RDocument::getTransactionGroup ( ) const

◆ getTransactionStack()

RTransactionStack & RDocument::getTransactionStack ( )
Returns
Reference to the transaction stack for undo/redo handling.

◆ getUnit()

RS::Unit RDocument::getUnit ( ) const

◆ getVariable()

QVariant RDocument::getVariable ( const QString &  key,
const QVariant &  defaultValue = RDEFAULT_QVARIANT,
bool  useSettings = false 
) const

Returns
The value of the given variable or an invalid variant if the variable does not exist.

◆ getVariables()

QStringList RDocument::getVariables ( ) const

Returns
List of custom variable names stored in this document.

◆ getViewNames()

QSet< QString > RDocument::getViewNames ( ) const

◆ hasBlock()

bool RDocument::hasBlock ( const QString &  blockName) const

◆ hasBlockEntities()

bool RDocument::hasBlockEntities ( RBlock::Id  blockId) const

Returns
True if the given block contains any entities.

◆ hasChildEntities()

bool RDocument::hasChildEntities ( REntity::Id  parentId) const

◆ hasCurrentViewport()

bool RDocument::hasCurrentViewport ( )

◆ hasLayer()

bool RDocument::hasLayer ( const QString &  layerName) const

◆ hasLayerState()

bool RDocument::hasLayerState ( const QString &  layerStateName) const

◆ hasLayerStates()

bool RDocument::hasLayerStates ( ) const

◆ hasLayout()

bool RDocument::hasLayout ( const QString &  layoutName) const

◆ hasLinetype()

bool RDocument::hasLinetype ( const QString &  linetypeName) const

◆ hasSelection()

bool RDocument::hasSelection ( ) const

Returns
True if at least one entity is selected in this storage.

◆ hasVariable()

bool RDocument::hasVariable ( const QString &  key) const

Returns
True if the given variable exists in this storage.

◆ hasView()

bool RDocument::hasView ( const QString &  viewName) const

◆ init()

void RDocument::init ( bool  beforeLoad = false)

◆ initLinetypes()

void RDocument::initLinetypes ( RTransaction transaction = NULL)

◆ isBlockFrozen()

bool RDocument::isBlockFrozen ( RBlock::Id  blockId) const

Returns
True if the given block is frozen.

◆ isByBlock()

bool RDocument::isByBlock ( RLinetype::Id  linetypeId) const

◆ isByLayer()

bool RDocument::isByLayer ( RLinetype::Id  linetypeId) const

◆ isEditingWorkingSet()

bool RDocument::isEditingWorkingSet ( ) const

◆ isEntityEditable()

bool RDocument::isEntityEditable ( REntity::Id  entityId) const

◆ isEntityLayerFrozen()

bool RDocument::isEntityLayerFrozen ( REntity::Id  entityId) const

◆ isEntityVisible()

bool RDocument::isEntityVisible ( const REntity entity,
RBlock::Id  blockId = RBlock::INVALID_ID 
) const

Returns
True if the given entity is visible in the context of the given block or the current block (default).

◆ isLayerFrozen() [1/2]

bool RDocument::isLayerFrozen ( const RLayer layer) const

Returns
True if this layer or one of its parent layers are frozen.

◆ isLayerFrozen() [2/2]

bool RDocument::isLayerFrozen ( RLayer::Id  layerId) const

Returns
True if this layer or one of its parent layers are frozen.

◆ isLayerLocked() [1/2]

bool RDocument::isLayerLocked ( const RLayer layer) const

◆ isLayerLocked() [2/2]

bool RDocument::isLayerLocked ( RLayer::Id  layerId) const

◆ isLayerOff() [1/2]

bool RDocument::isLayerOff ( const RLayer layer) const

Returns
True if this layer is off.

◆ isLayerOff() [2/2]

bool RDocument::isLayerOff ( RLayer::Id  layerId) const

Returns
True if this layer is off.

◆ isLayerOffOrFrozen() [1/2]

bool RDocument::isLayerOffOrFrozen ( const RLayer layer) const

Returns
True if this layer is off or frozen.

◆ isLayerOffOrFrozen() [2/2]

bool RDocument::isLayerOffOrFrozen ( RLayer::Id  layerId) const

Returns
True if this layer is off or frozen.

◆ isLayerPlottable() [1/2]

bool RDocument::isLayerPlottable ( const RLayer layer) const

Returns
True if this layer and its parent layers are plottable.

◆ isLayerPlottable() [2/2]

bool RDocument::isLayerPlottable ( RLayer::Id  layerId) const

Returns
True if this layer and its parent layers are plottable.

◆ isLayerSnappable() [1/2]

bool RDocument::isLayerSnappable ( const RLayer layer) const

Returns
True if this layer and its parent layers are snappable.

◆ isLayerSnappable() [2/2]

bool RDocument::isLayerSnappable ( RLayer::Id  layerId) const

Returns
True if this layer and its parent layers are snappable.

◆ isLayoutBlock()

bool RDocument::isLayoutBlock ( RBlock::Id  blockId) const

Returns
True if the given block is a layout block (i.e. paper space block).

◆ isMetric()

bool RDocument::isMetric ( ) const

◆ isModified()

bool RDocument::isModified ( ) const

Returns
True if the document has unsaved changes.

◆ isParentLayerFrozen() [1/2]

bool RDocument::isParentLayerFrozen ( const RLayer layer) const

Returns
True if a parent layer of the given layer is frozen.

◆ isParentLayerFrozen() [2/2]

bool RDocument::isParentLayerFrozen ( RLayer::Id  layerId) const

Returns
True if a parent layer of the given layer is frozen.

◆ isParentLayerLocked() [1/2]

bool RDocument::isParentLayerLocked ( const RLayer layer) const

Returns
True if a parent layer of the given layer is locked.

◆ isParentLayerLocked() [2/2]

bool RDocument::isParentLayerLocked ( RLayer::Id  layerId) const

Returns
True if a parent layer of the given layer is locked.

◆ isParentLayerPlottable() [1/2]

bool RDocument::isParentLayerPlottable ( const RLayer layer) const

Returns
True if a parent layer of the given layer is plottable.

◆ isParentLayerPlottable() [2/2]

bool RDocument::isParentLayerPlottable ( RLayer::Id  layerId) const

Returns
True if a parent layer of the given layer is plottable.

◆ isParentLayerSnappable() [1/2]

bool RDocument::isParentLayerSnappable ( const RLayer layer) const

Returns
True if a parent layer of the given layer is snappable.

◆ isParentLayerSnappable() [2/2]

bool RDocument::isParentLayerSnappable ( RLayer::Id  layerId) const

Returns
True if a parent layer of the given layer is snappable.

◆ isRedoAvailable()

bool RDocument::isRedoAvailable ( ) const

◆ isSelected()

bool RDocument::isSelected ( REntity::Id  entityId)

◆ isSelectedWorkingSet()

bool RDocument::isSelectedWorkingSet ( REntity::Id  entityId)

◆ isUndoAvailable()

bool RDocument::isUndoAvailable ( ) const

◆ queryAllBlockReferences()

QSet< REntity::Id > RDocument::queryAllBlockReferences ( ) const

Returns
A set of all block reference entity IDs.

◆ queryAllBlocks()

QSet< RBlock::Id > RDocument::queryAllBlocks ( ) const

Returns
A set of all block IDs of the document.

◆ queryAllEntities() [1/2]

QSet< REntity::Id > RDocument::queryAllEntities ( bool  undone,
bool  allBlocks,
QList< RS::EntityType types 
) const

Returns
A set of all entity IDs of the document.

◆ queryAllEntities() [2/2]

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.

Returns
Set of entity IDs.

◆ queryAllLayers()

QSet< RLayer::Id > RDocument::queryAllLayers ( ) const

Queries all layers of this document.

Returns
Set of layer IDs.

◆ queryAllLayerStates()

QSet< RLayer::Id > RDocument::queryAllLayerStates ( ) const

Queries all layer state objects of this document.

Returns
Set of layer state IDs.

◆ queryAllLayoutBlocks()

QSet< RBlock::Id > RDocument::queryAllLayoutBlocks ( bool  includeModelSpace = false) const

Returns
A set of all block IDs of layout blocks of the document.

◆ queryAllLayouts()

QSet< RLayout::Id > RDocument::queryAllLayouts ( ) const

Returns
A set of all layout IDs of layouts of the document.

◆ queryAllLinetypes()

QSet< RLinetype::Id > RDocument::queryAllLinetypes ( ) const

Returns
A set of all linetype IDs of the document.

◆ queryAllObjects()

QSet< RObject::Id > RDocument::queryAllObjects ( ) const

Queries all objects of this document.

Returns
Set of object IDs.

◆ queryAllUcs()

QSet< RUcs::Id > RDocument::queryAllUcs ( ) const

Queries all UCSs of this document.

Returns
Set of UCS IDs.

◆ queryAllViewports()

QSet< REntity::Id > RDocument::queryAllViewports ( ) const

Returns
A set of all viewport entity IDs.

◆ queryAllViews()

QSet< RView::Id > RDocument::queryAllViews ( ) const

Returns
A set of all view IDs of the document.

◆ queryAllVisibleEntities()

QSet< REntity::Id > RDocument::queryAllVisibleEntities ( ) const

◆ queryBlock() [1/2]

QSharedPointer< RBlock > RDocument::queryBlock ( const QString &  blockName) const

Queries the block with the given name.

Returns
Pointer to the block or NULL.

◆ queryBlock() [2/2]

QSharedPointer< RBlock > RDocument::queryBlock ( RBlock::Id  blockId) const

Queries the block with the given ID.

Returns
Pointer to the block or NULL.

◆ queryBlockDirect() [1/2]

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.

Returns
Pointer to the block or NULL.

◆ queryBlockDirect() [2/2]

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.

Returns
Pointer to the block or NULL.

◆ queryBlockEntities()

QSet< REntity::Id > RDocument::queryBlockEntities ( RBlock::Id  blockId) const

Returns
A set of all entity IDs that are part of the given block.

◆ queryBlockReferences()

QSet< REntity::Id > RDocument::queryBlockReferences ( RBlock::Id  blockId) const

Returns
A set of all block reference entity IDs that reference the given block.

◆ queryChildEntities()

QSet< REntity::Id > RDocument::queryChildEntities ( REntity::Id  parentId,
RS::EntityType  type = RS::EntityAll 
) const

Returns
A set of all block attributes which are not stored in the block definition but as separate entities on the same level as the block reference.

◆ queryClosestXY() [1/2]

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).

Parameters
wcsPositionThe position to which the entity has to be close (2d).
rangeThe range in which to search.

◆ queryClosestXY() [2/2]

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.

Parameters
candidatesSets of candidates to consider.
wcsPosition
rangeMaximum distance between position and entity.

◆ queryConnectedEntities()

QSet< REntity::Id > RDocument::queryConnectedEntities ( REntity::Id  entityId,
double  tolerance = RS::PointTolerance,
RLayer::Id  layerId = RLayer::INVALID_ID 
)

◆ queryContainedEntities()

QSet< REntity::Id > RDocument::queryContainedEntities ( const RBox box) const

Queries all entities which are completely inside the given box.

Parameters
boxQuery box.
resultSet of IDs of entities that are completely inside the given area.

◆ queryContainedEntitiesXY()

QSet< REntity::Id > RDocument::queryContainedEntitiesXY ( const RBox box) const

◆ queryCurrentBlock()

QSharedPointer< RBlock > RDocument::queryCurrentBlock ( )

◆ queryCurrentLayer()

QSharedPointer< RLayer > RDocument::queryCurrentLayer ( )

◆ queryCurrentView()

QSharedPointer< RView > RDocument::queryCurrentView ( )

◆ queryDocumentVariables()

QSharedPointer< RDocumentVariables > RDocument::queryDocumentVariables ( ) const

◆ queryDocumentVariablesDirect()

QSharedPointer< RDocumentVariables > RDocument::queryDocumentVariablesDirect ( ) const

◆ queryEntity()

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.

Returns
Pointer to the entity or NULL.

◆ queryEntityDirect()

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.

Returns
Pointer to the entity or NULL.

◆ queryInfiniteEntities()

QSet< REntity::Id > RDocument::queryInfiniteEntities ( ) const

◆ queryIntersectedEntitiesXY()

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

◆ queryIntersectedEntitiesXYFast()

QSet< REntity::Id > RDocument::queryIntersectedEntitiesXYFast ( const RBox box)

◆ queryIntersectedShapesXY()

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

◆ queryIntersectedShapesXYFast()

QSet< REntity::Id > RDocument::queryIntersectedShapesXYFast ( const RBox box,
bool  noInfiniteEntities = false 
)

◆ queryLayer() [1/2]

QSharedPointer< RLayer > RDocument::queryLayer ( const QString &  layerName) const

Queries the layer with the given name.

Returns
Pointer to the layer or NULL.

◆ queryLayer() [2/2]

QSharedPointer< RLayer > RDocument::queryLayer ( RLayer::Id  layerId) const

Queries the layer with the given ID.

Returns
Pointer to the layer or NULL.

◆ queryLayerBlockEntities()

QSet< REntity::Id > RDocument::queryLayerBlockEntities ( RLayer::Id  layerId,
RBlock::Id  blockId 
) const

◆ queryLayerDirect()

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.

Returns
Pointer to the layer or NULL.

◆ queryLayerEntities()

QSet< REntity::Id > RDocument::queryLayerEntities ( RLayer::Id  layerId,
bool  allBlocks = false 
) const

Returns
A set of all entity IDs on the given layer.

◆ queryLayerState() [1/2]

QSharedPointer< RLayerState > RDocument::queryLayerState ( const QString &  layerStateName) const

Queries the layer state with the given name.

Returns
Pointer to the layer state or NULL.

◆ queryLayerState() [2/2]

QSharedPointer< RLayerState > RDocument::queryLayerState ( RLayerState::Id  layerStateId) const

Queries the layer state with the given ID.

Returns
Pointer to the layer state or NULL.

◆ queryLayerStateDirect()

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.

Returns
Pointer to the layer state or NULL.

◆ queryLayout() [1/2]

QSharedPointer< RLayout > RDocument::queryLayout ( const QString &  layoutName) const

Queries the layout with the given name.

Returns
Pointer to the layout or NULL.

◆ queryLayout() [2/2]

QSharedPointer< RLayout > RDocument::queryLayout ( RLayout::Id  layoutId) const

Queries the layout with the given ID.

Returns
Pointer to the layout or NULL.

◆ queryLayoutDirect()

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.

Returns
Pointer to the layout or NULL.

◆ queryLinetype() [1/2]

QSharedPointer< RLinetype > RDocument::queryLinetype ( const QString &  linetypeName) const

Queries the linetype with the given name.

Returns
Pointer to the linetype or NULL.

◆ queryLinetype() [2/2]

QSharedPointer< RLinetype > RDocument::queryLinetype ( RLinetype::Id  linetypeId) const

Queries the linetype with the given ID.

Returns
Pointer to the linetype or NULL.

◆ queryObject()

QSharedPointer< RObject > RDocument::queryObject ( RObject::Id  objectId) const

Queries the object with the given ID.

Returns
Shared pointer to the object or a null pointer.

◆ queryObjectByHandle()

QSharedPointer< RObject > RDocument::queryObjectByHandle ( RObject::Handle  objectHandle) const

◆ queryObjectDirect()

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.

Returns
Pointer to the object or NULL.

◆ queryPropertyEditorObjects()

QSet< RObject::Id > RDocument::queryPropertyEditorObjects ( )

◆ querySelectedEntities()

QSet< REntity::Id > RDocument::querySelectedEntities ( ) const

Queries all selected entities.

Returns
Set of IDs of all selected entities.

◆ querySelectedLayers()

QSet< RObject::Id > RDocument::querySelectedLayers ( ) const

Queries all selected objects.

Returns
Set of IDs of all selected objects.

◆ queryUcs() [1/2]

QSharedPointer< RUcs > RDocument::queryUcs ( const QString &  ucsName) const

Queries the UCS with the given name.

Returns
Pointer to the UCS or NULL.

◆ queryUcs() [2/2]

QSharedPointer< RUcs > RDocument::queryUcs ( RUcs::Id  ucsId) const

Queries the UCS with the given ID.

Returns
Pointer to the UCS or NULL.

◆ queryView() [1/2]

QSharedPointer< RView > RDocument::queryView ( const QString &  viewName) const

Queries the view with the given name.

Returns
Pointer to the view or NULL.

◆ queryView() [2/2]

QSharedPointer< RView > RDocument::queryView ( RView::Id  viewId) const

Queries the view with the given ID.

Returns
Pointer to the view or NULL.

◆ queryVisibleEntityDirect()

QSharedPointer< REntity > RDocument::queryVisibleEntityDirect ( REntity::Id  entityId) const

◆ queryWorkingSetEntities()

QSet< REntity::Id > RDocument::queryWorkingSetEntities ( ) const

Returns
A set of all entity IDs in the current working set.

◆ rebuildSpatialIndex()

void RDocument::rebuildSpatialIndex ( )
virtual

Rebuilds the entire spatial index from scratch (e.g.

when current block is changed).

◆ redo()

QList< RTransaction > RDocument::redo ( )

Redoes a previously undone transaction.

Returns
Set of affected entity IDs. Higher level callers can use this set to update scenes, views, etc accordingly.

◆ removeBlockFromSpatialIndex()

void RDocument::removeBlockFromSpatialIndex ( RBlock::Id  blockId)

◆ removeFromSpatialIndex()

void RDocument::removeFromSpatialIndex ( QSharedPointer< REntity entity,
const QList< RBox > &  boundingBoxes = RDEFAULT_QLIST_RBOX 
)
virtual

◆ removeVariable()

void RDocument::removeVariable ( const QString &  key)

Removes the custom variable with the given key.

◆ resetTransactionStack()

void RDocument::resetTransactionStack ( )

◆ selectAllEntities()

void RDocument::selectAllEntities ( QSet< REntity::Id > *  affectedEntities = NULL)

Selects all not selected entities.

◆ selectEntities()

int RDocument::selectEntities ( const QSet< REntity::Id > &  entityIds,
bool  add = false,
QSet< REntity::Id > *  affectedEntities = NULL 
)

Selects all entities with the given IDs.

Todo:
refactoring to operation
Parameters
addTrue to add the entities to the current selection. False to replace the current selection with the new entities.
affectedOptional 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.

◆ selectEntity()

void RDocument::selectEntity ( REntity::Id  entityId,
bool  add = false,
QSet< REntity::Id > *  affectedEntities = NULL 
)

Selects the entity with the given ID.

Todo:
refactoring to operation
Parameters
addTrue to add the entity to the current selection. False to replace the current selection with the given entity.
affectedOptional 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.

◆ setAutoTransactionGroup()

void RDocument::setAutoTransactionGroup ( bool  on)
inline

True: add all operations to the current transaction group.

◆ setCurrentBlock() [1/2]

void RDocument::setCurrentBlock ( const QString &  blockName)

◆ setCurrentBlock() [2/2]

void RDocument::setCurrentBlock ( RBlock::Id  blockId)

◆ setCurrentColor()

void RDocument::setCurrentColor ( const RColor color)

◆ setCurrentLayer() [1/2]

void RDocument::setCurrentLayer ( const QString &  layerName,
RTransaction transaction = NULL 
)

◆ setCurrentLayer() [2/2]

void RDocument::setCurrentLayer ( RLayer::Id  layerId,
RTransaction transaction = NULL 
)

◆ setCurrentLinetype() [1/2]

void RDocument::setCurrentLinetype ( const QString &  name)

◆ setCurrentLinetype() [2/2]

void RDocument::setCurrentLinetype ( RLinetype::Id  ltId)

◆ setCurrentLinetypePattern()

void RDocument::setCurrentLinetypePattern ( const RLinetypePattern p)

◆ setCurrentLineweight()

void RDocument::setCurrentLineweight ( RLineweight::Lineweight  lw)

◆ setCurrentView() [1/2]

void RDocument::setCurrentView ( const QString &  viewName)

◆ setCurrentView() [2/2]

void RDocument::setCurrentView ( RView::Id  viewId)

◆ setCurrentViewport()

void RDocument::setCurrentViewport ( RObject::Id  viewportId)

◆ setDimensionFont()

void RDocument::setDimensionFont ( const QString &  f,
RTransaction transaction = NULL 
)

◆ setFileName()

void RDocument::setFileName ( const QString &  fn)

◆ setFileVersion()

void RDocument::setFileVersion ( const QString &  fv)

◆ setIgnoreWorkingSet()

void RDocument::setIgnoreWorkingSet ( bool  on)

◆ setKnownVariable() [1/2]

void RDocument::setKnownVariable ( RS::KnownVariable  key,
const QVariant &  value,
RTransaction transaction = NULL 
)

Sets a known DXF/DWG variable for this document.

Parameters
keyVariable key (see DXF reference)
valueNew value of the variable.
transactionRTransaction to use for the change or NULL (default) to create a transaction on the fly.

◆ setKnownVariable() [2/2]

void RDocument::setKnownVariable ( RS::KnownVariable  key,
const RVector value,
RTransaction transaction = NULL 
)

Sets a known DXF/DWG variable for this document.

Parameters
keyVariable key (see DXF reference)
valueNew value of the variable.
transactionRTransaction to use for the change or NULL (default) to create a transaction on the fly.

◆ setLinearFormat()

void RDocument::setLinearFormat ( RS::LinearFormat  f)

◆ setLinetypeScale()

void RDocument::setLinetypeScale ( double  v,
RTransaction transaction = NULL 
)

Sets the global linetype scale of this document to the given value.

Parameters
transactionTransaction to use for the modification or NULL to create a local transaction (default).

◆ setMeasurement()

void RDocument::setMeasurement ( RS::Measurement  m,
RTransaction transaction = NULL 
)

◆ setModified()

void RDocument::setModified ( bool  m)

Resets the modified flag.

Modification time is stored.

◆ setUnit()

void RDocument::setUnit ( RS::Unit  unit,
RTransaction transaction = NULL 
)

◆ setVariable()

void RDocument::setVariable ( const QString &  key,
const QVariant &  value,
bool  overwrite = true 
)

Sets a custom variable in the context of this document.

Parameters
keyVariable key (name)
valueVariable value
overwriteTrue to overwrite an existing variable with the same key (default)

◆ showLeadingZeroes()

bool RDocument::showLeadingZeroes ( )

◆ showLeadingZeroesAngle()

bool RDocument::showLeadingZeroesAngle ( )

◆ showTrailingZeroes()

bool RDocument::showTrailingZeroes ( )

◆ showTrailingZeroesAngle()

bool RDocument::showTrailingZeroesAngle ( )

◆ sortBlocks()

QList< RBlock::Id > RDocument::sortBlocks ( const QList< RBlock::Id > &  blockIds) const

◆ sortLayers()

QList< RLayer::Id > RDocument::sortLayers ( const QList< RLayer::Id > &  layerIds) const

◆ startTransactionGroup()

void RDocument::startTransactionGroup ( )

◆ substituteAutoVariables()

QString RDocument::substituteAutoVariables ( const QString &  expression)

◆ undo()

QList< RTransaction > RDocument::undo ( )

Undoes the last transaction.

Returns
The transaction that was undone. Higher level callers can use this set to update scenes, views, etc accordingly.

◆ unsetCurrentViewport()

void RDocument::unsetCurrentViewport ( )

◆ updateAllEntities()

void RDocument::updateAllEntities ( )

Friends And Related Function Documentation

◆ operator<<

QDebug operator<< ( QDebug  dbg,
RDocument d 
)
friend

Stream operator for QDebug.

Non-Scriptable:\nThis function is not available in script environments.\n

Member Data Documentation

◆ autoTransactionGroup

bool RDocument::autoTransactionGroup
private

◆ clipboard

RDocument * RDocument::clipboard = NULL
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.

◆ disableSpatialIndicesByBlock

bool RDocument::disableSpatialIndicesByBlock
private

◆ fileName

QString RDocument::fileName
private

◆ fileVersion

QString RDocument::fileVersion
private

◆ linetypeByBlockId

RLinetype::Id RDocument::linetypeByBlockId
private

◆ linetypeByLayerId

RLinetype::Id RDocument::linetypeByLayerId
private

◆ spatialIndex

RSpatialIndex& RDocument::spatialIndex
private

◆ spatialIndicesByBlock

QMap<RBlock::Id, RSpatialIndex*> RDocument::spatialIndicesByBlock
mutableprivate

◆ storage

RStorage& RDocument::storage
private

◆ transactionStack

RTransactionStack RDocument::transactionStack
private

The documentation for this class was generated from the following files: