QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
anonymous_namespace{autobreakconductor.cpp} Namespace Reference

Functions

qreal distanceToSegment (const QPointF &point, const QLineF &segment)
 distanceToSegment

Function Documentation

◆ distanceToSegment()

qreal anonymous_namespace{autobreakconductor.cpp}::distanceToSegment ( const QPointF & point,
const QLineF & segment )

distanceToSegment

Parameters
point: point to measure from
segment: the finite segment (not the infinite line through it)
Returns
the distance from point to the closest point actually on segment. Unlike QET::orthogonalProjection(), which reports a hit for any point on the segment's infinite extension, this clamps the projection to the segment itself: a point collinear with a wire but past its actual drawn end is correctly reported as far away, not "on" the wire.
Here is the caller graph for this function: