RSnap
Class in Core Module
Header: #include <src/core/RSnap.h>
Inherited by: RSnapAuto, RSnapEntityBase, RSnapFree, RSnapGrid, RSnapIntersection, RSnapSelection
Description
Section titled “Description”Abstract base class for all grid and object snap implementations.
A snap class implements an object or grid snap tool. For example to snap to end points of objects.
Scriptable: This class is available in script environments.
\generateScriptShell
Public Types
Section titled “Public Types”| enum | Status { Unknown, Free, Grid, Endpoint, OnEntity, Center, Middle, Distance, Intersection, IntersectionManual, Reference, Perpendicular, Tangential, Coordinate, CoordinatePolar, TopLeft, TopMiddle, TopRight, MiddleLeft, MiddleMiddle, MiddleRight, BottomLeft, BottomMiddle, BottomRight }Snap status, returned by snap tools (most importantly auto snap tool) to indicate what snap was used. |
Public Functions
Section titled “Public Functions”RSnap(RSnap::Status s=RSnap::Unknown) |
|
~RSnap() |
|
| virtual void | finishEvent() |
| QList< RObject::Id > | getEntityIds() |
| RVector | getLastSnap() const |
| virtual QList< RRefPoint > | getSnapReferencePoints() const |
| RSnap::Status | getStatus() const |
| virtual void | hideUiOptions() |
| virtual void | reset() |
| void | setLastSnap(const RVector &v) |
| void | setStatus(RSnap::Status s) |
| virtual void | showUiOptions() |
| virtual RVector | snap(const RVector &position, RGraphicsView &view, double range=RNANDOUBLE) |
| virtual RVector | snap(RMouseEvent &event)This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
| virtual void | suspendEvent() |
Static Public Functions
Section titled “Static Public Functions”| static bool | isInRange(const RVector &snapped, const RVector &position, double range, RGraphicsView &view) |
| static bool | isThreeDimensionalView(RGraphicsView &view) |
Protected Attributes
Section titled “Protected Attributes”| QList< RObject::Id > | entityIds |
| RVector | lastSnap |
| RSnap::Status | status |
Member Documentation
Section titled “Member Documentation”Status
Section titled “Status”enum StatusSnap status, returned by snap tools (most importantly auto snap tool) to indicate what snap was used.
RSnap::RSnap(RSnap::Status s=RSnap::Unknown)~RSnap
Section titled “~RSnap”RSnap::~RSnap()finishEvent
Section titled “finishEvent”virtual void RSnap::finishEvent()virtual inline
getEntityIds
Section titled “getEntityIds”QList< RObject::Id > RSnap::getEntityIds()inline
Returns: Set of entity IDs that are relevant for the last performed snap, usually used for highlighting.
getLastSnap
Section titled “getLastSnap”RVector RSnap::getLastSnap() constinline const
getSnapReferencePoints
Section titled “getSnapReferencePoints”virtual QList< RRefPoint > RSnap::getSnapReferencePoints() constvirtual inline const
Reimplemented in getSnapReferencePoints.
getStatus
Section titled “getStatus”RSnap::Status RSnap::getStatus() constinline const
hideUiOptions
Section titled “hideUiOptions”virtual void RSnap::hideUiOptions()virtual inline
Reimplemented in hideUiOptions.
virtual void RSnap::reset()virtual inline
Reimplemented in reset, reset.
setLastSnap
Section titled “setLastSnap”void RSnap::setLastSnap(const RVector &v)inline
setStatus
Section titled “setStatus”void RSnap::setStatus(RSnap::Status s)inline
showUiOptions
Section titled “showUiOptions”virtual void RSnap::showUiOptions()virtual inline
Reimplemented in showUiOptions.
virtual RVector RSnap::snap(const RVector &position, RGraphicsView &view, double range=RNANDOUBLE)virtual inline
Returns: The snapped position (closest relevant position) for the given mouse position.
Reimplemented in snap, snap, snap, snap, snap, snap.
virtual RVector RSnap::snap(RMouseEvent &event)virtual
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Non-Scriptable: This function is not available in script environments.
suspendEvent
Section titled “suspendEvent”virtual void RSnap::suspendEvent()virtual inline
isInRange
Section titled “isInRange”static bool RSnap::isInRange(const RVector &snapped, const RVector &position, double range, RGraphicsView &view)static
Returns: True if the given snapped position is within the given range of the given cursor position: in the drawing plane for 2D views, on screen (snap range in pixels, see RSettings::getSnapRange) for 3D views.
isThreeDimensionalView
Section titled “isThreeDimensionalView”static bool RSnap::isThreeDimensionalView(RGraphicsView &view)static
Returns: True if the given view is a 3D view (a graphics scene with the projection rendering hint RS::RenderThreeD, e.g. the RHI 3D view): snap distances are then compared on screen (see isInRange), not in the drawing plane.
entityIds
Section titled “entityIds”QList<RObject::Id> RSnap::entityIdsprotected
lastSnap
Section titled “lastSnap”RVector RSnap::lastSnapprotected
status
Section titled “status”RSnap::Status RSnap::statusprotected