Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
Inkscape::GuideSnapper Class Reference

Snap to guides. More...

#include <guide-snapper.h>

Inheritance diagram for Inkscape::GuideSnapper:
Inkscape::LineSnapper Inkscape::Snapper

Public Member Functions

 GuideSnapper (SnapManager *sm, Geom::Coord const d)
 
bool ThisSnapperMightSnap () const override
 
Geom::Coord getSnapperTolerance () const override
 
bool getSnapperAlwaysSnap (SnapSourceType const &source) const override
 
- Public Member Functions inherited from Inkscape::LineSnapper
 LineSnapper (SnapManager *sm, Geom::Coord const d)
 
void freeSnap (IntermSnapResults &isr, Inkscape::SnapCandidatePoint const &p, Geom::OptRect const &bbox_to_snap, std::vector< SPObject const * > const *it, std::vector< Inkscape::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

LineList _getSnapLines (Geom::Point const &p) const override
 
void _addSnappedLine (IntermSnapResults &isr, Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, Geom::Point const &normal_to_line, Geom::Point const &point_on_line) const override
 
void _addSnappedLinesOrigin (IntermSnapResults &isr, Geom::Point const &origin, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const override
 
void _addSnappedLinePerpendicularly (IntermSnapResults &isr, Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const override
 
void _addSnappedPoint (IntermSnapResults &isr, Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const override
 

Additional Inherited Members

- Protected Types inherited from Inkscape::LineSnapper
typedef std::list< std::pair< Geom::Point, Geom::Point > > LineList
 
- 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

Snap to guides.

Definition at line 25 of file guide-snapper.h.

Constructor & Destructor Documentation

◆ GuideSnapper()

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

Definition at line 21 of file guide-snapper.cpp.

Member Function Documentation

◆ _addSnappedLine()

void Inkscape::GuideSnapper::_addSnappedLine ( IntermSnapResults isr,
Geom::Point const &  snapped_point,
Geom::Coord const &  snapped_distance,
SnapSourceType const &  source,
long  source_num,
Geom::Point const &  normal_to_line,
Geom::Point const &  point_on_line 
) const
overrideprivatevirtual

◆ _addSnappedLinePerpendicularly()

void Inkscape::GuideSnapper::_addSnappedLinePerpendicularly ( IntermSnapResults isr,
Geom::Point const &  snapped_point,
Geom::Coord const &  snapped_distance,
SnapSourceType const &  source,
long  source_num,
bool  constrained_snap 
) const
overrideprivatevirtual

◆ _addSnappedLinesOrigin()

void Inkscape::GuideSnapper::_addSnappedLinesOrigin ( IntermSnapResults isr,
Geom::Point const &  origin,
Geom::Coord const &  snapped_distance,
SnapSourceType const &  source,
long  source_num,
bool  constrained_snap 
) const
overrideprivatevirtual

Reimplemented from Inkscape::LineSnapper.

Definition at line 78 of file guide-snapper.cpp.

References origin, IntermSnapResults::points, and Inkscape::SNAPTARGET_GUIDE_ORIGIN.

◆ _addSnappedPoint()

void Inkscape::GuideSnapper::_addSnappedPoint ( IntermSnapResults isr,
Geom::Point const &  snapped_point,
Geom::Coord const &  snapped_distance,
SnapSourceType const &  source,
long  source_num,
bool  constrained_snap 
) const
overrideprivatevirtual

Implements Inkscape::LineSnapper.

Definition at line 90 of file guide-snapper.cpp.

References IntermSnapResults::points, and Inkscape::SNAPTARGET_GUIDE.

◆ _getSnapLines()

Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines ( Geom::Point const &  p) const
overrideprivatevirtual
Parameters
pPoint that we are trying to snap.
Returns
List of lines that we should try snapping to.

Implements Inkscape::LineSnapper.

Definition at line 41 of file guide-snapper.cpp.

◆ getSnapperAlwaysSnap()

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

◆ getSnapperTolerance()

Geom::Coord Inkscape::GuideSnapper::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 27 of file guide-snapper.cpp.

References SPDesktop::current_zoom().

◆ ThisSnapperMightSnap()

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

Reimplemented from Inkscape::Snapper.

Definition at line 63 of file guide-snapper.cpp.

References Inkscape::SNAPTARGET_GUIDE.


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