From 31d6ebe9bf3fd009a21b338c5b4ee780ee9e2a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 9 May 2012 17:11:09 +0000 Subject: [PATCH] *add primitive types for HalfedgeGraph and FaceGraph (wip) *clean up triangle and segment primitive --- .gitattributes | 2 + .../AABB_tree/AABB_insertion_example.cpp | 7 +- .../AABB_polyhedron_edge_example.cpp | 7 +- ...AABB_polyhedron_facet_distance_example.cpp | 6 +- ..._polyhedron_facet_intersection_example.cpp | 6 +- .../CGAL/AABB_FaceGraph_triangle_primitive.h | 67 +++++++++ .../AABB_HalfedgeGraph_segment_primitive.h | 82 +++++++++++ .../CGAL/AABB_polyhedron_segment_primitive.h | 2 +- .../CGAL/AABB_polyhedron_triangle_primitive.h | 2 +- AABB_tree/include/CGAL/AABB_primitive.h | 26 ++-- .../include/CGAL/AABB_segment_primitive.h | 127 +++++------------- .../include/CGAL/AABB_triangle_primitive.h | 124 +++++------------ .../internal/AABB_tree/Primitive_caching.h | 7 +- AABB_tree/test/AABB_tree/AABB_test_util.h | 8 +- .../aabb_correctness_triangle_test.cpp | 4 +- .../AABB_tree/aabb_distance_edge_test.cpp | 1 - .../aabb_distance_triangle_hint_test.cpp | 1 - .../AABB_tree/aabb_distance_triangle_test.cpp | 1 - .../aabb_intersection_triangle_test.cpp | 1 - ...bb_naive_vs_tree_distance_segment_test.cpp | 1 - ...b_naive_vs_tree_distance_triangle_test.cpp | 1 - .../aabb_naive_vs_tree_triangle_test.cpp | 1 - 22 files changed, 249 insertions(+), 235 deletions(-) create mode 100644 AABB_tree/include/CGAL/AABB_FaceGraph_triangle_primitive.h create mode 100644 AABB_tree/include/CGAL/AABB_HalfedgeGraph_segment_primitive.h diff --git a/.gitattributes b/.gitattributes index 94f98e652e0..ab5ae9e5ffb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -35,6 +35,8 @@ AABB_tree/doc_tex/AABB_tree_ref/introduction.tex -text AABB_tree/doc_tex/AABB_tree_ref/main.tex -text AABB_tree/dont_submit -text AABB_tree/examples/AABB_tree/cleanup.bat -text +AABB_tree/include/CGAL/AABB_FaceGraph_triangle_primitive.h -text +AABB_tree/include/CGAL/AABB_HalfedgeGraph_segment_primitive.h -text AABB_tree/include/CGAL/AABB_intersections.h -text AABB_tree/include/CGAL/AABB_polyhedron_segment_primitive.h -text AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h -text diff --git a/AABB_tree/examples/AABB_tree/AABB_insertion_example.cpp b/AABB_tree/examples/AABB_tree/AABB_insertion_example.cpp index 95fff88bf73..40063df4bfc 100644 --- a/AABB_tree/examples/AABB_tree/AABB_insertion_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_insertion_example.cpp @@ -4,16 +4,15 @@ #include #include #include -#include -#include +#include + typedef CGAL::Simple_cartesian K; typedef K::FT FT; typedef K::Point_3 Point; typedef K::Segment_3 Segment; typedef CGAL::Polyhedron_3 Polyhedron; -typedef CGAL::Triangle_from_facet_property_map Triangle_property_map; -typedef CGAL::AABB_triangle_primitive Primitive; +typedef CGAL::AABB_FaceGraph_triangle_primitive Primitive; typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree; typedef Tree::Object_and_primitive_id Object_and_primitive_id; diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp index 3e93137858f..794b8f0e9d6 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp @@ -6,16 +6,15 @@ #include #include #include -#include -#include +#include + typedef CGAL::Simple_cartesian K; typedef K::FT FT; typedef K::Point_3 Point; typedef K::Triangle_3 Triangle; typedef CGAL::Polyhedron_3 Polyhedron; -typedef CGAL::Segment_from_halfedge_property_map Segment_property_map; -typedef CGAL::AABB_segment_primitive Primitive; +typedef CGAL::AABB_HalfedgeGraph_segment_primitive Primitive; typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree; diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp index d2ee0906e48..4b4b8da2366 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp @@ -7,16 +7,14 @@ #include #include #include -#include -#include +#include typedef CGAL::Simple_cartesian K; typedef K::FT FT; typedef K::Point_3 Point; typedef K::Segment_3 Segment; typedef CGAL::Polyhedron_3 Polyhedron; -typedef CGAL::Triangle_from_facet_property_map Triangle_property_map; -typedef CGAL::AABB_triangle_primitive Primitive; +typedef CGAL::AABB_FaceGraph_triangle_primitive Primitive; typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree; typedef Tree::Object_and_primitive_id Object_and_primitive_id; diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp index 99b34a658dd..44730a86542 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp @@ -5,8 +5,7 @@ #include #include #include -#include -#include +#include #include typedef CGAL::Simple_cartesian K; @@ -15,8 +14,7 @@ typedef K::Plane_3 Plane; typedef K::Vector_3 Vector; typedef K::Segment_3 Segment; typedef CGAL::Polyhedron_3 Polyhedron; -typedef CGAL::Triangle_from_facet_property_map Triangle_property_map; -typedef CGAL::AABB_triangle_primitive Primitive; +typedef CGAL::AABB_FaceGraph_triangle_primitive Primitive; typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree; typedef Tree::Object_and_primitive_id Object_and_primitive_id; diff --git a/AABB_tree/include/CGAL/AABB_FaceGraph_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_FaceGraph_triangle_primitive.h new file mode 100644 index 00000000000..753fc2ea93e --- /dev/null +++ b/AABB_tree/include/CGAL/AABB_FaceGraph_triangle_primitive.h @@ -0,0 +1,67 @@ +// Copyright (c) 2012 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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 68959 2012-05-04 12:24:50Z sloriot $ +// +// +// Author(s) : Sebastien Loriot +// +//****************************************************************************** +// File Description : +// +//****************************************************************************** + +#ifndef CGAL_AABB_FACEGRAPH_TRIANGLE_PRIMITIVE_H +#define CGAL_AABB_FACEGRAPH_TRIANGLE_PRIMITIVE_H + +#include +#include +#include + +namespace CGAL { + + +template < class FaceGraph, + class cache_primitive=Tag_false, + class Id_=typename FaceGraph::Face_handle //this one should be autodetected using face_descriptor + > + +class AABB_FaceGraph_triangle_primitive : public AABB_primitive< Id_, + Triangle_from_facet_property_map, + One_point_from_facet_property_map, + cache_primitive > +{ + typedef Triangle_from_facet_property_map Triangle_property_map; + typedef One_point_from_facet_property_map Point_property_map; + + typedef AABB_primitive< Id_, + Triangle_property_map, + Point_property_map, + cache_primitive > Base; + +public: + // constructors + AABB_FaceGraph_triangle_primitive(Id_ it) : Base(it){} + template + AABB_FaceGraph_triangle_primitive(Iterator it) : Base( it->second, + Triangle_property_map((it->first)), + Point_property_map((it->first)) ){} +}; + +} // end namespace CGAL + + +#endif // CGAL_AABB_FACEGRAPH_TRIANGLE_PRIMITIVE_H + diff --git a/AABB_tree/include/CGAL/AABB_HalfedgeGraph_segment_primitive.h b/AABB_tree/include/CGAL/AABB_HalfedgeGraph_segment_primitive.h new file mode 100644 index 00000000000..8809ef16d9b --- /dev/null +++ b/AABB_tree/include/CGAL/AABB_HalfedgeGraph_segment_primitive.h @@ -0,0 +1,82 @@ +// Copyright (c) 2012 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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 68959 2012-05-04 12:24:50Z sloriot $ +// +// +// Author(s) : Sebastien Loriot +// +//****************************************************************************** +// File Description : +// +//****************************************************************************** + +#ifndef CGAL_AABB_HALFEDGEGRAPH_TRIANGLE_PRIMITIVE_H +#define CGAL_AABB_HALFEDGEGRAPH_TRIANGLE_PRIMITIVE_H + +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace CGAL { + + +template < class HalfedgeGraph, + class cache_primitive=Tag_false, + class Id_=typename HalfedgeGraph::Halfedge_handle //this one should be autodetected using edge_descriptor + > +class AABB_HalfedgeGraph_segment_primitive : public AABB_primitive< Id_, + Segment_from_halfedge_property_map, + One_point_from_halfedge_property_map, + cache_primitive > +{ + typedef Segment_from_halfedge_property_map Triangle_property_map; + typedef One_point_from_halfedge_property_map Point_property_map; + + typedef AABB_primitive< Id_, + Triangle_property_map, + Point_property_map, + cache_primitive > Base; + +public: + // constructors + AABB_HalfedgeGraph_segment_primitive(Id_ it) : Base(it){} + template + AABB_HalfedgeGraph_segment_primitive(Iterator it, + typename boost::enable_if< + boost::mpl::and_< + boost::integral_constant::value >, + boost::is_convertible< + typename std::iterator_traits::value_type, + std::pair + > + > + >::type* = NULL ) + : Base( it->second, + Triangle_property_map((it->first)), + Point_property_map((it->first)) ){} +}; + +} // end namespace CGAL + + +#endif // CGAL_AABB_HALFEDGEGRAPH_TRIANGLE_PRIMITIVE_H + diff --git a/AABB_tree/include/CGAL/AABB_polyhedron_segment_primitive.h b/AABB_tree/include/CGAL/AABB_polyhedron_segment_primitive.h index ec5e60f9c03..67b5c31ecf1 100644 --- a/AABB_tree/include/CGAL/AABB_polyhedron_segment_primitive.h +++ b/AABB_tree/include/CGAL/AABB_polyhedron_segment_primitive.h @@ -27,7 +27,7 @@ #define CGAL_AABB_POLYHEDRON_SEGMENT_PRIMITIVE_H_ #define CGAL_DEPRECATED_HEADER "" -#define CGAL_REPLACEMENT_HEADER " and " +#define CGAL_REPLACEMENT_HEADER "" #include namespace CGAL { diff --git a/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h index 06f703b1788..20f0e94a861 100644 --- a/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h @@ -27,7 +27,7 @@ #define CGAL_AABB_POLYHEDRON_TRIANGLE_PRIMITIVE_H_ #define CGAL_DEPRECATED_HEADER "" -#define CGAL_REPLACEMENT_HEADER " and " +#define CGAL_REPLACEMENT_HEADER "" #include diff --git a/AABB_tree/include/CGAL/AABB_primitive.h b/AABB_tree/include/CGAL/AABB_primitive.h index 6ea0de26236..150fc9af897 100644 --- a/AABB_tree/include/CGAL/AABB_primitive.h +++ b/AABB_tree/include/CGAL/AABB_primitive.h @@ -23,38 +23,32 @@ // //****************************************************************************** -#ifndef CGAL_AABB_TRIANGLE_PRIMITIVE_H_ -#define CGAL_AABB_TRIANGLE_PRIMITIVE_H_ +#ifndef CGAL_AABB_PRIMITIVE_H +#define CGAL_AABB_PRIMITIVE_H #include -#include -#include -#include -#include -#include -#include -#include namespace CGAL { -template < class Iterator, +template < class Id_, class ObjectPropertyMap, class PointPropertyMap, - bool cache_primitive=false > + class cache_primitive=Tag_false > class AABB_primitive : - public internal::Primitive_caching< Iterator, TrianglePropertyMap, cache_primitive > + public internal::Primitive_caching< Id_, ObjectPropertyMap, cache_primitive > { // types - typedef internal::Primitive_caching Primitive_base; + typedef internal::Primitive_caching Primitive_base; public: typedef typename boost::property_traits< ObjectPropertyMap >::value_type Datum; //datum type typedef typename boost::property_traits< PointPropertyMap >::value_type Point; //point type - typedef Iterator Id; // Id type + typedef Id_ Id; // Id type private: + PointPropertyMap m_ppmap; Id m_it; - PointPropertyMap m_ppmap + public: // constructors AABB_primitive() {} @@ -81,5 +75,5 @@ public: } // end namespace CGAL -#endif // CGAL_AABB_TRIANGLE_PRIMITIVE_H_ +#endif // CGAL_AABB_PRIMITIVE_H diff --git a/AABB_tree/include/CGAL/AABB_segment_primitive.h b/AABB_tree/include/CGAL/AABB_segment_primitive.h index f840d663f1d..0525bc481e9 100644 --- a/AABB_tree/include/CGAL/AABB_segment_primitive.h +++ b/AABB_tree/include/CGAL/AABB_segment_primitive.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009, 2011 INRIA Sophia-Antipolis (France). +// Copyright (c) 2012 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -16,7 +16,7 @@ // $Id$ // // -// Author(s) : Pierre Alliez, Stephane Tayeb, Sebastien Loriot +// Author(s) : Sebastien Loriot // //****************************************************************************** // File Description : @@ -26,110 +26,51 @@ #ifndef CGAL_AABB_SEGMENT_PRIMITIVE_H_ #define CGAL_AABB_SEGMENT_PRIMITIVE_H_ -#include -#include -#include -#include -#include -#include -#include -#include +#include namespace CGAL { -namespace internal{ - - //use the property_map to access the point - template < class GeomTraits, - class Iterator, - class SegmentPropertyMap, - class PointPropertyMap, - bool cache_primitive > - class Segment_point_accessor{ - Segment_point_accessor(PointPropertyMap pmap):m_Point_pmap(pmap){} - - typedef typename PointPropertyMap::reference result_type; - - template - result_type get_point(Iterator m_it,const PrimitiveCaching&) const - { - return get(m_Point_pmap,m_it); - } - private: - PointPropertyMap m_Point_pmap; +namespace internal { + template + struct First_point_of_segment_3_property_map{ + //classical typedefs + typedef const typename GeomTraits::Segment_3& key_type; + typedef typename GeomTraits::Point_3 value_type; + typedef const typename GeomTraits::Point_3& reference; + typedef boost::readable_property_map_tag category; }; - //use Datum to access the point - template < class GeomTraits, - class Iterator, - class SegmentPropertyMap, - bool cache_primitive > - struct Segment_point_accessor{ - Segment_point_accessor( ::CGAL::Default ){} - - typedef Primitive_caching Prim_caching; - typedef typename boost::mpl::if_< - boost::is_const, - typename boost::add_const::type, - typename GeomTraits::Point_3 - >::type const_type; - - typedef typename boost::mpl::if_< - boost::is_reference, - typename boost::add_reference::type, - const_type - >::type result_type; + //get function for property map + template + inline + const typename GeomTraits::Point_3& + get(First_point_of_segment_3_property_map, + const typename GeomTraits::Segment_3& s) + { + return s.source(); + } +}//namespace internal + - result_type get_point(Iterator m_it, - const Prim_caching& pcaching) const - { - return pcaching.get_primitive(m_it).source(); - } - }; -} - template , - class PointPropertyMap=Default, - bool cache_primitive=false> -class AABB_segment_primitive : - public internal::Primitive_caching, - public internal::Segment_point_accessor + class cache_primitive=Tag_false> +class AABB_segment_primitive : public AABB_primitive< Iterator, + boost::typed_identity_property_map, + internal::First_point_of_segment_3_property_map, + cache_primitive > { - // types - typedef internal::Primitive_caching Primitive_base; - typedef internal::Segment_point_accessor Point_accessor_base; + typedef AABB_primitive< Iterator, + boost::typed_identity_property_map, + internal::First_point_of_segment_3_property_map, + cache_primitive > Base; public: - typedef typename GeomTraits::Point_3 Point; // point type - typedef typename GeomTraits::Segment_3 Datum; // datum type - typedef Iterator Id; // Id type - - // member data -private: - Id m_it; -public: - // constructors - AABB_segment_primitive() {} - AABB_segment_primitive(Id it,SegmentPropertyMap s_pmap=SegmentPropertyMap(),PointPropertyMap p_pmap=PointPropertyMap()) - : Point_accessor_base(p_pmap), m_it(it) - { - this->set_primitive(it,s_pmap); - } -public: - Id& id() { return m_it; } - const Id& id() const { return m_it; } - typename Primitive_base::result_type datum() const { - return this->get_primitive(m_it); - } - - /// Returns a point on the primitive - typename Point_accessor_base::result_type reference_point() const { - return this->get_point(m_it,*this); - } + // constructors + AABB_segment_primitive(Iterator it) : Base(it){} }; } // end namespace CGAL + #endif // CGAL_AABB_SEGMENT_PRIMITIVE_H_ diff --git a/AABB_tree/include/CGAL/AABB_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_triangle_primitive.h index 3694155ae1e..253f8ae9651 100644 --- a/AABB_tree/include/CGAL/AABB_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_triangle_primitive.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009, 2011 INRIA Sophia-Antipolis (France). +// Copyright (c) 2012 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -16,7 +16,7 @@ // $Id$ // // -// Author(s) : Pierre Alliez, Stephane Tayeb, Sebastien Loriot +// Author(s) : Sebastien Loriot // //****************************************************************************** // File Description : @@ -26,107 +26,47 @@ #ifndef CGAL_AABB_TRIANGLE_PRIMITIVE_H_ #define CGAL_AABB_TRIANGLE_PRIMITIVE_H_ -#include -#include -#include -#include -#include -#include -#include -#include +#include namespace CGAL { -namespace internal{ - - //use the property_map to access the point - template < class GeomTraits, - class Iterator, - class TrianglePropertyMap, - class PointPropertyMap, - bool cache_primitive > - class Triangle_point_accessor{ - Triangle_point_accessor(PointPropertyMap pmap):m_Point_pmap(pmap){} - - typedef typename PointPropertyMap::reference result_type; - - template - result_type get_point(Iterator m_it,const PrimitiveCaching&) const - { - return get(m_Point_pmap,m_it); - } - private: - PointPropertyMap m_Point_pmap; +namespace internal { + template + struct First_point_of_triangle_3_property_map{ + //classical typedefs + typedef const typename GeomTraits::Triangle_3& key_type; + typedef typename GeomTraits::Point_3 value_type; + typedef const typename GeomTraits::Point_3& reference; + typedef boost::readable_property_map_tag category; }; - //use Datum to access the point - template < class GeomTraits, - class Iterator, - class TrianglePropertyMap, - bool cache_primitive > - struct Triangle_point_accessor{ - Triangle_point_accessor( ::CGAL::Default ){} - - typedef Primitive_caching Prim_caching; - typedef typename boost::mpl::if_< - boost::is_const, - typename boost::add_const::type, - typename GeomTraits::Point_3 - >::type const_type; - - typedef typename boost::mpl::if_< - boost::is_reference, - typename boost::add_reference::type, - const_type - >::type result_type; + //get function for property map + template + inline + const typename GeomTraits::Point_3& + get(First_point_of_triangle_3_property_map, + const typename GeomTraits::Triangle_3& t) + { + return t.vertex(0); + } +}//namespace internal - result_type get_point(Iterator m_it, - const Prim_caching& pcaching) const - { - return pcaching.get_primitive(m_it).vertex(0); - } - }; -} template , - class PointPropertyMap=CGAL::Default, - bool cache_primitive=false> -class AABB_triangle_primitive : - public internal::Primitive_caching, - public internal::Triangle_point_accessor + class cache_primitive=Tag_false> +class AABB_triangle_primitive : public AABB_primitive< Iterator, + boost::typed_identity_property_map, + internal::First_point_of_triangle_3_property_map, + cache_primitive > { - // types - typedef internal::Primitive_caching Primitive_base; - typedef internal::Triangle_point_accessor Point_accessor_base; + typedef AABB_primitive< Iterator, + boost::typed_identity_property_map, + internal::First_point_of_triangle_3_property_map, + cache_primitive > Base; public: - typedef typename GeomTraits::Point_3 Point; // point type - typedef typename GeomTraits::Triangle_3 Datum; // datum type - typedef Iterator Id; // Id type - - // member data -private: - Id m_it; -public: - // constructors - AABB_triangle_primitive() {} - AABB_triangle_primitive(Id it,TrianglePropertyMap t_pmap=TrianglePropertyMap(), PointPropertyMap p_pmap=PointPropertyMap()) - : Point_accessor_base(p_pmap), m_it(it) - { - this->set_primitive(it,t_pmap); - } -public: - Id& id() { return m_it; } - const Id& id() const { return m_it; } - typename Primitive_base::result_type datum() const { - return this->get_primitive(m_it); - } - - /// Returns a point on the primitive - typename Point_accessor_base::result_type reference_point() const { - return this->get_point(m_it,*this); - } + // constructors + AABB_triangle_primitive(Iterator it) : Base(it){} }; } // end namespace CGAL diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/Primitive_caching.h b/AABB_tree/include/CGAL/internal/AABB_tree/Primitive_caching.h index 5e98ff9db8a..df0c796ca62 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/Primitive_caching.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/Primitive_caching.h @@ -24,6 +24,7 @@ //****************************************************************************** #include +#include #ifndef CGAL_INTERNAL_AABB_TREE_PRIMITIVE_CACHING_H #define CGAL_INTERNAL_AABB_TREE_PRIMITIVE_CACHING_H @@ -31,11 +32,11 @@ namespace CGAL { namespace internal{ - template + template struct Primitive_caching; template - struct Primitive_caching + struct Primitive_caching { typedef typename boost::property_traits< PropertyMap >::value_type Primitive; @@ -49,7 +50,7 @@ namespace internal{ }; template - struct Primitive_caching + struct Primitive_caching { typedef typename boost::property_traits< PropertyMap >::reference result_type; PropertyMap pmap_; diff --git a/AABB_tree/test/AABB_tree/AABB_test_util.h b/AABB_tree/test/AABB_tree/AABB_test_util.h index d14f73ae499..49ad1545c05 100644 --- a/AABB_tree/test/AABB_tree/AABB_test_util.h +++ b/AABB_tree/test/AABB_tree/AABB_test_util.h @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include double random_in(const double a, @@ -199,7 +199,7 @@ struct Primitive_generator {}; template struct Primitive_generator { - typedef CGAL::AABB_polyhedron_segment_primitive Primitive; + typedef CGAL::AABB_HalfedgeGraph_segment_primitive Primitive; typedef typename Polyhedron::Edge_iterator iterator; iterator begin(Polyhedron& p) { return p.edges_begin(); } @@ -209,7 +209,7 @@ struct Primitive_generator template struct Primitive_generator { - typedef CGAL::AABB_polyhedron_triangle_primitive Primitive; + typedef CGAL::AABB_FaceGraph_triangle_primitive Primitive; typedef typename Polyhedron::Facet_iterator iterator; iterator begin(Polyhedron& p) { return p.facets_begin(); } diff --git a/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp b/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp index 3d196c4ec2a..8f8e32d7192 100644 --- a/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_correctness_triangle_test.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include template int test() @@ -55,7 +55,7 @@ int test() ifs >> polyhedron; // construct tree from facets - typedef typename CGAL::AABB_polyhedron_triangle_primitive Primitive; + typedef typename CGAL::AABB_FaceGraph_triangle_primitive Primitive; typedef typename CGAL::AABB_traits Traits; typedef typename CGAL::AABB_tree Tree; typedef typename Tree::Object_and_primitive_id Object_and_primitive_id; diff --git a/AABB_tree/test/AABB_tree/aabb_distance_edge_test.cpp b/AABB_tree/test/AABB_tree/aabb_distance_edge_test.cpp index fa6bd21f34a..71d8a250c2c 100644 --- a/AABB_tree/test/AABB_tree/aabb_distance_edge_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_distance_edge_test.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include "AABB_test_util.h" diff --git a/AABB_tree/test/AABB_tree/aabb_distance_triangle_hint_test.cpp b/AABB_tree/test/AABB_tree/aabb_distance_triangle_hint_test.cpp index 001b66c0d3f..599190dc9d1 100644 --- a/AABB_tree/test/AABB_tree/aabb_distance_triangle_hint_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_distance_triangle_hint_test.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include diff --git a/AABB_tree/test/AABB_tree/aabb_distance_triangle_test.cpp b/AABB_tree/test/AABB_tree/aabb_distance_triangle_test.cpp index 0274785b5f3..5797ca1c01c 100644 --- a/AABB_tree/test/AABB_tree/aabb_distance_triangle_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_distance_triangle_test.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include "AABB_test_util.h" diff --git a/AABB_tree/test/AABB_tree/aabb_intersection_triangle_test.cpp b/AABB_tree/test/AABB_tree/aabb_intersection_triangle_test.cpp index c7c5c1641bd..ce810af887f 100644 --- a/AABB_tree/test/AABB_tree/aabb_intersection_triangle_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_intersection_triangle_test.cpp @@ -37,7 +37,6 @@ #include #include -#include #include "AABB_test_util.h" diff --git a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_segment_test.cpp b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_segment_test.cpp index 2f773ebe583..c2d23a1ce58 100644 --- a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_segment_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_segment_test.cpp @@ -37,7 +37,6 @@ #include #include -#include #include "AABB_test_util.h" diff --git a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_triangle_test.cpp b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_triangle_test.cpp index 4b660c41732..0f5e51a343b 100644 --- a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_triangle_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_triangle_test.cpp @@ -37,7 +37,6 @@ #include #include -#include #include "AABB_test_util.h" diff --git a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_triangle_test.cpp b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_triangle_test.cpp index 0b36550ac38..e7ec3a0a340 100644 --- a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_triangle_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_triangle_test.cpp @@ -36,7 +36,6 @@ #include #include -#include #include "AABB_test_util.h"