mirror of https://github.com/CGAL/cgal
Merge branch 'AABB_tree-fix_graph_primitives-local'
This fixes the graph primitives that were only model of AABBPrimitiveWithSharedData, and also remove the artificial compatibility with deprecated primitives that are not needed since we want to make users use the new method. Successfully tested in CGAL-4.3-Ic-107 One example on the platform i686_Linux-2.6_g++-4.1.2_CentOS-5.1-O3 indicates an error, but after checking it is a floating point computation threshold issue. The example expects an error to be below 1e-10 and it is 1.1e-10. Approved by the interim release manager
This commit is contained in:
commit
f5f6b034a6
|
|
@ -401,7 +401,7 @@ void Scene::build_facet_tree()
|
|||
CGAL::Timer timer;
|
||||
timer.start();
|
||||
std::cout << "Construct Facet AABB tree...";
|
||||
m_facet_tree.rebuild(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end());
|
||||
m_facet_tree.rebuild(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end(),*m_pPolyhedron);
|
||||
m_facet_tree.accelerate_distance_queries();
|
||||
std::cout << "done (" << timer.time() << " s)" << std::endl;
|
||||
}
|
||||
|
|
@ -421,7 +421,7 @@ void Scene::build_edge_tree()
|
|||
CGAL::Timer timer;
|
||||
timer.start();
|
||||
std::cout << "Construct Edge AABB tree...";
|
||||
m_edge_tree.rebuild(m_pPolyhedron->edges_begin(),m_pPolyhedron->edges_end());
|
||||
m_edge_tree.rebuild(boost::edges(*m_pPolyhedron).first,boost::edges(*m_pPolyhedron).second,*m_pPolyhedron);
|
||||
m_edge_tree.accelerate_distance_queries();
|
||||
std::cout << "done (" << timer.time() << " s)" << std::endl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ void Scene::benchmark_intersections(const double duration)
|
|||
std::cout << "Construct AABB tree...";
|
||||
CGAL::Timer timer;
|
||||
timer.start();
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end());
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end(),*m_pPolyhedron);
|
||||
std::cout << "done (" << timer.time() << " s)" << std::endl;
|
||||
|
||||
// generates random queries
|
||||
|
|
@ -76,7 +76,7 @@ void Scene::benchmark_distances(const double duration)
|
|||
CGAL::Timer timer;
|
||||
timer.start();
|
||||
std::cout << "Construct AABB tree and internal KD tree...";
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end());
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end(),*m_pPolyhedron);
|
||||
tree.accelerate_distance_queries();
|
||||
std::cout << "done (" << timer.time() << " s)" << std::endl;
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ void Scene::bench_memory()
|
|||
// constructs tree and measure memory before then after
|
||||
typedef CGAL::Memory_sizer::size_type size_type;
|
||||
size_type before = CGAL::Memory_sizer().virtual_size();
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end());
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end(),*m_pPolyhedron);
|
||||
// tree.accelerate_distance_queries(); // 150 vs 61 bytes per primitive!
|
||||
|
||||
size_type after = CGAL::Memory_sizer().virtual_size();
|
||||
|
|
@ -159,12 +159,12 @@ void Scene::bench_construction()
|
|||
// constructs tree
|
||||
CGAL::Timer time1;
|
||||
time1.start();
|
||||
Facet_tree tree1(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end());
|
||||
Facet_tree tree1(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end(),*m_pPolyhedron);
|
||||
double duration_construction_alone = time1.time();
|
||||
|
||||
CGAL::Timer time2;
|
||||
time2.start();
|
||||
Facet_tree tree2(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end());
|
||||
Facet_tree tree2(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end(),*m_pPolyhedron);
|
||||
tree2.accelerate_distance_queries();
|
||||
double duration_construction_and_kdtree = time2.time();
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ void Scene::bench_intersections_vs_nbt()
|
|||
refiner.run_nb_splits(nb_splits);
|
||||
|
||||
// constructs tree (out of timing)
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end());
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end(),*m_pPolyhedron);
|
||||
|
||||
// calls ray queries
|
||||
CGAL::Timer timer;
|
||||
|
|
@ -247,7 +247,7 @@ void Scene::bench_distances_vs_nbt()
|
|||
refiner.run_nb_splits(nb_splits);
|
||||
|
||||
// constructs tree (out of timing)
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end());
|
||||
Facet_tree tree(m_pPolyhedron->facets_begin(),m_pPolyhedron->facets_end(),*m_pPolyhedron);
|
||||
tree.accelerate_distance_queries();
|
||||
|
||||
// calls queries
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ typedef K::FT FT;
|
|||
typedef K::Point_3 Point;
|
||||
typedef K::Segment_3 Segment;
|
||||
typedef CGAL::Polyhedron_3<K> Polyhedron;
|
||||
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
|
||||
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron, CGAL::Default, CGAL::Tag_false> Primitive;
|
||||
typedef CGAL::AABB_traits<K, Primitive> Traits;
|
||||
typedef CGAL::AABB_tree<Traits> Tree;
|
||||
typedef Tree::Point_and_primitive_id Point_and_primitive_id;
|
||||
|
|
@ -33,13 +33,13 @@ int main()
|
|||
Point s2(10.0, 0.0, 0.0);
|
||||
Polyhedron polyhedron2;
|
||||
polyhedron2.make_tetrahedron(p2, q2, r2, s2);
|
||||
// constructs AABB tree and computes internal KD-tree
|
||||
// constructs AABB tree and computes internal KD-tree
|
||||
// data structure to accelerate distance queries
|
||||
Tree tree(polyhedron1.facets_begin(),polyhedron1.facets_end());
|
||||
Tree tree(polyhedron1.facets_begin(),polyhedron1.facets_end(), polyhedron1);
|
||||
|
||||
tree.accelerate_distance_queries();
|
||||
|
||||
tree.insert(polyhedron2.facets_begin(),polyhedron2.facets_end());
|
||||
tree.insert(polyhedron2.facets_begin(),polyhedron2.facets_end(), polyhedron2);
|
||||
|
||||
// query point
|
||||
Point query(0.0, 0.0, 3.0);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
#include <CGAL/AABB_traits.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <CGAL/AABB_halfedge_graph_segment_primitive.h>
|
||||
|
||||
#include <CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> K;
|
||||
typedef K::FT FT;
|
||||
|
|
@ -29,7 +30,9 @@ int main()
|
|||
|
||||
// constructs the AABB tree and the internal search tree for
|
||||
// efficient distance queries.
|
||||
Tree tree(polyhedron.edges_begin(),polyhedron.edges_end());
|
||||
Tree tree( CGAL::undirected_edges(polyhedron).first,
|
||||
CGAL::undirected_edges(polyhedron).second,
|
||||
polyhedron);
|
||||
tree.accelerate_distance_queries();
|
||||
|
||||
// counts #intersections with a triangle query
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ int main()
|
|||
|
||||
// constructs AABB tree and computes internal KD-tree
|
||||
// data structure to accelerate distance queries
|
||||
Tree tree(polyhedron.facets_begin(),polyhedron.facets_end());
|
||||
Tree tree(polyhedron.facets_begin(),polyhedron.facets_end(),polyhedron);
|
||||
tree.accelerate_distance_queries();
|
||||
|
||||
// query point
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ int main()
|
|||
polyhedron.make_tetrahedron(p, q, r, s);
|
||||
|
||||
// constructs AABB tree
|
||||
Tree tree(polyhedron.facets_begin(),polyhedron.facets_end());
|
||||
Tree tree(polyhedron.facets_begin(),polyhedron.facets_end(),polyhedron);
|
||||
|
||||
// constructs segment query
|
||||
Point a(-0.2, 0.2, -0.2);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,11 @@ namespace CGAL {
|
|||
*\tparam FaceGraph is a \cgal polyhedron.
|
||||
*\tparam VertexPointPMap must be set to `CGAL::Default`
|
||||
* This parameter is useless for the moment and will be useful in an upcoming release of \cgal.
|
||||
*\tparam OneFaceGraphPerTree must be set to `CGAL::Default`
|
||||
*\tparam OneFaceGraphPerTree is either `CGAL::Tag_true or `CGAL::Tag_false`.
|
||||
* In the former case, we guarantee that all the primitives will be from a
|
||||
* common polyhedron and some data will be factorized so that the size of
|
||||
* the primitive is reduced. In the latter case, the primitives can be from
|
||||
* different polyhedra and extra storage is required in the primitives. The default is `CGAL::Tag_true`.
|
||||
* This parameter is useless for the moment and will be useful in an upcoming release of \cgal.
|
||||
*\tparam CacheDatum is either `CGAL::Tag_true` or `CGAL::Tag_false`. In the former case, the datum is stored
|
||||
* in the primitive, while in the latter it is constructed on the fly to reduce the memory footprint.
|
||||
|
|
@ -52,7 +56,7 @@ namespace CGAL {
|
|||
*/
|
||||
template < class FaceGraph,
|
||||
class VertexPointPMap = Default,
|
||||
class OneFaceGraphPerTree = Default,
|
||||
class OneFaceGraphPerTree = Tag_true,
|
||||
class CacheDatum=Tag_false >
|
||||
class AABB_face_graph_triangle_primitive
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
|
|
@ -63,7 +67,7 @@ class AABB_face_graph_triangle_primitive
|
|||
>::type,
|
||||
Triangle_from_facet_handle_property_map<FaceGraph>,
|
||||
One_point_from_facet_handle_property_map<FaceGraph>,
|
||||
Tag_true,
|
||||
OneFaceGraphPerTree,
|
||||
CacheDatum >
|
||||
#endif
|
||||
{
|
||||
|
|
@ -77,7 +81,7 @@ class AABB_face_graph_triangle_primitive
|
|||
typedef AABB_primitive< Id_,
|
||||
Triangle_property_map,
|
||||
Point_property_map,
|
||||
Tag_true,
|
||||
OneFaceGraphPerTree,
|
||||
CacheDatum > Base;
|
||||
|
||||
public:
|
||||
|
|
@ -97,6 +101,11 @@ public:
|
|||
*/
|
||||
typedef boost::graph_traits<FaceGraph>::face_descriptor Id;
|
||||
/// @}
|
||||
|
||||
/*!
|
||||
If `OneFaceGraphPerTree` is CGAL::Tag_true, constructs a `Shared_data` object from a reference to the polyhedon `graph`.
|
||||
*/
|
||||
static unspecified_type construct_shared_data( FaceGraph& graph );
|
||||
#endif
|
||||
|
||||
// constructors
|
||||
|
|
@ -110,22 +119,14 @@ public:
|
|||
Triangle_property_map(&graph),
|
||||
Point_property_map(&graph) ){}
|
||||
|
||||
/// For backward-compatibility with AABB_polyhedron_triangle_primitive only.
|
||||
/// `Id_` is `Facet_const_handle` if `FaceGraph` is const and `Facet_handle` otherwise.
|
||||
AABB_face_graph_triangle_primitive(Id_ id)
|
||||
: Base( id,
|
||||
Triangle_property_map(NULL),
|
||||
Point_property_map(NULL) ){}
|
||||
|
||||
static typename Base::Shared_data construct_shared_data( FaceGraph& graph )
|
||||
/// \internal
|
||||
typedef internal::Cstr_shared_data<FaceGraph, Base, Triangle_property_map, Point_property_map, OneFaceGraphPerTree> Cstr_shared_data;
|
||||
/// \internal
|
||||
static
|
||||
typename Cstr_shared_data::Shared_data
|
||||
construct_shared_data(FaceGraph& graph)
|
||||
{
|
||||
return Base::construct_shared_data(Triangle_property_map(&graph), Point_property_map(&graph));
|
||||
}
|
||||
|
||||
/// For backward-compatibility with AABB_polyhedron_triangle_primitive only
|
||||
static typename Base::Shared_data construct_shared_data()
|
||||
{
|
||||
return Base::construct_shared_data(Triangle_property_map(NULL), Point_property_map(NULL));
|
||||
return Cstr_shared_data::construct_shared_data(graph);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <CGAL/is_iterator.h>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -84,7 +83,7 @@ class AABB_halfedge_graph_segment_primitive
|
|||
typedef AABB_primitive< Id_,
|
||||
Segment_property_map,
|
||||
Point_property_map,
|
||||
Tag_true,
|
||||
OneHalfedgeGraphPerTree,
|
||||
CacheDatum > Base;
|
||||
|
||||
public:
|
||||
|
|
@ -105,6 +104,11 @@ public:
|
|||
*/
|
||||
typedef boost::graph_traits<HalfedgeGraph>::edge_descriptor Id;
|
||||
/// @}
|
||||
|
||||
/*!
|
||||
If `OneHalfedgeGraphPerTreeGraphPerTree` is CGAL::Tag_true, constructs a `Shared_data` object from a reference to the halfedge graph.
|
||||
*/
|
||||
static unspecified_type construct_shared_data( HalfedgeGraph& graph );
|
||||
#endif
|
||||
|
||||
/*!
|
||||
|
|
@ -130,21 +134,14 @@ public:
|
|||
Point_property_map(&graph) ){}
|
||||
#endif
|
||||
|
||||
/// For backward-compatibility with AABB_polyhedron_segment_primitive only
|
||||
AABB_halfedge_graph_segment_primitive(Id_ id)
|
||||
: Base( id,
|
||||
Segment_property_map(NULL),
|
||||
Point_property_map(NULL) ){}
|
||||
|
||||
static typename Base::Shared_data construct_shared_data( HalfedgeGraph& graph )
|
||||
/// \internal
|
||||
typedef internal::Cstr_shared_data<HalfedgeGraph, Base, Segment_property_map, Point_property_map, OneHalfedgeGraphPerTree> Cstr_shared_data;
|
||||
/// \internal
|
||||
static
|
||||
typename Cstr_shared_data::Shared_data
|
||||
construct_shared_data(HalfedgeGraph& graph)
|
||||
{
|
||||
return Base::construct_shared_data(Segment_property_map(&graph), Point_property_map(&graph));
|
||||
}
|
||||
|
||||
///For backward-compatibility with AABB_polyhedron_segment_primitive only
|
||||
static typename Base::Shared_data construct_shared_data()
|
||||
{
|
||||
return Base::construct_shared_data(Segment_property_map(NULL), Point_property_map(NULL));
|
||||
return Cstr_shared_data::construct_shared_data(graph);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#ifndef CGAL_AABB_PRIMITIVE_H
|
||||
#define CGAL_AABB_PRIMITIVE_H
|
||||
|
||||
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
|
||||
#include <CGAL/property_map.h>
|
||||
#include <CGAL/tags.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/branches/features/AABB_tree-one_primitive_per_object-sloriot/AABB_tree/include/CGAL/AABB_triangle_primitive.h $
|
||||
// $Id: AABB_triangle_primitive.h 69127 2012-05-14 16:10:00Z sloriot $
|
||||
// $URL$
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// Author(s) : Sebastien Loriot
|
||||
|
|
@ -33,7 +33,32 @@ namespace CGAL{
|
|||
namespace internal{
|
||||
|
||||
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_nested_type_Shared_data,Shared_data,false)
|
||||
|
||||
|
||||
// Utility class used by AABB_face_graph_triangle_primitive and AABB_halfedge_graph_segment_primitive
|
||||
// to implement the Consruct_shared_data static function.
|
||||
template<class Graph, class Base, class ObjectPropertyMap, class PointPropertyMap, class HasSharedDataTag>
|
||||
struct Cstr_shared_data;
|
||||
|
||||
template<class Graph, class Base, class ObjectPropertyMap, class PointPropertyMap>
|
||||
struct Cstr_shared_data<Graph, Base, ObjectPropertyMap, PointPropertyMap, ::CGAL::Tag_true>
|
||||
{
|
||||
typedef typename Base::Shared_data Shared_data;
|
||||
static Shared_data construct_shared_data(Graph& graph)
|
||||
{
|
||||
return Base::construct_shared_data(ObjectPropertyMap(&graph), PointPropertyMap(&graph));
|
||||
}
|
||||
};
|
||||
|
||||
template<class Graph, class Base, class ObjectPropertyMap, class PointPropertyMap>
|
||||
struct Cstr_shared_data<Graph, Base, ObjectPropertyMap, PointPropertyMap, ::CGAL::Tag_false>
|
||||
{
|
||||
typedef void* Shared_data;
|
||||
static Shared_data construct_shared_data(Graph&)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
|
||||
} } //namespace CGAL
|
||||
|
||||
#endif //CGAL_INTERNAL_AABB_TREE_HAS_NESTED_TYPE_SHARED_DATA_H
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
||||
#include <CGAL/AABB_halfedge_graph_segment_primitive.h>
|
||||
#include <CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/internal/AABB_tree/Primitive_helper.h>
|
||||
|
||||
#include <boost/mem_fn.hpp>
|
||||
|
|
@ -216,9 +217,10 @@ struct Primitive_generator<SEGMENT, K, Polyhedron>
|
|||
{
|
||||
typedef CGAL::AABB_halfedge_graph_segment_primitive<Polyhedron> Primitive;
|
||||
|
||||
typedef typename Polyhedron::Edge_iterator iterator;
|
||||
iterator begin(Polyhedron& p) { return p.edges_begin(); }
|
||||
iterator end(Polyhedron& p) { return p.edges_end(); }
|
||||
typedef typename CGAL::halfedge_graph_traits<Polyhedron>
|
||||
::undirected_edge_iterator iterator;
|
||||
iterator begin(Polyhedron& p) { return CGAL::undirected_edges(p).first; }
|
||||
iterator end(Polyhedron& p) { return CGAL::undirected_edges(p).second; }
|
||||
};
|
||||
|
||||
template<class K, class Polyhedron>
|
||||
|
|
@ -259,7 +261,7 @@ void test(const char *filename,
|
|||
|
||||
// constructs AABB tree and internal search KD-tree with
|
||||
// the points of the polyhedron
|
||||
Tree tree(Pr_generator().begin(polyhedron),Pr_generator().end(polyhedron));
|
||||
Tree tree(Pr_generator().begin(polyhedron),Pr_generator().end(polyhedron), polyhedron);
|
||||
//tree.accelerate_distance_queries(polyhedron.points_begin(),polyhedron.points_end());
|
||||
|
||||
// call all tests
|
||||
|
|
@ -341,7 +343,7 @@ public:
|
|||
Polyhedron_primitive_iterator it = Pr_generator().begin(p);
|
||||
for ( ; it != Pr_generator().end(p) ; ++it )
|
||||
{
|
||||
if ( m_traits.do_intersect_object()(query, Pr(it) ) )
|
||||
if ( m_traits.do_intersect_object()(query, Pr(it,p) ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -357,7 +359,7 @@ public:
|
|||
Polyhedron_primitive_iterator it = Pr_generator().begin(p);
|
||||
for ( ; it != Pr_generator().end(p) ; ++it )
|
||||
{
|
||||
if ( m_traits.do_intersect_object()(query, Pr(it) ) )
|
||||
if ( m_traits.do_intersect_object()(query, Pr(it,p) ) )
|
||||
++result;
|
||||
}
|
||||
|
||||
|
|
@ -372,8 +374,8 @@ public:
|
|||
Polyhedron_primitive_iterator it = Pr_generator().begin(p);
|
||||
for ( ; it != Pr_generator().end(p) ; ++it )
|
||||
{
|
||||
if ( m_traits.do_intersect_object()(query, Pr(it) ) )
|
||||
*out++ = Pr(it).id();
|
||||
if ( m_traits.do_intersect_object()(query, Pr(it,p) ) )
|
||||
*out++ = Pr(it,p).id();
|
||||
}
|
||||
|
||||
return out;
|
||||
|
|
@ -389,10 +391,10 @@ public:
|
|||
{
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
Intersection_result
|
||||
intersection = Traits().intersection_object()(query, Pr(it));
|
||||
intersection = Traits().intersection_object()(query, Pr(it,p));
|
||||
#else
|
||||
boost::optional< typename Traits::template Intersection_and_primitive_id<Query>::Type >
|
||||
intersection = m_traits.intersection_object()(query, Pr(it));
|
||||
intersection = m_traits.intersection_object()(query, Pr(it,p));
|
||||
#endif
|
||||
if ( intersection )
|
||||
*out++ = *intersection;
|
||||
|
|
@ -409,11 +411,11 @@ public:
|
|||
assert ( it != Pr_generator().end(p) );
|
||||
|
||||
// Get a point on the primitive
|
||||
Point closest_point = CGAL::internal::Primitive_helper<Traits>::get_reference_point(Pr(it),m_traits);
|
||||
Point closest_point = CGAL::internal::Primitive_helper<Traits>::get_reference_point(Pr(it,p),m_traits);
|
||||
|
||||
for ( ; it != Pr_generator().end(p) ; ++it )
|
||||
{
|
||||
closest_point = m_traits.closest_point_object()(query, Pr(it), closest_point);
|
||||
closest_point = m_traits.closest_point_object()(query, Pr(it,p), closest_point);
|
||||
}
|
||||
|
||||
return closest_point;
|
||||
|
|
@ -427,12 +429,12 @@ public:
|
|||
assert ( it != Pr_generator().end(p) );
|
||||
|
||||
// Get a point on the primitive
|
||||
Pr closest_primitive = Pr(it);
|
||||
Pr closest_primitive = Pr(it,p);
|
||||
Point closest_point = CGAL::internal::Primitive_helper<Traits>::get_reference_point(closest_primitive,m_traits);
|
||||
|
||||
for ( ; it != Pr_generator().end(p) ; ++it )
|
||||
{
|
||||
Pr tmp_pr(it);
|
||||
Pr tmp_pr(it,p);
|
||||
Point tmp_pt = m_traits.closest_point_object()(query, tmp_pr, closest_point);
|
||||
if ( tmp_pt != closest_point )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ int test()
|
|||
typedef typename CGAL::AABB_traits<K,Primitive> Traits;
|
||||
typedef typename CGAL::AABB_tree<Traits> Tree;
|
||||
typedef typename Tree::Object_and_primitive_id Object_and_primitive_id;
|
||||
Tree tree(polyhedron.facets_begin(),polyhedron.facets_end());
|
||||
Tree tree(polyhedron.facets_begin(),polyhedron.facets_end(), polyhedron);
|
||||
|
||||
// segment intersection query
|
||||
Point p((FT)-0.25, (FT)0.251, (FT)0.255);
|
||||
|
|
|
|||
Loading…
Reference in New Issue