RSnapSelection
Class in Snap Module
Header: #include <src/snap/RSnapSelection.h>
Inherits: RSnap
Description
Section titled “Description”Selection snapper implementation.
Snaps to the corners, edge midpoints and center of the bounding box of the current selection.
Scriptable: This class is available in script environments.
Public Functions
Section titled “Public Functions”RSnapSelection() |
|
| virtual | ~RSnapSelection() |
| virtual QList< RRefPoint > | getSnapReferencePoints() const |
| virtual void | reset() |
| virtual RVector | snap(const RVector &position, RGraphicsView &view, double range=RNANDOUBLE) |
Static Private Functions
Section titled “Static Private Functions”| static QList< RRefPoint > | calculateReferencePoints(RDocument *document) |
Private Attributes
Section titled “Private Attributes”| RDocument * | document Document of the last performed snap. |
| QList< RRefPoint > | referencePoints Cached reference points, lazily recomputed by getSnapReferencePoints. |
Member Documentation
Section titled “Member Documentation”RSnapSelection
Section titled “RSnapSelection”RSnapSelection::RSnapSelection()inline
~RSnapSelection
Section titled “~RSnapSelection”virtual RSnapSelection::~RSnapSelection()virtual inline
getSnapReferencePoints
Section titled “getSnapReferencePoints”virtual QList< RRefPoint > RSnapSelection::getSnapReferencePoints() constvirtual const
Returns: The nine possible snap points (corners, edge midpoints and center of the selection box), with the appropriate Top / VMiddle / Bottom and Left / HMiddle / Right flags set. Empty list if there is no selection.
Reimplemented from getSnapReferencePoints.
virtual void RSnapSelection::reset()virtual inline
Reimplemented from reset.
virtual RVector RSnapSelection::snap(const RVector &position, RGraphicsView &view, double range=RNANDOUBLE)virtual
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.
Reimplemented from snap.
calculateReferencePoints
Section titled “calculateReferencePoints”static QList< RRefPoint > RSnapSelection::calculateReferencePoints(RDocument *document)static private
Returns: The nine reference points of the selection box of the given document (corners, edge midpoints and center) in the order top left, top middle, top right, middle left, center, middle right, bottom left, bottom middle, bottom right. Empty list if there is no selection.
document
Section titled “document”RDocument* RSnapSelection::documentprivate
Document of the last performed snap.
referencePoints
Section titled “referencePoints”QList<RRefPoint> RSnapSelection::referencePointsprivate
Cached reference points, lazily recomputed by getSnapReferencePoints.