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

Class describing the result of an attempt to snap. More...

#include <snapped-point.h>

Inheritance diagram for Inkscape::SnappedPoint:
Inkscape::SnappedCurve Inkscape::SnappedLine Inkscape::SnappedLineSegment

Public Member Functions

 SnappedPoint ()
 
 SnappedPoint (Geom::Point const &p)
 
 SnappedPoint (Geom::Point const &p, SnapSourceType const &source, long source_num, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &at_intersection, bool const &constrained_snap, bool const &fully_constrained, Geom::Coord const &d2, Geom::Coord const &t2, bool const &a2)
 
 SnappedPoint (Geom::Point const &p, SnapSourceType const &source, long source_num, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &constrained_snap, bool const &fully_constrained, Geom::OptRect target_bbox=Geom::OptRect())
 
 SnappedPoint (Geom::Point const &p, Geom::Point const &ap, SnapSourceType const &source, long source_num, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &constrained_snap, bool const &fully_constrained, Geom::OptRect target_bbox)
 
 SnappedPoint (Geom::Point const &p, Geom::Point const &ap, Geom::Point const &ap2, SnapSourceType const &source, long source_num, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &constrained_snap, bool const &fully_constrained, Geom::OptRect target_bbox)
 
 SnappedPoint (Geom::Point const &p, std::vector< Geom::Rect > const &bboxes, Geom::Rect const &source_bbox, Geom::Coord equal_dist, SnapSourceType const &source, long source_num, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &constrained_snap, bool const &fully_constrained)
 
 SnappedPoint (Geom::Point const &p, std::vector< Geom::Rect > const &bboxes, std::vector< Geom::Rect > const &bboxes2, Geom::Rect const &source_bbox, Geom::Coord equal_dist, Geom::Coord equal_dist2, SnapSourceType const &source, long source_num, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &constrained_snap, bool const &fully_constrained)
 
 SnappedPoint (SnapCandidatePoint const &p, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &constrained_snap, bool const &fully_constrained)
 
 ~SnappedPoint ()
 
Geom::Coord getSnapDistance () const
 
void setSnapDistance (Geom::Coord const d)
 
Geom::Coord getTolerance () const
 
bool getAlwaysSnap () const
 
Geom::Coord getSecondSnapDistance () const
 
void setSecondSnapDistance (Geom::Coord const d)
 
Geom::Coord getSecondTolerance () const
 
bool getSecondAlwaysSnap () const
 
Geom::Coord getPointerDistance () const
 
void setPointerDistance (Geom::Coord const d)
 
std::vector< Geom::Rect > const & getBBoxes () const
 
std::vector< Geom::Rect > const & getBBoxes2 () const
 
void getPointIfSnapped (Geom::Point &p) const
 
Geom::Point getPoint () const
 
void setPoint (Geom::Point const &p)
 
void setAlignmentTarget (std::optional< Geom::Point > const &p)
 
void setAlignmentTarget2 (std::optional< Geom::Point > const &p)
 
Geom::Point getTangent () const
 
std::optional< Geom::PointgetAlignmentTarget () const
 
std::optional< Geom::PointgetAlignmentTarget2 () const
 
Geom::Coord getDistanceToAlignTarget () const
 
bool getAtIntersection () const
 
bool getFullyConstrained () const
 
bool getConstrainedSnap () const
 
bool getSnapped () const
 
void setTarget (SnapTargetType const target)
 
void setAlignmentTargetType (SnapTargetType const target)
 
SnapTargetType getTarget () const
 
SnapTargetType getAlignmentTargetType () const
 
bool getOnPath () const
 
void setTargetBBox (Geom::OptRect const target)
 
Geom::OptRect const getTargetBBox () const
 
Geom::OptRect const getSourceBBox () const
 
Geom::Coord getDistributionDistance () const
 
Geom::Coord getDistributionDistance2 () const
 
void setSource (SnapSourceType const source)
 
SnapSourceType getSource () const
 
long getSourceNum () const
 
bool isOtherSnapBetter (SnappedPoint const &other_one, bool weighted) const
 

Protected Attributes

Geom::Point _point
 
Geom::Point _tangent
 
std::optional< Geom::Point_alignment_target
 
std::optional< Geom::Point_alignment_target2
 
std::vector< Geom::Rect_distribution_bboxes
 
std::vector< Geom::Rect_distribution_bboxes2
 
SnapSourceType _source
 
long _source_num
 
SnapTargetType _target
 
std::optional< SnapTargetType_alignment_target_type
 
bool _at_intersection
 
bool _constrained_snap
 
bool _fully_constrained
 
Geom::Coord _distance
 
Geom::Coord _tolerance
 
bool _always_snap
 
Geom::Coord _second_distance
 
Geom::Coord _second_tolerance
 
Geom::Coord _equal_distance
 
Geom::Coord _equal_distance2
 
bool _second_always_snap
 
Geom::OptRect _target_bbox
 
Geom::OptRect _source_bbox
 
Geom::Coord _pointer_distance
 

Detailed Description

Class describing the result of an attempt to snap.

Definition at line 28 of file snapped-point.h.

Constructor & Destructor Documentation

◆ SnappedPoint() [1/9]

Inkscape::SnappedPoint::SnappedPoint ( )

Definition at line 181 of file snapped-point.cpp.

◆ SnappedPoint() [2/9]

Inkscape::SnappedPoint::SnappedPoint ( Geom::Point const &  p)

Definition at line 202 of file snapped-point.cpp.

◆ SnappedPoint() [3/9]

Inkscape::SnappedPoint::SnappedPoint ( Geom::Point const &  p,
SnapSourceType const &  source,
long  source_num,
SnapTargetType const &  target,
Geom::Coord const &  d,
Geom::Coord const &  t,
bool const &  a,
bool const &  at_intersection,
bool const &  constrained_snap,
bool const &  fully_constrained,
Geom::Coord const &  d2,
Geom::Coord const &  t2,
bool const &  a2 
)

Definition at line 158 of file snapped-point.cpp.

◆ SnappedPoint() [4/9]

Inkscape::SnappedPoint::SnappedPoint ( Geom::Point const &  p,
SnapSourceType const &  source,
long  source_num,
SnapTargetType const &  target,
Geom::Coord const &  d,
Geom::Coord const &  t,
bool const &  a,
bool const &  constrained_snap,
bool const &  fully_constrained,
Geom::OptRect  target_bbox = Geom::OptRect() 
)

Definition at line 18 of file snapped-point.cpp.

◆ SnappedPoint() [5/9]

Inkscape::SnappedPoint::SnappedPoint ( Geom::Point const &  p,
Geom::Point const &  ap,
SnapSourceType const &  source,
long  source_num,
SnapTargetType const &  target,
Geom::Coord const &  d,
Geom::Coord const &  t,
bool const &  a,
bool const &  constrained_snap,
bool const &  fully_constrained,
Geom::OptRect  target_bbox 
)

Definition at line 41 of file snapped-point.cpp.

◆ SnappedPoint() [6/9]

Inkscape::SnappedPoint::SnappedPoint ( Geom::Point const &  p,
Geom::Point const &  ap,
Geom::Point const &  ap2,
SnapSourceType const &  source,
long  source_num,
SnapTargetType const &  target,
Geom::Coord const &  d,
Geom::Coord const &  t,
bool const &  a,
bool const &  constrained_snap,
bool const &  fully_constrained,
Geom::OptRect  target_bbox 
)

Definition at line 65 of file snapped-point.cpp.

◆ SnappedPoint() [7/9]

Inkscape::SnappedPoint::SnappedPoint ( Geom::Point const &  p,
std::vector< Geom::Rect > const &  bboxes,
Geom::Rect const &  source_bbox,
Geom::Coord  equal_dist,
SnapSourceType const &  source,
long  source_num,
SnapTargetType const &  target,
Geom::Coord const &  d,
Geom::Coord const &  t,
bool const &  a,
bool const &  constrained_snap,
bool const &  fully_constrained 
)

Definition at line 89 of file snapped-point.cpp.

◆ SnappedPoint() [8/9]

Inkscape::SnappedPoint::SnappedPoint ( Geom::Point const &  p,
std::vector< Geom::Rect > const &  bboxes,
std::vector< Geom::Rect > const &  bboxes2,
Geom::Rect const &  source_bbox,
Geom::Coord  equal_dist,
Geom::Coord  equal_dist2,
SnapSourceType const &  source,
long  source_num,
SnapTargetType const &  target,
Geom::Coord const &  d,
Geom::Coord const &  t,
bool const &  a,
bool const &  constrained_snap,
bool const &  fully_constrained 
)

Definition at line 112 of file snapped-point.cpp.

◆ SnappedPoint() [9/9]

Inkscape::SnappedPoint::SnappedPoint ( Inkscape::SnapCandidatePoint const &  p,
SnapTargetType const &  target,
Geom::Coord const &  d,
Geom::Coord const &  t,
bool const &  a,
bool const &  constrained_snap,
bool const &  fully_constrained 
)

Definition at line 137 of file snapped-point.cpp.

◆ ~SnappedPoint()

Inkscape::SnappedPoint::~SnappedPoint ( )
default

Member Function Documentation

◆ getAlignmentTarget()

std::optional< Geom::Point > Inkscape::SnappedPoint::getAlignmentTarget ( ) const
inline

◆ getAlignmentTarget2()

std::optional< Geom::Point > Inkscape::SnappedPoint::getAlignmentTarget2 ( ) const
inline

◆ getAlignmentTargetType()

SnapTargetType Inkscape::SnappedPoint::getAlignmentTargetType ( ) const
inline

◆ getAlwaysSnap()

◆ getAtIntersection()

◆ getBBoxes()

std::vector< Geom::Rect > const & Inkscape::SnappedPoint::getBBoxes ( ) const
inline

◆ getBBoxes2()

std::vector< Geom::Rect > const & Inkscape::SnappedPoint::getBBoxes2 ( ) const
inline

◆ getConstrainedSnap()

bool Inkscape::SnappedPoint::getConstrainedSnap ( ) const
inline

Definition at line 105 of file snapped-point.h.

References _constrained_snap.

Referenced by isOtherSnapBetter().

◆ getDistanceToAlignTarget()

Geom::Coord Inkscape::SnappedPoint::getDistanceToAlignTarget ( ) const
inline

◆ getDistributionDistance()

Geom::Coord Inkscape::SnappedPoint::getDistributionDistance ( ) const
inline

◆ getDistributionDistance2()

Geom::Coord Inkscape::SnappedPoint::getDistributionDistance2 ( ) const
inline

◆ getFullyConstrained()

bool Inkscape::SnappedPoint::getFullyConstrained ( ) const
inline

Definition at line 104 of file snapped-point.h.

References _fully_constrained.

Referenced by isOtherSnapBetter().

◆ getOnPath()

◆ getPoint()

◆ getPointerDistance()

Geom::Coord Inkscape::SnappedPoint::getPointerDistance ( ) const
inline

Definition at line 51 of file snapped-point.h.

References _pointer_distance.

Referenced by isOtherSnapBetter().

◆ getPointIfSnapped()

void Inkscape::SnappedPoint::getPointIfSnapped ( Geom::Point p) const

◆ getSecondAlwaysSnap()

bool Inkscape::SnappedPoint::getSecondAlwaysSnap ( ) const
inline

Definition at line 50 of file snapped-point.h.

References _second_always_snap.

◆ getSecondSnapDistance()

Geom::Coord Inkscape::SnappedPoint::getSecondSnapDistance ( ) const
inline

◆ getSecondTolerance()

Geom::Coord Inkscape::SnappedPoint::getSecondTolerance ( ) const
inline

Definition at line 49 of file snapped-point.h.

References _second_tolerance.

◆ getSnapDistance()

◆ getSnapped()

◆ getSource()

SnapSourceType Inkscape::SnappedPoint::getSource ( ) const
inline

Definition at line 122 of file snapped-point.h.

References _source.

Referenced by Inkscape::Display::SnapIndicator::set_new_snaptarget().

◆ getSourceBBox()

Geom::OptRect const Inkscape::SnappedPoint::getSourceBBox ( ) const
inline

Definition at line 118 of file snapped-point.h.

References _source_bbox.

◆ getSourceNum()

long Inkscape::SnappedPoint::getSourceNum ( ) const
inline

◆ getTangent()

Geom::Point Inkscape::SnappedPoint::getTangent ( ) const
inline

Definition at line 81 of file snapped-point.h.

References _tangent.

Referenced by SnapManager::guideFreeSnap().

◆ getTarget()

◆ getTargetBBox()

Geom::OptRect const Inkscape::SnappedPoint::getTargetBBox ( ) const
inline

Definition at line 117 of file snapped-point.h.

References _target_bbox.

Referenced by Inkscape::Display::SnapIndicator::set_new_snaptarget().

◆ getTolerance()

◆ isOtherSnapBetter()

◆ setAlignmentTarget()

void Inkscape::SnappedPoint::setAlignmentTarget ( std::optional< Geom::Point > const &  p)
inline

Definition at line 73 of file snapped-point.h.

References _alignment_target.

◆ setAlignmentTarget2()

void Inkscape::SnappedPoint::setAlignmentTarget2 ( std::optional< Geom::Point > const &  p)
inline

Definition at line 77 of file snapped-point.h.

References _alignment_target2.

◆ setAlignmentTargetType()

void Inkscape::SnappedPoint::setAlignmentTargetType ( SnapTargetType const  target)
inline

Definition at line 108 of file snapped-point.h.

References _alignment_target_type.

◆ setPoint()

void Inkscape::SnappedPoint::setPoint ( Geom::Point const &  p)
inline

◆ setPointerDistance()

void Inkscape::SnappedPoint::setPointerDistance ( Geom::Coord const  d)
inline

Definition at line 52 of file snapped-point.h.

References _pointer_distance.

Referenced by Inkscape::PureTransform::snap().

◆ setSecondSnapDistance()

◆ setSnapDistance()

◆ setSource()

void Inkscape::SnappedPoint::setSource ( SnapSourceType const  source)
inline

Definition at line 121 of file snapped-point.h.

References _source.

Referenced by SnapManager::findBestSnap().

◆ setTarget()

void Inkscape::SnappedPoint::setTarget ( SnapTargetType const  target)
inline

◆ setTargetBBox()

void Inkscape::SnappedPoint::setTargetBBox ( Geom::OptRect const  target)
inline

Definition at line 116 of file snapped-point.h.

References _target_bbox.

Member Data Documentation

◆ _alignment_target

std::optional<Geom::Point> Inkscape::SnappedPoint::_alignment_target
protected

◆ _alignment_target2

std::optional<Geom::Point> Inkscape::SnappedPoint::_alignment_target2
protected

Definition at line 148 of file snapped-point.h.

Referenced by getAlignmentTarget2(), and setAlignmentTarget2().

◆ _alignment_target_type

std::optional<SnapTargetType> Inkscape::SnappedPoint::_alignment_target_type
protected

Definition at line 154 of file snapped-point.h.

Referenced by getAlignmentTargetType(), and setAlignmentTargetType().

◆ _always_snap

bool Inkscape::SnappedPoint::_always_snap
protected

◆ _at_intersection

bool Inkscape::SnappedPoint::_at_intersection
protected

◆ _constrained_snap

bool Inkscape::SnappedPoint::_constrained_snap
protected

Definition at line 156 of file snapped-point.h.

Referenced by getConstrainedSnap().

◆ _distance

◆ _distribution_bboxes

std::vector<Geom::Rect> Inkscape::SnappedPoint::_distribution_bboxes
protected

Definition at line 149 of file snapped-point.h.

Referenced by getBBoxes().

◆ _distribution_bboxes2

std::vector<Geom::Rect> Inkscape::SnappedPoint::_distribution_bboxes2
protected

Definition at line 150 of file snapped-point.h.

Referenced by getBBoxes2().

◆ _equal_distance

Geom::Coord Inkscape::SnappedPoint::_equal_distance
protected

Definition at line 175 of file snapped-point.h.

Referenced by getDistributionDistance().

◆ _equal_distance2

Geom::Coord Inkscape::SnappedPoint::_equal_distance2
protected

Definition at line 177 of file snapped-point.h.

Referenced by getDistributionDistance2().

◆ _fully_constrained

bool Inkscape::SnappedPoint::_fully_constrained
protected

Definition at line 157 of file snapped-point.h.

Referenced by getFullyConstrained(), and Inkscape::SnappedCurve::SnappedCurve().

◆ _point

◆ _pointer_distance

Geom::Coord Inkscape::SnappedPoint::_pointer_distance
protected

Definition at line 185 of file snapped-point.h.

Referenced by getPointerDistance(), and setPointerDistance().

◆ _second_always_snap

bool Inkscape::SnappedPoint::_second_always_snap
protected

◆ _second_distance

◆ _second_tolerance

◆ _source

◆ _source_bbox

Geom::OptRect Inkscape::SnappedPoint::_source_bbox
protected

Definition at line 183 of file snapped-point.h.

Referenced by getSourceBBox().

◆ _source_num

long Inkscape::SnappedPoint::_source_num
protected

◆ _tangent

Geom::Point Inkscape::SnappedPoint::_tangent
protected

Definition at line 146 of file snapped-point.h.

Referenced by getTangent(), and Inkscape::SnappedCurve::SnappedCurve().

◆ _target

◆ _target_bbox

Geom::OptRect Inkscape::SnappedPoint::_target_bbox
protected

◆ _tolerance


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