23#ifndef VCL_SPACE_CORE_TRIANGLE_WRAPPER_H
24#define VCL_SPACE_CORE_TRIANGLE_WRAPPER_H
52template<Po
intConcept Po
intT>
55 const PointT& mPoint0;
56 const PointT& mPoint1;
57 const PointT& mPoint2;
60 using ScalarType = PointT::ScalarType;
61 using PointType = PointT;
66 static const uint
DIM = PointT::DIM;
79 mPoint0(p0), mPoint1(p1), mPoint2(
p2)
86 constexpr uint
size()
const {
return 3; }
94 case 0:
return mPoint0;
95 case 1:
return mPoint1;
96 case 2:
return mPoint2;
98 throw std::out_of_range(
99 "TriangleWrapper::point: index out of range");
106 const PointT&
point0()
const {
return mPoint0; }
111 const PointT&
point1()
const {
return mPoint1; }
116 const PointT&
point2()
const {
return mPoint2; }
163 mPoint0, mPoint1, mPoint2,
w0, w1, w2);
172 mPoint0, mPoint1, mPoint2, w(0), w(1), w(2));
184 mPoint0, mPoint1, mPoint2,
b0,
b1,
b2);
193 mPoint0, mPoint1, mPoint2,
b(0),
b(1),
b(2));
247template<
typename Scalar>
248using TriangleWrapper2 = TriangleWrapper<Point2<Scalar>>;
250using TriangleWrapper2f = TriangleWrapper<Point2f>;
251using TriangleWrapper2d = TriangleWrapper<Point2d>;
253template<
typename Scalar>
254using TriangleWrapper3 = TriangleWrapper<Point3<Scalar>>;
256using TriangleWrapper3f = TriangleWrapper<Point3f>;
257using TriangleWrapper3d = TriangleWrapper<Point3d>;
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
The TriangleWrapper class is a wrapper around a N-Dimensional triangle.
Definition triangle_wrapper.h:54
PointT weightedBarycenter(ScalarType w0, ScalarType w1, ScalarType w2) const
Computes the weighted barycenter of the triangle.
Definition triangle_wrapper.h:160
static const uint DIM
Dimension of the triangle.
Definition triangle_wrapper.h:66
ScalarType sideLength0() const
Returns the length of the first side of the triangle.
Definition triangle_wrapper.h:129
ScalarType perimeter() const
Computes the perimeter of the triangle.
Definition triangle_wrapper.h:207
TriangleWrapper(const PointT &p0, const PointT &p1, const PointT &p2)
Constructs a triangle wrapper around the three input points.
Definition triangle_wrapper.h:78
const PointT & point(uint i) const
Definition triangle_wrapper.h:91
ScalarType area() const
Computes the area of the triangle.
Definition triangle_wrapper.h:215
const PointT & point0() const
Definition triangle_wrapper.h:106
PointT normal() const
Returns the normal of the triangle.
Definition triangle_wrapper.h:144
PointT barycenter() const
Computes the barycenter of the triangle.
Definition triangle_wrapper.h:152
const PointT & point1() const
Definition triangle_wrapper.h:111
ScalarType qualityMeanRatio() const
Compute the mean ratio of the triangle shape quality measure.
Definition triangle_wrapper.h:239
PointT barycentricCoordinatePoint(const Point3< ScalarType > &b) const
Definition triangle_wrapper.h:190
ScalarType qualityRadii() const
Compute a shape quality measure of the triangle.
Definition triangle_wrapper.h:231
ScalarType sideLength1() const
Returns the length of the second side of the triangle.
Definition triangle_wrapper.h:134
const PointT & point2() const
Definition triangle_wrapper.h:116
ScalarType sideLength2() const
Returns the length of the third side of the triangle.
Definition triangle_wrapper.h:139
PointT barycentricCoordinatePoint(ScalarType b0, ScalarType b1, ScalarType b2) const
Definition triangle_wrapper.h:178
ScalarType sideLength(uint i) const
Returns the length of the i-th side of the triangle.
Definition triangle_wrapper.h:121
constexpr uint size() const
Returns the number of points of the triangle.
Definition triangle_wrapper.h:86
PointT circumcenter() const
Compute the circumcenter of the triangle.
Definition triangle_wrapper.h:199
ScalarType quality() const
Calculates the quality measure of the triangle.
Definition triangle_wrapper.h:223
PointT weightedBarycenter(const Point3< ScalarType > &w) const
Computes the weighted barycenter of the triangle.
Definition triangle_wrapper.h:169
ScalarType area() const
Computes the area of the triangle.
Definition triangle.h:219
ScalarType quality() const
Calculates the quality measure of the triangle.
Definition triangle.h:234
ScalarType qualityMeanRatio() const
Compute the mean ratio of the triangle shape quality measure.
Definition triangle.h:271
ScalarType perimeter() const
Computes the perimeter of the triangle.
Definition triangle.h:209
PointT weightedBarycenter(ScalarType w0, ScalarType w1, ScalarType w2) const
Computes the weighted barycenter of the triangle.
Definition triangle.h:138
PointT barycenter() const
Computes the barycenter of the triangle.
Definition triangle.h:122
PointT normal() const
Returns the normal of the triangle.
Definition triangle.h:112
ScalarType sideLength(uint i) const
Returns the length of the i-th side of the triangle.
Definition triangle.h:83
PointT circumcenter() const
Compute the circumcenter of the triangle.
Definition triangle.h:199
ScalarType qualityRadii() const
Compute a shape quality measure of the triangle.
Definition triangle.h:251