1 #ifndef ADAPTIVE_CONE_HPP_
2 #define ADAPTIVE_CONE_HPP_
4 #include <boost/fusion/include/mpl.hpp>
5 #include "Space/Shape/Box.hpp"
6 #include "Space/Shape/Point.hpp"
7 #include <boost/mpl/range_c.hpp>
8 #include <boost/mpl/for_each.hpp>
70 template<
unsigned int dim ,
typename T>
79 typedef boost::fusion::vector<T[dim]>
type;
86 static const unsigned int p1 = 0;
108 T up = b.template getBase<Base::UP>(dim-1);
118 if (b.template getBase<Base::UP>(dim-1) < boost::fusion::at_c<PointA::x>(
data)[dim-1] )
120 r_p = boost::fusion::at_c<PointA::x>(
data)[dim-1];
126 r_p = b.template getBase<Base::UP>(dim-1);
132 return upBase.Intersect<distance>(acon);
155 return Intersect<distance>(b);
169 for (
int i = 0 ; i < dim ; i++)
171 boost::fusion::at_c<0>(
data)[i] = pt[i];
189 T r = pnt.
get(dim-1);
195 sphere.isInside<Distance>(pnt.getSubPoint(dim-1));
205 template<
typename Distance>
bool isInside(
float * pnt)
217 sphere.isInside<Distance>(pnt);
const S * ptr
Pointer storing the data point.
Box< dim-1, T > getSubBox()
Get the the box of dimensionality dim-1 (it eliminate the last dimension)
This class represent an Adaptive cylinder cone.
bool isInside(Point< dim, T > pnt)
Is a point inside the adaptive cone.
boost::fusion::vector< T[dim]> type
boost fusion that store the point
This class implement the point shape in an N-dimensional space.
this class is a functor for "for_each" algorithm
T get(int i) const
Get coordinate.
void operator()(T &t) const
It call the copy function for each member.
bool Intersect(Box< dim, T > b)
This function check if a box intersect this shape.
AdaptiveCylinderCone(const T *pt)
Create an adaptive cylinder Cone for the point pt.
bool isInside(float *pnt)
Is a point inside the adaptive cone.
copy_acc(const S *ptr)
constructor it fix the size
This class represent an N-dimensional box.
static const unsigned int p1
Point where cone and cylinder base match.
This class implement the Sphere concept in an N-dimensional space.
Point< dim, T > PointA
Base structure that define a Point.
bool Intersect(Box< dim, T > b, int div, T *dists, T &minsqdistance)
This function check if a box intersect this shape.