Visual Computing Library
Loading...
Searching...
No Matches
vcl::SegmentConcept Concept Reference

Concept for types representing line segments in Euclidean space. More...

#include <vclib/concepts/space/segment.h>

Concept definition

template<typename T>
concept vcl::SegmentConcept = requires (
T&& obj,
typename RemoveRef<T>::PointType p,
typename RemoveRef<T>::ScalarType s) {
typename RemoveRef<T>::PointType;
typename RemoveRef<T>::ScalarType;
obj.DIM;
RemoveRef<T>();
RemoveRef<T>(p, p);
{ obj.p0() } -> PointConcept;
{ obj.p1() } -> PointConcept;
{ obj.midPoint() } -> PointConcept;
{ obj.direction() } -> PointConcept;
{ obj.normalizedDirection() } -> PointConcept;
{ obj.length() } -> std::same_as<decltype(s)>;
{ obj.squaredLength() } -> std::same_as<decltype(s)>;
{ obj == obj } -> std::same_as<bool>;
{ obj != obj } -> std::same_as<bool>;
{ obj + obj } -> std::convertible_to<RemoveRef<T>>;
{ obj - obj } -> std::convertible_to<RemoveRef<T>>;
{ obj* s } -> std::convertible_to<RemoveRef<T>>;
{ obj / s } -> std::convertible_to<RemoveRef<T>>;
requires IsConst<T> || requires {
{ obj.flip() } -> std::same_as<void>;
{ obj = obj } -> std::same_as<T&>;
{ obj += obj } -> std::same_as<T&>;
{ obj -= obj } -> std::same_as<T&>;
{ obj *= s } -> std::same_as<T&>;
{ obj /= s } -> std::same_as<T&>;
};
}
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
PointT & p1()
Returns the second endpoint of the segment.
Definition segment.h:97
Concept for types representing points in Euclidean space.
Definition point.h:40
Concept for types representing line segments in Euclidean space.
Definition segment.h:36

Detailed Description

Concept for types representing line segments in Euclidean space.

Template Parameters
TThe type to be tested for conformity to the SegmentConcept.