mirror of https://github.com/CGAL/cgal
Drop-in for as_ray_parameter
This needs to be replaced with a non-hacky solution.
This commit is contained in:
parent
5e6ae0f29d
commit
2540612e97
|
|
@ -167,6 +167,8 @@ class AABB_traits:
|
||||||
{
|
{
|
||||||
typedef typename CGAL::Object Object;
|
typedef typename CGAL::Object Object;
|
||||||
public:
|
public:
|
||||||
|
typedef GeomTraits Geom_traits;
|
||||||
|
|
||||||
typedef AABB_traits<GeomTraits, AABBPrimitive> AT;
|
typedef AABB_traits<GeomTraits, AABBPrimitive> AT;
|
||||||
// AABBTraits concept types
|
// AABBTraits concept types
|
||||||
typedef typename GeomTraits::FT FT;
|
typedef typename GeomTraits::FT FT;
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ public:
|
||||||
private:
|
private:
|
||||||
const AABBTree& tree_;
|
const AABBTree& tree_;
|
||||||
typedef typename AABBTree::AABB_traits AABB_traits;
|
typedef typename AABBTree::AABB_traits AABB_traits;
|
||||||
|
typedef typename AABBTree::Point Point;
|
||||||
typedef typename AABBTree::FT FT;
|
typedef typename AABBTree::FT FT;
|
||||||
typedef typename AABBTree::Node Node;
|
typedef typename AABBTree::Node Node;
|
||||||
typedef typename AABBTree::size_type size_type;
|
typedef typename AABBTree::size_type size_type;
|
||||||
|
|
@ -143,8 +144,16 @@ private:
|
||||||
|
|
||||||
template<typename Ray>
|
template<typename Ray>
|
||||||
FT as_ray_parameter(const Ray& ray,
|
FT as_ray_parameter(const Ray& ray,
|
||||||
const typename AABBTree::template Intersection_and_primitive_id<Ray>::Type& intersection) {
|
const typename AABBTree::template Intersection_and_primitive_id<Ray>::Type& intersection)
|
||||||
return 0;
|
const {
|
||||||
|
// TODO replace with non-hacky solution
|
||||||
|
if(const Point* point = boost::get<const Point>(&(intersection.first))) {
|
||||||
|
typename AABB_traits::Geom_traits::Vector_3 distance_ray(*point, ray.source());
|
||||||
|
return distance_ray.squared_length();
|
||||||
|
} else {
|
||||||
|
std::cout << "not handled" << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue