50#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_TRIANGLE_3D_H
51#define LASS_GUARDIAN_OF_INCLUSION_PRIM_TRIANGLE_3D_H
71 typedef typename TPoint::TVector TVector;
75 typedef typename TPoint::TValue TValue;
76 typedef typename TPoint::TParam TParam;
77 typedef typename TPoint::TReference TReference;
78 typedef typename TPoint::TConstReference TConstReference;
79 typedef typename TPoint::TNumTraits TNumTraits;
81 enum { dimension = TPoint::dimension };
83 template <
typename U>
struct Rebind
89 Triangle3D(
const TPoint& iA,
const TPoint& iB,
const TPoint& iC);
93 const TPoint&
at(
int iIndexOfVertex)
const;
94 TPoint&
at(
int iIndexOfVertex);
95 const TLineSegment
edge(
int iIndexOfTailVertex)
const;
96 const TVector
vector(
int iIndexOfTailVertex)
const;
115 bool isInRange(
size_t iIndexOfVertex)
const;
119 TPoint vertices_[size_];
125std::ostream& operator<<(std::ostream& ioOStream,
const Triangle3D<T>& iTriangle);
135#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_AABB_3D_H
139#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_RAY_3D_H
Output stream for writing a selection of geometric primitives to XML files.
const TValue squaredArea() const
returns squared area of triangle to avoid the square root.
const TPoint & operator[](size_t iIndexOfVertex) const
return vertex of polygon by its index, not wrapped, no bounds check.
bool isEmpty() const
return true if polygon has no vertices
size_t size() const
return number of vertices
Triangle3D(const TPoint &iA, const TPoint &iB, const TPoint &iC)
Constructs a triangle through three points in positive sequence.
const TValue area() const
return area of the polygons surface.
bool isSimple() const
return true if polygon is simple, false if not.
const TPoint & at(int iIndexOfVertex) const
return vertex of polygon by its index, but wrap around the bounds.
const TLineSegment edge(int iIndexOfTailVertex) const
return the edge of the polygon between vertices at(iIndex) and at(iIndex + 1).
bool isReflex(int iIndexOfVertex) const
return true if inner angle of vertex is reflex (is > 180 degrees).
const TPointH vertexCentroid() const
return the barycenter of all vertices.
const TPlane plane() const
return support plane of polygon.
bool isConvex() const
return true if polygon is convex, false if not.
const TVector vector(int iIndexOfTailVertex) const
return the vector between vertices at(iIndex) and at(iIndex + 1)\
const TPointH surfaceCentroid() const
return the centroid of the filled polygon.
TPoint & operator[](size_t iIndexOfVertex)
return vertex of polygon by its index, not wrapped, no bounds check.
const TValue perimeter() const
return sum of the lengths of all edges
TPoint & at(int iIndexOfVertex)
return vertex of polygon by its index, but wrap around the bounds.
Triangle3D()
constructs an empty triangle.
#define LASS_SIMD_ALIGN
if LASS_SIMD_ALIGNMENT is set, use LASS_SIMD_ALIGN to align some structures on SIMD alignment boundar...
set of geometrical primitives
Library for Assembled Shared Sources.