31#if defined(RayIntersectionPredicates_RECURSES)
32#error Recursive header files inclusion detected in RayIntersectionPredicates.h
35#define RayIntersectionPredicates_RECURSES
37#if !defined RayIntersectionPredicates_h
39#define RayIntersectionPredicates_h
44#include "DGtal/base/Common.h"
80 template <
typename TPo
int>
110 "Direction must be non-null vector");
127 const Point &v3)
const
130 ASSERT((v1 != v2 ) && (v1 != v3) && (v2 != v3));
141 P =
myDest.crossProduct( e2 );
174 Q = T.crossProduct( e1 );
220 const Point &v4)
const
222 return (this->
operator()(v1,v2,v3) ||
223 this->
operator()(v1,v4,v3) );
239 template <
typename Surfel >
242 auto const & aPreSurfel = aSurfel.
preCell();
249 Point baseQuadCenter = aPreSurfel.coordinates;
257 x1= baseQuadCenter[0]-ONE; y1= baseQuadCenter[1]-ONE; z1= baseQuadCenter[2];
258 x2= baseQuadCenter[0]+ONE; y2= baseQuadCenter[1]-ONE; z2= baseQuadCenter[2];
259 x3= baseQuadCenter[0]+ONE; y3= baseQuadCenter[1]+ONE; z3= baseQuadCenter[2];
260 x4= baseQuadCenter[0]-ONE; y4= baseQuadCenter[1]+ONE; z4= baseQuadCenter[2];
265 x1= baseQuadCenter[0]-ONE; y1= baseQuadCenter[1]; z1= baseQuadCenter[2]-ONE;
266 x2= baseQuadCenter[0]-ONE; y2= baseQuadCenter[1]; z2= baseQuadCenter[2]+ONE;
267 x3= baseQuadCenter[0]+ONE; y3= baseQuadCenter[1]; z3= baseQuadCenter[2]+ONE;
268 x4= baseQuadCenter[0]+ONE; y4= baseQuadCenter[1]; z4= baseQuadCenter[2]-ONE;
273 x1= baseQuadCenter[0]; y1= baseQuadCenter[1]-ONE; z1= baseQuadCenter[2]-ONE;
274 x2= baseQuadCenter[0]; y2= baseQuadCenter[1]+ONE; z2= baseQuadCenter[2]-ONE;
275 x3= baseQuadCenter[0]; y3= baseQuadCenter[1]+ONE; z3= baseQuadCenter[2]+ONE;
276 x4= baseQuadCenter[0]; y4= baseQuadCenter[1]-ONE; z4= baseQuadCenter[2]+ONE;
295#undef RayIntersectionPredicates_RECURSES
DGtal is the top-level namespace which contains all DGtal functions and types.
static DGtal::int64_t castToInt64_t(const std::decay< T >::type &aT)
Cast method to DGtal::int64_t (for I/O or board export uses only).
Aim: The traits class for all models of Cinteger.
This class implements various intersection predicates between a ray and a triangle,...
TPoint Point
Type of point.
TPoint::Component Component
Type of point coordinates.
bool operator()(const Surfel &aSurfel) const
bool operator()(const Point &v1, const Point &v2, const Point &v3, const Point &v4) const
TPoint Vector
Type of vector.
RayIntersectionPredicate(const Point &origin, const Vector &dest)
bool operator()(const Point &v1, const Point &v2, const Point &v3) const
BOOST_STATIC_ASSERT(TPoint::dimension==3)
Only in dimension 3.
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
SPreCell const & preCell() const
Returns the underlying constant signed pre-cell.