15 : _start_point_of_line(start_point_of_line), _end_point_of_line(end_point_of_line)
38 _at_intersection =
false;
40 _second_tolerance = 1;
41 _second_always_snap =
false;
62 Geom::Point inters_pt = getLineSegment().pointAt((*inters).ta);
67 bool const c1 = this->getAlwaysSnap() && !line.
getAlwaysSnap();
74 bool const use_this_as_primary = c1 || c2;
79 return SnappedPoint(inters_pt,
SNAPSOURCE_UNDEFINED, primarySLS->
getSourceNum(),
SNAPTARGET_PATH_INTERSECTION, primaryDist, primarySLS->
getTolerance(), primarySLS->
getAlwaysSnap(),
true,
false,
true,
84 return SnappedPoint(
Geom::Point(
Geom::infinity(),
Geom::infinity()),
SNAPSOURCE_UNDEFINED, 0,
SNAPTARGET_UNDEFINED,
Geom::infinity(), 0,
false,
false,
false,
false,
Geom::infinity(), 0,
false);
90 : _normal_to_line(normal_to_line), _point_on_line(point_on_line)
112 _always_snap =
false;
114 _second_tolerance = 1;
115 _second_always_snap =
false;
116 _at_intersection =
false;
140 Geom::Point inters_pt = getLine().pointAt((*inters).ta);
145 bool const c1 = this->getAlwaysSnap() && !line.
getAlwaysSnap();
151 bool const use_this_as_primary = c1 || c2;
156 return SnappedPoint(inters_pt,
Inkscape::SNAPSOURCE_UNDEFINED, primarySL->
getSourceNum(),
Inkscape::SNAPTARGET_UNDEFINED, primaryDist, primarySL->
getTolerance(), primarySL->
getAlwaysSnap(),
true,
false,
true,
163 return SnappedPoint(
Geom::Point(
Geom::infinity(),
Geom::infinity()),
SNAPSOURCE_UNDEFINED, 0,
SNAPTARGET_UNDEFINED,
Geom::infinity(), 0,
false,
false,
false,
false,
Geom::infinity(), 0,
false);
169 bool success =
false;
171 for (std::list<Inkscape::SnappedLineSegment>::const_iterator i = list.begin(); i != list.end(); ++i) {
172 if ((i == list.begin()) || (*i).getSnapDistance() <
result.getSnapDistance()) {
184 bool success =
false;
186 for (std::list<Inkscape::SnappedLineSegment>::const_iterator i = list.begin(); i != list.end(); ++i) {
187 std::list<Inkscape::SnappedLineSegment>::const_iterator j = i;
189 for (; j != list.end(); ++j) {
193 bool const c1 = !success;
200 if (c1 || c2 || c3) {
214 bool success =
false;
216 for (std::list<Inkscape::SnappedLine>::const_iterator i = list.begin(); i != list.end(); ++i) {
217 if ((i == list.begin()) || (*i).getSnapDistance() <
result.getSnapDistance()) {
229 bool success =
false;
231 for (std::list<Inkscape::SnappedLine>::const_iterator i = list.begin(); i != list.end(); ++i) {
232 std::list<Inkscape::SnappedLine>::const_iterator j = i;
234 for (; j != list.end(); ++j) {
238 bool const c1 = !success;
245 if (c1 || c2 || c3) {
259 bool success =
false;
261 for (
const auto & i : list1) {
262 for (
const auto & j : list2) {
266 bool const c1 = !success;
273 if (c1 || c2 || c3) {
Two-dimensional point that doubles as a vector.
Class describing the result of an attempt to snap to a line segment.
Geom::LineSegment getLineSegment() const
Inkscape::SnappedPoint intersect(SnappedLineSegment const &line) const
Class describing the result of an attempt to snap to a line.
Geom::Line getLine() const
Inkscape::SnappedPoint intersect(SnappedLine const &line) const
Class describing the result of an attempt to snap.
Geom::Coord _second_distance
Geom::Point getPoint() const
Geom::Coord getTolerance() const
bool getAlwaysSnap() const
Geom::Coord getSnapDistance() const
long getSourceNum() const
bool getAtIntersection() const
Geom::Coord getSecondSnapDistance() const
Geom::Coord _second_tolerance
constexpr Coord infinity()
Get a value representing infinity.
double Coord
Floating point type used to store coordinates.
std::optional< Crossing > OptCrossing
OptCrossing intersection(Ray const &r1, Line const &l2)
SBasis L2(D2< SBasis > const &a, unsigned k)
SnapSourceType
enumerations of snap source types and snap target types.
@ SNAPTARGET_PATH_INTERSECTION
bool getClosestSLS(std::list< Inkscape::SnappedLineSegment > const &list, Inkscape::SnappedLineSegment &result)
bool getClosestSL(std::list< Inkscape::SnappedLine > const &list, Inkscape::SnappedLine &result)
bool getClosestIntersectionSLS(std::list< Inkscape::SnappedLineSegment > const &list, Inkscape::SnappedPoint &result)
bool getClosestIntersectionSL(std::list< Inkscape::SnappedLine > const &list, Inkscape::SnappedPoint &result)