Easy3D 2.5.3
|
A generic segmentation representation, which supports both 2D and 3D line segments. More...
#include <easy3d/core/segment.h>
Public Types | |
typedef Vec< DIM, FT > | Point |
typedef Vec< DIM, FT > | Vector |
typedef GenericLine< DIM, FT > | Line |
typedef GenericSegment< DIM, FT > | thisclass |
Public Member Functions | |
GenericSegment (const Point &s, const Point &t) | |
Constructs a line segments from its two end points s and t . | |
const Point & | source () const |
Returns the source end point of this line segment. | |
const Point & | target () const |
Returns the target end point of this line segment. | |
void | set_source (const Point &s) |
Sets/Changes the source end point of this line segment. | |
void | set_target (const Point &t) |
Sets/Changes the target end point of this line segment. | |
Line | supporting_line () const |
Returns the supporting line of this line segment. | |
Vector | to_vector () const |
Returns a vector originating from source() and pointing to target(). | |
Point | projection (const Point &p) const |
Returns the projection of a point p on the supporting line of this segment. | |
bool | projected_inside (const Point &p) const |
Tests if the projection of a point p is within the two end points of this segment. | |
FT | squared_distance (const Point &p) const |
Returns the squared distance of a point p to this segment. The return the value is the min of the following: More... | |
A generic segmentation representation, which supports both 2D and 3D line segments.
|
inline |
Returns the squared distance of a point p
to this segment. The return the value is the min of the following:
p
and the supporting_line() of this segment;p
and the source() of this segment;p
and the target() of this segment;