Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::AlignmentSnapper Class Reference

Snapping things to on-canvas alignment guides. More...

#include <alignment-snapper.h>

Inheritance diagram for Inkscape::AlignmentSnapper:
Inkscape::Snapper

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
 
- Public Member Functions inherited from Inkscape::Snapper
 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

- Protected Attributes inherited from Inkscape::Snapper
SnapManager_snapmanager
 
bool _snap_enabled
 true if this snapper is enabled, otherwise false
 
bool _snap_visible_only
 

Detailed Description

Snapping things to on-canvas alignment guides.

Definition at line 33 of file alignment-snapper.h.

Constructor & Destructor Documentation

◆ AlignmentSnapper()

Inkscape::AlignmentSnapper::AlignmentSnapper ( SnapManager sm,
Geom::Coord const  d 
)

Definition at line 32 of file alignment-snapper.cpp.

References _points_to_snap_to.

◆ ~AlignmentSnapper()

Inkscape::AlignmentSnapper::~AlignmentSnapper ( )
override

Definition at line 38 of file alignment-snapper.cpp.

Member Function Documentation

◆ _allowSourceToSnapToTarget()

◆ _collectBBoxPoints()

◆ _snapBBoxPoints()

◆ constrainedSnap()

void Inkscape::AlignmentSnapper::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
overridevirtual

◆ freeSnap()

◆ getSnapperAlwaysSnap()

bool Inkscape::AlignmentSnapper::getSnapperAlwaysSnap ( SnapSourceType const &  source) const
overridevirtual

◆ getSnapperTolerance()

Geom::Coord Inkscape::AlignmentSnapper::getSnapperTolerance ( ) const
overridevirtual
Returns
Snap tolerance (desktop coordinates); depends on current zoom so that it's always the same in screen pixels.

Implements Inkscape::Snapper.

Definition at line 310 of file alignment-snapper.cpp.

References SPDesktop::current_zoom().

◆ source2alignment()

◆ ThisSnapperMightSnap()

bool Inkscape::AlignmentSnapper::ThisSnapperMightSnap ( ) const
overridevirtual
Returns
true if this Snapper will snap at least one kind of point.

Reimplemented from Inkscape::Snapper.

Definition at line 300 of file alignment-snapper.cpp.

Member Data Documentation

◆ _points_to_snap_to

std::unique_ptr<std::vector<SnapCandidatePoint> > Inkscape::AlignmentSnapper::_points_to_snap_to
private

Definition at line 66 of file alignment-snapper.h.

Referenced by AlignmentSnapper().


The documentation for this class was generated from the following files: