Skip to content

RSnapSelection

Class in Snap Module
Header: #include <src/snap/RSnapSelection.h>
Inherits: RSnap

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.

RSnapSelection()
virtual ~RSnapSelection()
virtual QList< RRefPoint > getSnapReferencePoints() const
virtual void reset()
virtual RVector snap(const RVector &position, RGraphicsView &view, double range=RNANDOUBLE)
static QList< RRefPoint > calculateReferencePoints(RDocument *document)
RDocument * document
Document of the last performed snap.
QList< RRefPoint > referencePoints
Cached reference points, lazily recomputed by getSnapReferencePoints.

RSnapSelection::RSnapSelection()

inline

virtual RSnapSelection::~RSnapSelection()

virtual inline

virtual QList< RRefPoint > RSnapSelection::getSnapReferencePoints() const

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

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.

RDocument* RSnapSelection::document

private

Document of the last performed snap.

QList<RRefPoint> RSnapSelection::referencePoints

private

Cached reference points, lazily recomputed by getSnapReferencePoints.