56 #include <OpenMesh/Core/Geometry/VectorT.hh> 63 template <
class BSPCore>
68 typedef typename BSPCore::Traits Traits;
69 typedef typename BSPCore::Handle Handle;
70 typedef typename BSPCore::Point Point;
71 typedef typename BSPCore::Scalar Scalar;
72 typedef typename BSPCore::Node Node;
73 typedef typename BSPCore::Handles Handles;
74 typedef typename BSPCore::HandleIter HandleIter;
79 BSPImplT(
const Traits& _traits,
const Scalar& _infinity = std::numeric_limits<Scalar>::infinity()) :
81 infinity_(_infinity) {}
98 NearestNeighbor
nearest(
const Point& _p)
const;
110 RayCollision
raycollision (
const Point& _p,
const Point& _r)
const;
150 template<
class Callback>
151 void intersectBall(
const Point & _c, Scalar _r, Callback _callback)
const;
164 stream <<
"[NearestNeghborData instance. ref: " << data.ref <<
", dist: " << data.dist <<
", nearest: " << data.nearest.idx() <<
"]";
176 RayCollision hit_handles;
197 void _raycollision_nearest_directional(Node* _node,
RayCollisionData& _data)
const;
199 template<
class Callback>
200 void _intersect_ball(
const Node& _node,
const Point & _c, Scalar _r, Callback _callback)
const;
202 template<
typename T,
typename U>
204 bool operator()(
const std::pair<T,U> &left,
const std::pair<T,U> &right) {
205 return (fabs(left.second) < fabs(right.second));
209 const Scalar infinity_;
214 #if defined(OM_INCLUDE_TEMPLATES) && !defined(BSPIMPLT_C) 215 # define BSPIMPLT_TEMPLATES 216 # include "BSPImplT_impl.hh" 219 #endif // BSPIMPLT_HH defined Store ray collide information.
RayCollision raycollision(const Point &_p, const Point &_r) const
intersect mesh with ray
NearestNeighbor nearest(const Point &_p) const
Return handle of the nearest neighbor face.
void _raycollision_directional(Node *_node, RayCollisionData &_data) const
recursive part of directionalRaycollision()
RayCollision nearestRaycollision(const Point &_p, const Point &_r) const
intersect mesh with ray
void _raycollision_non_directional(Node *_node, RayCollisionData &_data) const
recursive part of raycollision()
Store nearest neighbor information.
std::vector< std::pair< Handle, Scalar > > RayCollision
Store nearest neighbor information.
RayCollision directionalRaycollision(const Point &_p, const Point &_r) const
intersect mesh with ray
Store nearest neighbor information.
void intersectBall(const Point &_c, Scalar _r, Callback _callback) const
intersect mesh with open ball