Inkscape
Vector Graphics Editor
|
Snapping things to on-canvas alignment guides. More...
#include <alignment-snapper.h>
Public Member Functions | |
AlignmentSnapper (SnapManager *sm, Geom::Coord const d) | |
~AlignmentSnapper () override | |
bool | ThisSnapperMightSnap () const override |
Geom::Coord | getSnapperTolerance () const override |
bool | getSnapperAlwaysSnap (SnapSourceType const &source) const override |
void | freeSnap (IntermSnapResults &isr, Inkscape::SnapCandidatePoint const &p, Geom::OptRect const &bbox_to_snap, std::vector< SPObject const * > const *it, std::vector< SnapCandidatePoint > *unselected_nodes) const override |
void | constrainedSnap (IntermSnapResults &isr, Inkscape::SnapCandidatePoint const &p, Geom::OptRect const &bbox_to_snap, SnapConstraint const &c, std::vector< SPObject const * > const *it, std::vector< SnapCandidatePoint > *unselected_nodes) const override |
![]() | |
Snapper (SnapManager *sm, ::Geom::Coord const t) | |
Construct new Snapper for named view. | |
virtual | ~Snapper ()=default |
void | setEnabled (bool s) |
void | setSnapVisibleOnly (bool s) |
bool | getEnabled () const |
bool | getSnapVisibleOnly () const |
Private Member Functions | |
void | _collectBBoxPoints (bool const &first_point) const |
Collects and caches points on bounding boxes of the candidates. | |
void | _snapBBoxPoints (IntermSnapResults &isr, SnapCandidatePoint const &p, std::vector< SnapCandidatePoint > *unselected_nodes, SnapConstraint const &c=SnapConstraint(), Geom::Point const &p_proj_on_constraint=Geom::Point()) const |
SnapSourceType | source2alignment (SnapSourceType s) const |
bool | _allowSourceToSnapToTarget (SnapSourceType source, SnapTargetType target, bool strict_snapping) const |
Private Attributes | |
std::unique_ptr< std::vector< SnapCandidatePoint > > | _points_to_snap_to |
Additional Inherited Members | |
![]() | |
SnapManager * | _snapmanager |
bool | _snap_enabled |
true if this snapper is enabled, otherwise false | |
bool | _snap_visible_only |
Snapping things to on-canvas alignment guides.
Definition at line 33 of file alignment-snapper.h.
Inkscape::AlignmentSnapper::AlignmentSnapper | ( | SnapManager * | sm, |
Geom::Coord const | d | ||
) |
Definition at line 32 of file alignment-snapper.cpp.
References _points_to_snap_to.
|
override |
Definition at line 38 of file alignment-snapper.cpp.
|
private |
Definition at line 231 of file alignment-snapper.cpp.
References Inkscape::SNAPSOURCE_PAGE_CENTER, Inkscape::SNAPSOURCE_PAGE_CORNER, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_EDGE_CENTER, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_EDGE_CORNER, Inkscape::SNAPTARGET_PAGE_EDGE_CENTER, and Inkscape::SNAPTARGET_PAGE_EDGE_CORNER.
|
private |
Collects and caches points on bounding boxes of the candidates.
is | the point first point in the selection? |
Definition at line 43 of file alignment-snapper.cpp.
References SPItem::desktopBounds(), SPItem::GEOMETRIC_BBOX, Inkscape::Preferences::get(), Inkscape::getBBoxPoints(), Inkscape::Preferences::getBool(), page, Inkscape::SNAPSOURCE_ALIGNMENT_BBOX_CORNER, Inkscape::SNAPSOURCE_ALIGNMENT_BBOX_MIDPOINT, Inkscape::SNAPSOURCE_ALIGNMENT_PAGE_CENTER, Inkscape::SNAPSOURCE_ALIGNMENT_PAGE_CORNER, Inkscape::SNAPSOURCE_UNDEFINED, Inkscape::SNAPTARGET_ALIGNMENT_BBOX_CORNER, Inkscape::SNAPTARGET_ALIGNMENT_BBOX_MIDPOINT, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_BLEED_CORNER, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_EDGE_CENTER, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_EDGE_CORNER, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_MARGIN_CENTER, Inkscape::SNAPTARGET_ALIGNMENT_PAGE_MARGIN_CORNER, Inkscape::SNAPTARGET_PAGE_EDGE_CORNER, Inkscape::SNAPTARGET_PAGE_MARGIN_CORNER, Inkscape::SNAPTARGET_UNDEFINED, and SPItem::VISUAL_BBOX.
|
private |
Definition at line 116 of file alignment-snapper.cpp.
References always, c, Inkscape::SnappedPoint::getAlignmentTarget(), Inkscape::SnappedPoint::getDistanceToAlignTarget(), Inkscape::SnapCandidatePoint::getPoint(), Inkscape::SnappedPoint::getPoint(), Inkscape::SnappedPoint::getSnapDistance(), Inkscape::SnapCandidatePoint::getSourceNum(), Inkscape::SnapCandidatePoint::getSourceType(), Geom::L2(), IntermSnapResults::points, Inkscape::SNAPTARGET_ALIGNMENT_HANDLE, Inkscape::SNAPTARGET_ALIGNMENT_INTERSECTION, Inkscape::SNAPTARGET_NODE_CATEGORY, Geom::Point::x(), and Geom::Point::y().
|
overridevirtual |
Reimplemented from Inkscape::Snapper.
Definition at line 269 of file alignment-snapper.cpp.
References c, Inkscape::SnapCandidatePoint::considerForAlignment(), Inkscape::SnapCandidatePoint::getPoint(), Inkscape::SnapCandidatePoint::getSourceNum(), Inkscape::SnapCandidatePoint::getSourceType(), Geom::identity(), Inkscape::SNAPSOURCE_BBOX_CATEGORY, Inkscape::SNAPSOURCE_NODE_HANDLE, and Inkscape::SNAPTARGET_ALIGNMENT_CATEGORY.
|
overridevirtual |
Reimplemented from Inkscape::Snapper.
Definition at line 242 of file alignment-snapper.cpp.
References Inkscape::SnapCandidatePoint::considerForAlignment(), Inkscape::SnapCandidatePoint::getPoint(), Inkscape::SnapCandidatePoint::getSourceNum(), Inkscape::SnapCandidatePoint::getSourceType(), Geom::identity(), Inkscape::SNAPSOURCE_BBOX_CATEGORY, Inkscape::SNAPSOURCE_NODE_HANDLE, and Inkscape::SNAPTARGET_ALIGNMENT_CATEGORY.
|
overridevirtual |
Implements Inkscape::Snapper.
Definition at line 305 of file alignment-snapper.cpp.
References Inkscape::Preferences::get(), and Inkscape::Preferences::getBool().
|
overridevirtual |
Implements Inkscape::Snapper.
Definition at line 310 of file alignment-snapper.cpp.
References SPDesktop::current_zoom().
|
private |
Definition at line 317 of file alignment-snapper.cpp.
References Inkscape::SNAPSOURCE_ALIGNMENT_BBOX_CORNER, Inkscape::SNAPSOURCE_ALIGNMENT_BBOX_EDGE_MIDPOINT, Inkscape::SNAPSOURCE_ALIGNMENT_BBOX_MIDPOINT, Inkscape::SNAPSOURCE_ALIGNMENT_CATEGORY, Inkscape::SNAPSOURCE_ALIGNMENT_HANDLE, Inkscape::SNAPSOURCE_BBOX_CATEGORY, Inkscape::SNAPSOURCE_BBOX_CORNER, Inkscape::SNAPSOURCE_BBOX_EDGE_MIDPOINT, Inkscape::SNAPSOURCE_BBOX_MIDPOINT, Inkscape::SNAPSOURCE_NODE_CATEGORY, Inkscape::SNAPSOURCE_OTHER_HANDLE, and Inkscape::SNAPSOURCE_UNDEFINED.
|
overridevirtual |
Reimplemented from Inkscape::Snapper.
Definition at line 300 of file alignment-snapper.cpp.
|
private |
Definition at line 66 of file alignment-snapper.h.
Referenced by AlignmentSnapper().