RDocumentInterface
Class in Core Module
Header: #include <src/core/RDocumentInterface.h>
Description
Section titled “Description”Interface for interaction between a graphics document and a user.
Typically one document interface exists for every document that is open in an MDI application. The document interface owns and links the various scenes, views and the currently active action.
A document interface can own multiple graphics scenes, each of which can have multiple views attached to it. The views forward all user events (mouse moves, mouse clicks, etc.) to the document interface for processing. The document interface dispatches the events to the currently active action object.
Scriptable: This class is available in script environments.
Public Types
Section titled “Public Types”| enum | IoErrorCode { IoErrorNoError, IoErrorNoImporterFound, IoErrorZeroSize, IoErrorNotFound, IoErrorPermission, IoErrorGeneralImportError, IoErrorGeneralImportUrlError } |
Public Functions
Section titled “Public Functions”RDocumentInterface(RDocument &document) |
|
~RDocumentInterface() |
|
| void | addAuxShapeToPreview(RShape &shape)Exports the given shape to the preview. |
| void | addBlockListener(RBlockListener *l) |
| void | addCoordinateListener(RCoordinateListener *l)Adds a listener for coordinate events. |
| void | addDrawableToPreview(RGraphicsSceneDrawable &drawable)Adds the given entity to the preview of all scenes / view. |
| void | addLayerListener(RLayerListener *l) |
| void | addShapeToPreview(RShape &shape, const RColor &color, const QBrush &brush, RLineweight::Lineweight lineweight, Qt::PenStyle style, const QList< qreal > &dashValues=RDEFAULT_QLIST_QREAL) |
| int | addTransactionListener(RTransactionListener *l) |
| void | addZoomBoxToPreview(const RBox &box)Adds a box to the preview that represents a zoom box displayed while drawing a window to magnify an area. |
| RTransaction | applyOperation(ROperation *operation)Applies the given operation to the document. |
| void | autoZoom(int margin=RDEFAULT_MIN1)Auto zooms in the view that currently has the focus. |
| void | beginPreview()After calling this function, all exports go into the preview of the scene instead of the scene itself. |
| void | bindXRef(RBlock *block) |
| void | checkDirtyXRefs() |
| void | clear(bool beforeLoad=false)Resets the document to its original, empty state. |
| void | clearCaches()Clears cached variables to ensure they are re-initialized before the next use. |
| void | clearPreview()Clears the preview of all scenes. |
| void | clearProperties()Notifies all property listeners that no properties are relevant at this point. |
| void | clearSelection()Clears the current selection and updates the scenes / views accordingly. |
| void | commandEvent(RCommandEvent &event) |
| void | commandEventPreview(RCommandEvent &event) |
| void | coordinateEvent(RCoordinateEvent &event) |
| void | coordinateEventPreview(RCoordinateEvent &event) |
| void | deleteScenesWithoutViews()Deletes all registered scenes that have no view attached to them anymore. |
| void | deleteScriptHandler(const QString &extension) |
| void | deleteTerminatedActions()Deletes all actions that have been terminated. |
| void | deselectAll()De-select all entities, for convenience. |
| int | deselectEntities(const QSet< RObject::Id > &entityIds)Deselects the given entities and updates the scenes accordingly. |
| void | deselectEntity(RObject::Id entityId)Deselects the given entity and updates the scenes accordingly. |
| void | disableMouseTracking() |
| void | disableRegeneration() |
| void | disableUpdates() |
| void | enableMouseTracking() |
| void | enableRegeneration() |
| void | enableUpdates() |
| void | endPreview()After calling this function, all exports go into the scene again and not the preview anymore. |
| QVariant | eval(const QString &ext, const QString &script) |
| bool | exportFile(const QString &fileName, const QString &fileVersion=“”, bool resetModified=true) |
| void | flushRedo()Flush redoable transactions. |
| void | flushTransactions()Flush transactions. |
| RAction::ClickMode | getClickMode() |
| RObject::Id | getClosestEntity(const RVector &position, double range, double strictRange=RMAXDOUBLE, bool includeLockedLayers=true, bool selectedOnly=false, bool snappable=false) |
| RObject::Id | getClosestEntity(RInputEvent &event) |
| QString | getCorrectedFileName(const QString &fileName, const QString &fileVersion) |
| RAction * | getCurrentAction() |
| RColor | getCurrentColor() |
| RObject::Id | getCurrentLinetypeId() |
| RLinetypePattern | getCurrentLinetypePattern() |
| RLineweight::Lineweight | getCurrentLineweight() |
| RAction * | getCurrentStatefulAction() |
| RUcs | getCurrentUcs() |
| QString | getCurrentUcsName() |
| bool | getCursorOverride() const |
| RVector | getCursorPosition() const |
| RAction * | getDefaultAction() const |
| RDocument & | getDocument() |
| QList< RGraphicsScene * > | getGraphicsScenes() |
| RGraphicsScene * | getGraphicsSceneWithFocus() |
| RGraphicsView * | getGraphicsViewWithFocus() |
| RGraphicsView * | getLastKnownViewWithFocus() |
| RVector | getLastPosition() const |
| bool | getNotifyListeners() const |
| RVector | getRelativeZero() const |
| RScriptHandler * | getScriptHandler(const QString &extension) |
| RSnap * | getSnap()Gets the current snap object. |
| RSnapRestriction * | getSnapRestriction() |
| RSnap::Status | getSnapStatus() const |
| RStorage & | getStorage() |
| QImage | getThumbnail() const |
| bool | hasCurrentAction() const |
| bool | hasCurrentStatefulAction() const |
| bool | hasSelection() |
| void | highlightEntity(RObject::Id entityId)Highlights the given entity in all scenes. |
| void | highlightReferencePoint(const RRefPoint &position)Highlights the given reference point. |
| RDocumentInterface::IoErrorCode | importFile(const QString &fileName, const QString &nameFilter=“”, bool notify=true, const QVariantMap ¶ms=RDEFAULT_QVARIANTMAP)Imports the given file if there is a file importer registered for that file type. |
| RDocumentInterface::IoErrorCode | importUrl(const QUrl &url, const QString &nameFilter=“”, bool notify=true, const QVariantMap ¶ms=RDEFAULT_QVARIANTMAP) |
| bool | isClipboard() |
| bool | isDeleting() const |
| bool | isPreviewEmpty() |
| bool | isRelativeZeroLocked() const |
| bool | isScriptRunning() |
| bool | isSnapLocked() const |
| bool | isSuspended() |
| void | keepPreview()Makes sure that the current preview survives one mouse move. |
| void | keyPressEvent(QKeyEvent &event) |
| void | keyReleaseEvent(QKeyEvent &event) |
| void | killAllActions() |
| void | loadXRefs(const QSet< QString > &paths=RDEFAULT_QSET_QSTRING) |
| void | lockRelativeZero()Locks the position of the relative zero point. |
| void | lockSnap()Locks the current snap function so it should not be changed automatically to auto snap. |
| void | mouseDoubleClickEvent(RMouseEvent &event)Forwards the given mouse double click event to the current action. |
| void | mouseMoveEvent(RMouseEvent &event)Forwards the given mouse move event to the current action. |
| void | mousePressEvent(RMouseEvent &event)Forwards the given mouse press event to the current action. |
| void | mouseReleaseEvent(RMouseEvent &event)Forwards the given mouse release event to the current action. |
| void | notifyBlockListeners(RDocumentInterface *documentInterface) |
| void | notifyBlockListenersCurrentBlock(RDocumentInterface *documentInterface) |
| void | notifyCoordinateListeners()Notifies all coordinate listeners that the coordinate has changed to position. |
| void | notifyLayerListeners(QList< RObject::Id > &layerIds)Notifies local layer listeners only interested in layer events from this particular document. |
| void | notifyTransactionListeners(RTransaction *t)Notifies local transaction listeners only interested in transaction events from this particular document. |
| void | objectChangeEvent(RTransaction &transaction)Triggers an objectChangeEvent for every object in the given set. |
| void | panGestureEvent(QPanGesture &gesture)Forwards the given gesture to the current action. |
| void | pinchGestureEvent(QPinchGesture &gesture)Forwards the given gesture to the current action. |
| void | previewOperation(ROperation *operation)Previews the given operation by applying the operation to a temporary document that is linked to the (read only) document. |
| void | propertyChangeEvent(RPropertyEvent &event)Forwards the given event to the current action to signal that a property value has been changed. |
| void | queueAction(RAction *action) |
| void | redo()Transaction based redo. |
| void | regenerateScenes(bool undone=false, bool invisible=false)Regenerates all scenes attached to this document interface by exporting the document into them. |
| void | regenerateScenes(QSet< RObject::Id > &entityIds, bool updateViews) |
| void | regenerateScenes(RObject::Id entityId, bool updateViews)This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
| void | regenerateViews(bool force=false)Regenerates all views. |
| void | regenerateViews(QSet< RObject::Id > &entityIds) |
| void | registerScene(RGraphicsScene &scene)Registers a scene with this document interface. |
| void | removeBlockListener(RBlockListener *l) |
| void | removeCoordinateListener(RCoordinateListener *l) |
| void | removeLayerListener(RLayerListener *l) |
| void | removeTransactionListener(int key) |
| void | removeTransactionListener(RTransactionListener *l) |
| void | repaintViews()Repaints all views. |
| RVector | restrictOrtho(const RVector &position, const RVector &relativeZero, RS::OrthoMode mode=RS::Orthogonal) |
| void | resume() |
| void | selectAll()Selects all and updates the scenes / views accordingly. |
| void | selectBoxXY(const RBox &box, bool add=false) |
| int | selectEntities(const QSet< RObject::Id > &entityIds, bool add=false)Selects the given entities and updates the scenes accordingly. |
| void | selectEntity(RObject::Id entityId, bool add=false)Selects the given entity and updates the scenes accordingly. |
| void | setAllowSnapInterruption(bool on) |
| void | setClickMode(RAction::ClickMode m)Sets the click mode of the current action to the given mode. |
| void | setCurrentAction(RAction *action)Sets the current action. |
| void | setCurrentBlock(const QString &blockName)Sets the current block based on the given block name. |
| void | setCurrentBlock(const RBlock &block)Sets the current block that is in use for all views attached to this document interface. |
| void | setCurrentBlock(RObject::Id blockId)Sets the current block that is in use for all views attached to this document interface. |
| void | setCurrentColor(const RColor &color) |
| void | setCurrentLayer(const QString &layerName)Sets the current layer based on the given layer name. |
| void | setCurrentLayer(const RLayer &layer)Sets the current Layer that is in use for all views attached to this document interface. |
| void | setCurrentLayer(RObject::Id layerId) |
| void | setCurrentLinetype(RObject::Id ltId) |
| void | setCurrentLinetypePattern(const RLinetypePattern &p) |
| void | setCurrentLineweight(RLineweight::Lineweight lw) |
| void | setCurrentUcs(const QString &ucsName)Sets the current UCS based on the given UCS name. |
| void | setCurrentUcs(const RUcs &ucs)Sets the current UCS (user coordinate system) that is in use for all views attached to this document interface. |
| void | setCurrentView(const QString &viewName)Sets the current view based on the given view name. |
| void | setCurrentViewport(const RViewportEntity &viewport) |
| void | setCursor(const QCursor &cursor, bool global=true) |
| void | setCursorOverride(bool on)Force cursor to be shown. |
| void | setCursorPosition(const RVector &p) |
| void | setDefaultAction(RAction *action)Sets the action that is active if no other action is active. |
| void | setLastKnownViewWithFocus(RGraphicsView *view) |
| void | setNotifyListeners(bool on) |
| void | setRelativeZero(const RVector &p)Sets the position of the relative zero point to p and updates the graphics views. |
| void | setSnap(RSnap *snap)Sets the current snap object. |
| void | setSnapRestriction(RSnapRestriction *snapRestriction)Sets the current snap restriction object. |
| void | showPropertiesOf(REntity &entity)Notifies all property listeners that the properties of the given entity should be shown. |
| RVector | snap(RMouseEvent &event, bool preview=false)Uses the current snap to snap the given position to a grid point, end point, etc. |
| void | suspend() |
| void | swipeGestureEvent(QSwipeGesture &gesture)Forwards the given gesture to the current action. |
| void | tabletEvent(RTabletEvent &event)Forwards the given tablet event to the current action. |
| void | tagState(const QString &tag=“”) |
| void | terminateCurrentAction() |
| void | terminateEvent(RTerminateEvent &event) |
| void | toggleSnapLock()Toggles snap lock. |
| void | translateScenes(QSet< RObject::Id > &entityIds, const RVector &offset)Translates the graphical representation of the given entities in all scenes by the given offset (see RGraphicsScene::translateEntities). |
| void | ucsSetEvent(const QString &ucsName)Called immediately after the user has activated a new UCS to be used as current UCS. |
| void | undo()Transaction based undo. |
| void | undoToTag(const QString &tag=“”)Rollback to given transaction ID: |
| void | unlockRelativeZero()Unlocks the position of the relative zero point. |
| void | unlockSnap()Unlocks the current snap function so it should be changed automatically to auto snap whenever a new tool is started. |
| void | unregisterScene(RGraphicsScene &scene)Unregisters a scene from this document interface. |
| void | unsetCurrentViewport() |
| void | updateAllEntities()Marks all entities with any kind of caching as dirty, so they are regenerated next time regenerate is called. |
| void | updateSelectionStatus(QSet< RObject::Id > &entityIds, bool updateViews) |
| void | updateSelectionStatus(RObject::Id entityId, bool updateViews) |
| void | updateThumbnail() |
| void | wheelEvent(RWheelEvent &event)Forwards the given mouse wheel event to the current action. |
| void | xRefFileChanged(const QString &path) |
| void | zoomChangeEvent(RGraphicsView &view)Called if the zoom (factor, offset) changed in the given view. |
| void | zoomIn()Zooms in at the view that currently has the focus. |
| void | zoomOut()Zooms out at the view that currently has the focus. |
| void | zoomPrevious()Zooms to the previously visible viewport. |
| void | zoomTo(const RBox ®ion, int margin=0)Zooms to the given region. |
| bool | zoomToSelection() |
Static Public Functions
Section titled “Static Public Functions”| static void | deleteClipboard() |
| static RDocumentInterface & | getClipboard() |
Private Functions
Section titled “Private Functions”| void | handleClickEvent(RAction &action, RMouseEvent &event)Helper function for mouseReleaseEvent. |
| void | previewClickEvent(RAction &action, RMouseEvent &event)Helper function for mouseMoveEvent. |
Private Attributes
Section titled “Private Attributes”| bool | allowRegeneration |
| bool | allowSnapInterruption |
| bool | allowUpdate |
| QList< RBlockListener * > | blockListeners |
| QList< RCoordinateListener * > | coordinateListeners |
| QStack< RAction * > | currentActions |
| RSnap * | currentSnap |
| RSnapRestriction * | currentSnapRestriction |
| RUcs | currentUcs |
| QString | currentUcsName |
| bool | cursorOverride |
| RVector | cursorPosition |
| RAction * | defaultAction |
| bool | deleting |
| QSet< QString > | dirtyXRefPaths |
| RDocument & | document |
| QFileSystemWatcher | fileSystemWatcher |
| bool | keepPreviewOnce |
| RGraphicsView * | lastKnownViewWithFocus |
| RVector | lastPosition |
| RSnap::Status | lastSnapState |
| QList< RLayerListener * > | layerListeners |
| bool | mouseTrackingEnabled |
| bool | notifyGlobalListeners |
| RDocument * | previewDocument |
| QQueue< RAction * > | queuedActions |
| RVector | relativeZero |
| bool | relativeZeroLocked |
| QList< RGraphicsScene * > | scenes |
| QMap< QString, RScriptHandler * > | scriptHandlers |
| bool | snapLocked |
| bool | suspended |
| QMap< QString, int > | tags |
| QImage | thumbnail |
| QMap< int, RTransactionListener * > | transactionListeners |
Static Private Attributes
Section titled “Static Private Attributes”| static RDocumentInterface * | clipboard |
Member Documentation
Section titled “Member Documentation”IoErrorCode
Section titled “IoErrorCode”enum IoErrorCodeRDocumentInterface
Section titled “RDocumentInterface”RDocumentInterface::RDocumentInterface(RDocument &document)~RDocumentInterface
Section titled “~RDocumentInterface”RDocumentInterface::~RDocumentInterface()addAuxShapeToPreview
Section titled “addAuxShapeToPreview”void RDocumentInterface::addAuxShapeToPreview(RShape &shape)Exports the given shape to the preview.
addBlockListener
Section titled “addBlockListener”void RDocumentInterface::addBlockListener(RBlockListener *l)addCoordinateListener
Section titled “addCoordinateListener”void RDocumentInterface::addCoordinateListener(RCoordinateListener *l)Adds a listener for coordinate events.
This can for example be a document specific widget that displays the current coordinate, e.g. rulers.
addDrawableToPreview
Section titled “addDrawableToPreview”void RDocumentInterface::addDrawableToPreview(RGraphicsSceneDrawable &drawable)Adds the given entity to the preview of all scenes / view.
addLayerListener
Section titled “addLayerListener”void RDocumentInterface::addLayerListener(RLayerListener *l)addShapeToPreview
Section titled “addShapeToPreview”void RDocumentInterface::addShapeToPreview(RShape &shape, const RColor &color, const QBrush &brush, RLineweight::Lineweight lineweight, Qt::PenStyle style, const QList< qreal > &dashValues=RDEFAULT_QLIST_QREAL)addTransactionListener
Section titled “addTransactionListener”int RDocumentInterface::addTransactionListener(RTransactionListener *l)addZoomBoxToPreview
Section titled “addZoomBoxToPreview”void RDocumentInterface::addZoomBoxToPreview(const RBox &box)Adds a box to the preview that represents a zoom box displayed while drawing a window to magnify an area.
applyOperation
Section titled “applyOperation”RTransaction RDocumentInterface::applyOperation(ROperation *operation)Applies the given operation to the document.
The operation might for example do something with the current selection.
autoZoom
Section titled “autoZoom”void RDocumentInterface::autoZoom(int margin=RDEFAULT_MIN1)Auto zooms in the view that currently has the focus.
beginPreview
Section titled “beginPreview”void RDocumentInterface::beginPreview()After calling this function, all exports go into the preview of the scene instead of the scene itself.
See also: endPreview
bindXRef
Section titled “bindXRef”void RDocumentInterface::bindXRef(RBlock *block)checkDirtyXRefs
Section titled “checkDirtyXRefs”void RDocumentInterface::checkDirtyXRefs()void RDocumentInterface::clear(bool beforeLoad=false)Resets the document to its original, empty state.
clearCaches
Section titled “clearCaches”void RDocumentInterface::clearCaches()Clears cached variables to ensure they are re-initialized before the next use.
clearPreview
Section titled “clearPreview”void RDocumentInterface::clearPreview()Clears the preview of all scenes.
clearProperties
Section titled “clearProperties”void RDocumentInterface::clearProperties()Notifies all property listeners that no properties are relevant at this point.
This can for example clear the property editor and other property listeners.
clearSelection
Section titled “clearSelection”void RDocumentInterface::clearSelection()Clears the current selection and updates the scenes / views accordingly.
commandEvent
Section titled “commandEvent”void RDocumentInterface::commandEvent(RCommandEvent &event)commandEventPreview
Section titled “commandEventPreview”void RDocumentInterface::commandEventPreview(RCommandEvent &event)coordinateEvent
Section titled “coordinateEvent”void RDocumentInterface::coordinateEvent(RCoordinateEvent &event)coordinateEventPreview
Section titled “coordinateEventPreview”void RDocumentInterface::coordinateEventPreview(RCoordinateEvent &event)deleteScenesWithoutViews
Section titled “deleteScenesWithoutViews”void RDocumentInterface::deleteScenesWithoutViews()Deletes all registered scenes that have no view attached to them anymore.
A scene is created for and used by exactly one viewport but owned by this document interface. When the viewports are recreated (e.g. when the viewport layout is switched in the drawing preferences), the views of the previous viewports are deleted but their scenes are not: they would stay registered here for the rest of the session, occupying memory and being regenerated on every call to regenerateScenes.
Called whenever a view is deleted (see RGraphicsView::~RGraphicsView). Scenes that never had a view or that are shared with a view that is still alive are not affected.
deleteScriptHandler
Section titled “deleteScriptHandler”void RDocumentInterface::deleteScriptHandler(const QString &extension)deleteTerminatedActions
Section titled “deleteTerminatedActions”void RDocumentInterface::deleteTerminatedActions()Deletes all actions that have been terminated.
deselectAll
Section titled “deselectAll”void RDocumentInterface::deselectAll()De-select all entities, for convenience.
See also: RDocumentInterface::clearSelection()
deselectEntities
Section titled “deselectEntities”int RDocumentInterface::deselectEntities(const QSet< RObject::Id > &entityIds)Deselects the given entities and updates the scenes accordingly.
deselectEntity
Section titled “deselectEntity”void RDocumentInterface::deselectEntity(RObject::Id entityId)Deselects the given entity and updates the scenes accordingly.
disableMouseTracking
Section titled “disableMouseTracking”void RDocumentInterface::disableMouseTracking()disableRegeneration
Section titled “disableRegeneration”void RDocumentInterface::disableRegeneration()disableUpdates
Section titled “disableUpdates”void RDocumentInterface::disableUpdates()enableMouseTracking
Section titled “enableMouseTracking”void RDocumentInterface::enableMouseTracking()enableRegeneration
Section titled “enableRegeneration”void RDocumentInterface::enableRegeneration()enableUpdates
Section titled “enableUpdates”void RDocumentInterface::enableUpdates()endPreview
Section titled “endPreview”void RDocumentInterface::endPreview()After calling this function, all exports go into the scene again and not the preview anymore.
See also: beginPreview
QVariant RDocumentInterface::eval(const QString &ext, const QString &script)exportFile
Section titled “exportFile”bool RDocumentInterface::exportFile(const QString &fileName, const QString &fileVersion="", bool resetModified=true)flushRedo
Section titled “flushRedo”void RDocumentInterface::flushRedo()Flush redoable transactions.
flushTransactions
Section titled “flushTransactions”void RDocumentInterface::flushTransactions()Flush transactions.
getClickMode
Section titled “getClickMode”RAction::ClickMode RDocumentInterface::getClickMode()getClosestEntity
Section titled “getClosestEntity”REntity::Id RDocumentInterface::getClosestEntity(const RVector &position, double range, double strictRange=RMAXDOUBLE, bool includeLockedLayers=true, bool selectedOnly=false, bool snappable=false)Returns: Entity closest to the given position within the given range.
Parameters:
range: Maximum range in drawing units.strictRange: Maximum range from either end point of the entity. Zero to only return distances that are strictly orthogonal to the entity.includeLockedLayers: Return entities on locked layers.selectedOnly: Only return selected entities.
getClosestEntity
Section titled “getClosestEntity”REntity::Id RDocumentInterface::getClosestEntity(RInputEvent &event)Returns: ID of the entity that is the closest to the mouse cursor of the given event or -1 if no entity is within range.
The event is also used to determine the maximum distance from the cursor to the entity in the view in which the event originated.
getCorrectedFileName
Section titled “getCorrectedFileName”QString RDocumentInterface::getCorrectedFileName(const QString &fileName, const QString &fileVersion)getCurrentAction
Section titled “getCurrentAction”RAction * RDocumentInterface::getCurrentAction()Returns: Pointer to the current action or NULL. Used by script interfaces.
getCurrentColor
Section titled “getCurrentColor”RColor RDocumentInterface::getCurrentColor()getCurrentLinetypeId
Section titled “getCurrentLinetypeId”RLinetype::Id RDocumentInterface::getCurrentLinetypeId()getCurrentLinetypePattern
Section titled “getCurrentLinetypePattern”RLinetypePattern RDocumentInterface::getCurrentLinetypePattern()getCurrentLineweight
Section titled “getCurrentLineweight”RLineweight::Lineweight RDocumentInterface::getCurrentLineweight()getCurrentStatefulAction
Section titled “getCurrentStatefulAction”RAction * RDocumentInterface::getCurrentStatefulAction()Returns: First stateful action in action stack. This is the action that will receive zoom change events.
getCurrentUcs
Section titled “getCurrentUcs”RUcs RDocumentInterface::getCurrentUcs()Returns: The current UCS (user coordinate system).
getCurrentUcsName
Section titled “getCurrentUcsName”QString RDocumentInterface::getCurrentUcsName()Returns: The current UCS name.
getCursorOverride
Section titled “getCursorOverride”bool RDocumentInterface::getCursorOverride() constconst
getCursorPosition
Section titled “getCursorPosition”RVector RDocumentInterface::getCursorPosition() constconst
Returns: The last known (snapped) mouse cursor position in model coordinates.
getDefaultAction
Section titled “getDefaultAction”RAction * RDocumentInterface::getDefaultAction() constconst
getDocument
Section titled “getDocument”RDocument & RDocumentInterface::getDocument()Returns: Reference to underlying document.
getGraphicsScenes
Section titled “getGraphicsScenes”QList< RGraphicsScene * > RDocumentInterface::getGraphicsScenes()Returns: List of attached graphics scenes.
getGraphicsSceneWithFocus
Section titled “getGraphicsSceneWithFocus”RGraphicsScene * RDocumentInterface::getGraphicsSceneWithFocus()Returns: The graphics scene that currently has the focus or the first attached scene or NULL if no scene is attached.
getGraphicsViewWithFocus
Section titled “getGraphicsViewWithFocus”RGraphicsView * RDocumentInterface::getGraphicsViewWithFocus()Returns: The graphics view that currently has the focus or the first attached view or NULL if no view is attached.
getLastKnownViewWithFocus
Section titled “getLastKnownViewWithFocus”RGraphicsView * RDocumentInterface::getLastKnownViewWithFocus()getLastPosition
Section titled “getLastPosition”RVector RDocumentInterface::getLastPosition() constconst
Returns: The last used position, even if the relative zero is locked in one position.
getNotifyListeners
Section titled “getNotifyListeners”bool RDocumentInterface::getNotifyListeners() constinline const
getRelativeZero
Section titled “getRelativeZero”RVector RDocumentInterface::getRelativeZero() constconst
Returns: The relative zero position in model coordinates.
getScriptHandler
Section titled “getScriptHandler”RScriptHandler * RDocumentInterface::getScriptHandler(const QString &extension)getSnap
Section titled “getSnap”RSnap * RDocumentInterface::getSnap()Gets the current snap object.
getSnapRestriction
Section titled “getSnapRestriction”RSnapRestriction * RDocumentInterface::getSnapRestriction()getSnapStatus
Section titled “getSnapStatus”RSnap::Status RDocumentInterface::getSnapStatus() constinline const
getStorage
Section titled “getStorage”RStorage & RDocumentInterface::getStorage()Returns: Reference to underlying storage.
getThumbnail
Section titled “getThumbnail”QImage RDocumentInterface::getThumbnail() constconst
hasCurrentAction
Section titled “hasCurrentAction”bool RDocumentInterface::hasCurrentAction() constconst
Returns: True if at least one action is active.
hasCurrentStatefulAction
Section titled “hasCurrentStatefulAction”bool RDocumentInterface::hasCurrentStatefulAction() constconst
Returns: true if there are any stateful actions in the action stack.
hasSelection
Section titled “hasSelection”bool RDocumentInterface::hasSelection()Returns: True if the document has selected entities.
highlightEntity
Section titled “highlightEntity”void RDocumentInterface::highlightEntity(RObject::Id entityId)Highlights the given entity in all scenes.
Parameters:
reason: Reason for highlighting the entity. Only entities highlighted for mouse move are tracked as highlighted entities, not entities highlighted for other reasons (e.g. snap).
highlightReferencePoint
Section titled “highlightReferencePoint”void RDocumentInterface::highlightReferencePoint(const RRefPoint &position)Highlights the given reference point.
importFile
Section titled “importFile”RDocumentInterface::IoErrorCode RDocumentInterface::importFile(const QString &fileName, const QString &nameFilter="", bool notify=true, const QVariantMap ¶ms=RDEFAULT_QVARIANTMAP)Imports the given file if there is a file importer registered for that file type.
importUrl
Section titled “importUrl”RDocumentInterface::IoErrorCode RDocumentInterface::importUrl(const QUrl &url, const QString &nameFilter="", bool notify=true, const QVariantMap ¶ms=RDEFAULT_QVARIANTMAP)isClipboard
Section titled “isClipboard”bool RDocumentInterface::isClipboard()inline
isDeleting
Section titled “isDeleting”bool RDocumentInterface::isDeleting() constinline const
isPreviewEmpty
Section titled “isPreviewEmpty”bool RDocumentInterface::isPreviewEmpty()Returns: True if the previews of all scenes are empty. This is used to detect if the views needs to be redrawn after a mouse move event.
isRelativeZeroLocked
Section titled “isRelativeZeroLocked”bool RDocumentInterface::isRelativeZeroLocked() constconst
Returns: true if the position of the relative zero point is locked.
isScriptRunning
Section titled “isScriptRunning”bool RDocumentInterface::isScriptRunning()isSnapLocked
Section titled “isSnapLocked”bool RDocumentInterface::isSnapLocked() constconst
Returns: True if snap is locked and should never be changed automatically.
isSuspended
Section titled “isSuspended”bool RDocumentInterface::isSuspended()inline
keepPreview
Section titled “keepPreview”void RDocumentInterface::keepPreview()Makes sure that the current preview survives one mouse move.
keyPressEvent
Section titled “keyPressEvent”void RDocumentInterface::keyPressEvent(QKeyEvent &event)keyReleaseEvent
Section titled “keyReleaseEvent”void RDocumentInterface::keyReleaseEvent(QKeyEvent &event)killAllActions
Section titled “killAllActions”void RDocumentInterface::killAllActions()loadXRefs
Section titled “loadXRefs”void RDocumentInterface::loadXRefs(const QSet< QString > &paths=RDEFAULT_QSET_QSTRING)lockRelativeZero
Section titled “lockRelativeZero”void RDocumentInterface::lockRelativeZero()Locks the position of the relative zero point.
lockSnap
Section titled “lockSnap”void RDocumentInterface::lockSnap()Locks the current snap function so it should not be changed automatically to auto snap.
mouseDoubleClickEvent
Section titled “mouseDoubleClickEvent”void RDocumentInterface::mouseDoubleClickEvent(RMouseEvent &event)Forwards the given mouse double click event to the current action.
mouseMoveEvent
Section titled “mouseMoveEvent”void RDocumentInterface::mouseMoveEvent(RMouseEvent &event)Forwards the given mouse move event to the current action.
mousePressEvent
Section titled “mousePressEvent”void RDocumentInterface::mousePressEvent(RMouseEvent &event)Forwards the given mouse press event to the current action.
mouseReleaseEvent
Section titled “mouseReleaseEvent”void RDocumentInterface::mouseReleaseEvent(RMouseEvent &event)Forwards the given mouse release event to the current action.
notifyBlockListeners
Section titled “notifyBlockListeners”void RDocumentInterface::notifyBlockListeners(RDocumentInterface *documentInterface)notifyBlockListenersCurrentBlock
Section titled “notifyBlockListenersCurrentBlock”void RDocumentInterface::notifyBlockListenersCurrentBlock(RDocumentInterface *documentInterface)notifyCoordinateListeners
Section titled “notifyCoordinateListeners”void RDocumentInterface::notifyCoordinateListeners()Notifies all coordinate listeners that the coordinate has changed to position.
notifyLayerListeners
Section titled “notifyLayerListeners”void RDocumentInterface::notifyLayerListeners(QList< RObject::Id > &layerIds)Notifies local layer listeners only interested in layer events from this particular document.
Used for layer lists other than the global one (e.g. in preferences).
notifyTransactionListeners
Section titled “notifyTransactionListeners”void RDocumentInterface::notifyTransactionListeners(RTransaction *t)Notifies local transaction listeners only interested in transaction events from this particular document.
objectChangeEvent
Section titled “objectChangeEvent”void RDocumentInterface::objectChangeEvent(RTransaction &transaction)Triggers an objectChangeEvent for every object in the given set.
panGestureEvent
Section titled “panGestureEvent”void RDocumentInterface::panGestureEvent(QPanGesture &gesture)Forwards the given gesture to the current action.
pinchGestureEvent
Section titled “pinchGestureEvent”void RDocumentInterface::pinchGestureEvent(QPinchGesture &gesture)Forwards the given gesture to the current action.
previewOperation
Section titled “previewOperation”void RDocumentInterface::previewOperation(ROperation *operation)Previews the given operation by applying the operation to a temporary document that is linked to the (read only) document.
propertyChangeEvent
Section titled “propertyChangeEvent”void RDocumentInterface::propertyChangeEvent(RPropertyEvent &event)Forwards the given event to the current action to signal that a property value has been changed.
queueAction
Section titled “queueAction”void RDocumentInterface::queueAction(RAction *action)void RDocumentInterface::redo()Transaction based redo.
regenerateScenes
Section titled “regenerateScenes”void RDocumentInterface::regenerateScenes(bool undone=false, bool invisible=false)Regenerates all scenes attached to this document interface by exporting the document into them.
regenerateScenes
Section titled “regenerateScenes”void RDocumentInterface::regenerateScenes(QSet< RObject::Id > &entityIds, bool updateViews)regenerateScenes
Section titled “regenerateScenes”void RDocumentInterface::regenerateScenes(RObject::Id entityId, bool updateViews)This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
regenerateViews
Section titled “regenerateViews”void RDocumentInterface::regenerateViews(bool force=false)Regenerates all views.
regenerateViews
Section titled “regenerateViews”void RDocumentInterface::regenerateViews(QSet< RObject::Id > &entityIds)registerScene
Section titled “registerScene”void RDocumentInterface::registerScene(RGraphicsScene &scene)Registers a scene with this document interface.
removeBlockListener
Section titled “removeBlockListener”void RDocumentInterface::removeBlockListener(RBlockListener *l)removeCoordinateListener
Section titled “removeCoordinateListener”void RDocumentInterface::removeCoordinateListener(RCoordinateListener *l)removeLayerListener
Section titled “removeLayerListener”void RDocumentInterface::removeLayerListener(RLayerListener *l)removeTransactionListener
Section titled “removeTransactionListener”void RDocumentInterface::removeTransactionListener(int key)removeTransactionListener
Section titled “removeTransactionListener”void RDocumentInterface::removeTransactionListener(RTransactionListener *l)repaintViews
Section titled “repaintViews”void RDocumentInterface::repaintViews()Repaints all views.
restrictOrtho
Section titled “restrictOrtho”RVector RDocumentInterface::restrictOrtho(const RVector &position, const RVector &relativeZero, RS::OrthoMode mode=RS::Orthogonal)resume
Section titled “resume”void RDocumentInterface::resume()selectAll
Section titled “selectAll”void RDocumentInterface::selectAll()Selects all and updates the scenes / views accordingly.
selectBoxXY
Section titled “selectBoxXY”void RDocumentInterface::selectBoxXY(const RBox &box, bool add=false)selectEntities
Section titled “selectEntities”int RDocumentInterface::selectEntities(const QSet< RObject::Id > &entityIds, bool add=false)Selects the given entities and updates the scenes accordingly.
Parameters:
add: True to add to the current selection, false otherwise.
selectEntity
Section titled “selectEntity”void RDocumentInterface::selectEntity(RObject::Id entityId, bool add=false)Selects the given entity and updates the scenes accordingly.
Parameters:
add: True to add to the current selection, false otherwise.
setAllowSnapInterruption
Section titled “setAllowSnapInterruption”void RDocumentInterface::setAllowSnapInterruption(bool on)setClickMode
Section titled “setClickMode”void RDocumentInterface::setClickMode(RAction::ClickMode m)Sets the click mode of the current action to the given mode.
See also: ClickMode
setCurrentAction
Section titled “setCurrentAction”void RDocumentInterface::setCurrentAction(RAction *action)Sets the current action.
This action will receive all events until it finishes.
setCurrentBlock
Section titled “setCurrentBlock”void RDocumentInterface::setCurrentBlock(const QString &blockName)Sets the current block based on the given block name.
setCurrentBlock
Section titled “setCurrentBlock”void RDocumentInterface::setCurrentBlock(const RBlock &block)Sets the current block that is in use for all views attached to this document interface.
setCurrentBlock
Section titled “setCurrentBlock”void RDocumentInterface::setCurrentBlock(RObject::Id blockId)Sets the current block that is in use for all views attached to this document interface.
setCurrentColor
Section titled “setCurrentColor”void RDocumentInterface::setCurrentColor(const RColor &color)setCurrentLayer
Section titled “setCurrentLayer”void RDocumentInterface::setCurrentLayer(const QString &layerName)Sets the current layer based on the given layer name.
setCurrentLayer
Section titled “setCurrentLayer”void RDocumentInterface::setCurrentLayer(const RLayer &layer)Sets the current Layer that is in use for all views attached to this document interface.
setCurrentLayer
Section titled “setCurrentLayer”void RDocumentInterface::setCurrentLayer(RObject::Id layerId)setCurrentLinetype
Section titled “setCurrentLinetype”void RDocumentInterface::setCurrentLinetype(RObject::Id ltId)setCurrentLinetypePattern
Section titled “setCurrentLinetypePattern”void RDocumentInterface::setCurrentLinetypePattern(const RLinetypePattern &p)setCurrentLineweight
Section titled “setCurrentLineweight”void RDocumentInterface::setCurrentLineweight(RLineweight::Lineweight lw)setCurrentUcs
Section titled “setCurrentUcs”void RDocumentInterface::setCurrentUcs(const QString &ucsName)Sets the current UCS based on the given UCS name.
setCurrentUcs
Section titled “setCurrentUcs”void RDocumentInterface::setCurrentUcs(const RUcs &ucs)Sets the current UCS (user coordinate system) that is in use for all views attached to this document interface.
setCurrentView
Section titled “setCurrentView”void RDocumentInterface::setCurrentView(const QString &viewName)Sets the current view based on the given view name.
setCurrentViewport
Section titled “setCurrentViewport”void RDocumentInterface::setCurrentViewport(const RViewportEntity &viewport)setCursor
Section titled “setCursor”void RDocumentInterface::setCursor(const QCursor &cursor, bool global=true)setCursorOverride
Section titled “setCursorOverride”void RDocumentInterface::setCursorOverride(bool on)Force cursor to be shown.
Used for e.g. snap to intersection manual where we want to show the cursor even though we are in entity picking mode.
setCursorPosition
Section titled “setCursorPosition”void RDocumentInterface::setCursorPosition(const RVector &p)setDefaultAction
Section titled “setDefaultAction”void RDocumentInterface::setDefaultAction(RAction *action)Sets the action that is active if no other action is active.
setLastKnownViewWithFocus
Section titled “setLastKnownViewWithFocus”void RDocumentInterface::setLastKnownViewWithFocus(RGraphicsView *view)setNotifyListeners
Section titled “setNotifyListeners”void RDocumentInterface::setNotifyListeners(bool on)setRelativeZero
Section titled “setRelativeZero”void RDocumentInterface::setRelativeZero(const RVector &p)Sets the position of the relative zero point to p and updates the graphics views.
If the relative zero position is locked it is not moved.
setSnap
Section titled “setSnap”void RDocumentInterface::setSnap(RSnap *snap)Sets the current snap object.
The document interface takes ownership of the object.
setSnapRestriction
Section titled “setSnapRestriction”void RDocumentInterface::setSnapRestriction(RSnapRestriction *snapRestriction)Sets the current snap restriction object.
The document interface takes ownership of the object.
showPropertiesOf
Section titled “showPropertiesOf”void RDocumentInterface::showPropertiesOf(REntity &entity)Notifies all property listeners that the properties of the given entity should be shown.
RVector RDocumentInterface::snap(RMouseEvent &event, bool preview=false)Uses the current snap to snap the given position to a grid point, end point, etc.
Returns: Coordinate to which was snapped.
suspend
Section titled “suspend”void RDocumentInterface::suspend()swipeGestureEvent
Section titled “swipeGestureEvent”void RDocumentInterface::swipeGestureEvent(QSwipeGesture &gesture)Forwards the given gesture to the current action.
tabletEvent
Section titled “tabletEvent”void RDocumentInterface::tabletEvent(RTabletEvent &event)Forwards the given tablet event to the current action.
tagState
Section titled “tagState”void RDocumentInterface::tagState(const QString &tag="")terminateCurrentAction
Section titled “terminateCurrentAction”void RDocumentInterface::terminateCurrentAction()terminateEvent
Section titled “terminateEvent”void RDocumentInterface::terminateEvent(RTerminateEvent &event)toggleSnapLock
Section titled “toggleSnapLock”void RDocumentInterface::toggleSnapLock()Toggles snap lock.
translateScenes
Section titled “translateScenes”void RDocumentInterface::translateScenes(QSet< RObject::Id > &entityIds, const RVector &offset)Translates the graphical representation of the given entities in all scenes by the given offset (see RGraphicsScene::translateEntities).
ucsSetEvent
Section titled “ucsSetEvent”void RDocumentInterface::ucsSetEvent(const QString &ucsName)Called immediately after the user has activated a new UCS to be used as current UCS.
void RDocumentInterface::undo()Transaction based undo.
undoToTag
Section titled “undoToTag”void RDocumentInterface::undoToTag(const QString &tag="")Rollback to given transaction ID:
unlockRelativeZero
Section titled “unlockRelativeZero”void RDocumentInterface::unlockRelativeZero()Unlocks the position of the relative zero point.
unlockSnap
Section titled “unlockSnap”void RDocumentInterface::unlockSnap()Unlocks the current snap function so it should be changed automatically to auto snap whenever a new tool is started.
unregisterScene
Section titled “unregisterScene”void RDocumentInterface::unregisterScene(RGraphicsScene &scene)Unregisters a scene from this document interface.
unsetCurrentViewport
Section titled “unsetCurrentViewport”void RDocumentInterface::unsetCurrentViewport()updateAllEntities
Section titled “updateAllEntities”void RDocumentInterface::updateAllEntities()Marks all entities with any kind of caching as dirty, so they are regenerated next time regenerate is called.
updateSelectionStatus
Section titled “updateSelectionStatus”void RDocumentInterface::updateSelectionStatus(QSet< RObject::Id > &entityIds, bool updateViews)updateSelectionStatus
Section titled “updateSelectionStatus”void RDocumentInterface::updateSelectionStatus(RObject::Id entityId, bool updateViews)updateThumbnail
Section titled “updateThumbnail”void RDocumentInterface::updateThumbnail()wheelEvent
Section titled “wheelEvent”void RDocumentInterface::wheelEvent(RWheelEvent &event)Forwards the given mouse wheel event to the current action.
xRefFileChanged
Section titled “xRefFileChanged”void RDocumentInterface::xRefFileChanged(const QString &path)zoomChangeEvent
Section titled “zoomChangeEvent”void RDocumentInterface::zoomChangeEvent(RGraphicsView &view)Called if the zoom (factor, offset) changed in the given view.
zoomIn
Section titled “zoomIn”void RDocumentInterface::zoomIn()Zooms in at the view that currently has the focus.
zoomOut
Section titled “zoomOut”void RDocumentInterface::zoomOut()Zooms out at the view that currently has the focus.
zoomPrevious
Section titled “zoomPrevious”void RDocumentInterface::zoomPrevious()Zooms to the previously visible viewport.
zoomTo
Section titled “zoomTo”void RDocumentInterface::zoomTo(const RBox ®ion, int margin=0)Zooms to the given region.
zoomToSelection
Section titled “zoomToSelection”bool RDocumentInterface::zoomToSelection()deleteClipboard
Section titled “deleteClipboard”static void RDocumentInterface::deleteClipboard()static
getClipboard
Section titled “getClipboard”static RDocumentInterface & RDocumentInterface::getClipboard()static
handleClickEvent
Section titled “handleClickEvent”void RDocumentInterface::handleClickEvent(RAction &action, RMouseEvent &event)private
Helper function for mouseReleaseEvent.
Triggers an appropriate higher level event for mouse clicks for the given action. The event type depends on the action’s current ClickMode.
previewClickEvent
Section titled “previewClickEvent”void RDocumentInterface::previewClickEvent(RAction &action, RMouseEvent &event)private
Helper function for mouseMoveEvent.
Triggers an appropriate preview event for the given action and the current click mode the action is in.
allowRegeneration
Section titled “allowRegeneration”bool RDocumentInterface::allowRegenerationprivate
allowSnapInterruption
Section titled “allowSnapInterruption”bool RDocumentInterface::allowSnapInterruptionprivate
allowUpdate
Section titled “allowUpdate”bool RDocumentInterface::allowUpdateprivate
blockListeners
Section titled “blockListeners”QList<RBlockListener*> RDocumentInterface::blockListenersprivate
coordinateListeners
Section titled “coordinateListeners”QList<RCoordinateListener*> RDocumentInterface::coordinateListenersprivate
currentActions
Section titled “currentActions”QStack<RAction*> RDocumentInterface::currentActionsprivate
currentSnap
Section titled “currentSnap”RSnap* RDocumentInterface::currentSnapprivate
currentSnapRestriction
Section titled “currentSnapRestriction”RSnapRestriction* RDocumentInterface::currentSnapRestrictionprivate
currentUcs
Section titled “currentUcs”RUcs RDocumentInterface::currentUcsprivate
currentUcsName
Section titled “currentUcsName”QString RDocumentInterface::currentUcsNameprivate
cursorOverride
Section titled “cursorOverride”bool RDocumentInterface::cursorOverrideprivate
cursorPosition
Section titled “cursorPosition”RVector RDocumentInterface::cursorPositionprivate
defaultAction
Section titled “defaultAction”RAction* RDocumentInterface::defaultActionprivate
deleting
Section titled “deleting”bool RDocumentInterface::deletingprivate
dirtyXRefPaths
Section titled “dirtyXRefPaths”QSet<QString> RDocumentInterface::dirtyXRefPathsprivate
document
Section titled “document”RDocument& RDocumentInterface::documentprivate
fileSystemWatcher
Section titled “fileSystemWatcher”QFileSystemWatcher RDocumentInterface::fileSystemWatcherprivate
keepPreviewOnce
Section titled “keepPreviewOnce”bool RDocumentInterface::keepPreviewOnceprivate
lastKnownViewWithFocus
Section titled “lastKnownViewWithFocus”RGraphicsView* RDocumentInterface::lastKnownViewWithFocusprivate
lastPosition
Section titled “lastPosition”RVector RDocumentInterface::lastPositionprivate
lastSnapState
Section titled “lastSnapState”RSnap::Status RDocumentInterface::lastSnapStateprivate
layerListeners
Section titled “layerListeners”QList<RLayerListener*> RDocumentInterface::layerListenersprivate
mouseTrackingEnabled
Section titled “mouseTrackingEnabled”bool RDocumentInterface::mouseTrackingEnabledprivate
notifyGlobalListeners
Section titled “notifyGlobalListeners”bool RDocumentInterface::notifyGlobalListenersprivate
previewDocument
Section titled “previewDocument”RDocument* RDocumentInterface::previewDocumentprivate
queuedActions
Section titled “queuedActions”QQueue<RAction*> RDocumentInterface::queuedActionsprivate
relativeZero
Section titled “relativeZero”RVector RDocumentInterface::relativeZeroprivate
relativeZeroLocked
Section titled “relativeZeroLocked”bool RDocumentInterface::relativeZeroLockedprivate
scenes
Section titled “scenes”QList<RGraphicsScene*> RDocumentInterface::scenesprivate
scriptHandlers
Section titled “scriptHandlers”QMap<QString, RScriptHandler*> RDocumentInterface::scriptHandlersprivate
snapLocked
Section titled “snapLocked”bool RDocumentInterface::snapLockedprivate
suspended
Section titled “suspended”bool RDocumentInterface::suspendedprivate
QMap<QString, int> RDocumentInterface::tagsprivate
thumbnail
Section titled “thumbnail”QImage RDocumentInterface::thumbnailprivate
transactionListeners
Section titled “transactionListeners”QMap<int, RTransactionListener*> RDocumentInterface::transactionListenersprivate
clipboard
Section titled “clipboard”static RDocumentInterface * RDocumentInterface::clipboard = NULLstatic private
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.