|
Visual Computing Library
devel
|
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConcept, which must provide the DIM constant and the [] operator for accessing the point coordinates.
More...
#include <vclib/space/core/segment.h>
Public Types | |
| using | PointType = PointT |
| The type of point used to represent the endpoint points of the segment. | |
| using | ScalarType = PointT::ScalarType |
| The scalar type of the endpoint points. | |
Public Member Functions | |
| PointT | direction () const |
| void | flip () |
| ScalarType | length () const |
| PointT | midPoint () const |
| PointT | normalizedDirection () const |
| bool | operator!= (const Segment< PointT > &s) const =default |
| Segment< PointT > | operator* (const ScalarType &s) const |
| Segment< PointT > & | operator*= (const ScalarType &s) const |
| Segment< PointT > | operator+ (const Segment< PointT > &s) const |
| Segment< PointT > & | operator+= (const Segment< PointT > &s) const |
| Segment< PointT > | operator- (const Segment< PointT > &s) const |
| Segment< PointT > & | operator-= (const Segment< PointT > &s) const |
| Segment< PointT > | operator/ (const ScalarType &s) const |
| Segment< PointT > & | operator/= (const ScalarType &s) const |
| bool | operator== (const Segment< PointT > &s) const =default |
| PointT & | p0 () |
| Returns the first endpoint of the segment. | |
| const PointT & | p0 () const |
| Returns the first endpoint of the segment. | |
| PointT & | p1 () |
| Returns the second endpoint of the segment. | |
| const PointT & | p1 () const |
| Returns the second endpoint of the segment. | |
| Segment () | |
| Default constructor. Creates a segment with endpoints at the origin. | |
| Segment (const PointT &p0, const PointT &p1) | |
| Creates a segment with the given endpoints. | |
| ScalarType | squaredLength () const |
Static Public Attributes | |
| static const uint | DIM = PointT::DIM |
| The dimensionality of the segment. | |
Private Attributes | |
| PointT | mPoint0 |
| PointT | mPoint1 |
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConcept, which must provide the DIM constant and the [] operator for accessing the point coordinates.
| PointT | The type of the two endpoint points of the segment. |
|
inline |
Creates a segment with the given endpoints.
| [in] | p0 | The first endpoint of the segment. |
| [in] | p1 | The second endpoint of the segment. |
|
inline |
Returns the first endpoint of the segment.
|
inline |
Returns the first endpoint of the segment.
|
inline |
Returns the second endpoint of the segment.
|
inline |
Returns the second endpoint of the segment.