From 77c3301ab179224db837aba6393f3cd1e08acb61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 11 May 2012 13:16:01 +0000 Subject: [PATCH] document additional parameter pack blindly forwarded+update HalfedgeGraph primitive --- .../AABB_HalfedgeGraph_segment_primitive.tex | 13 ++++------ AABB_tree/doc_tex/AABB_tree_ref/AABB_tree.tex | 26 ++++++++++--------- .../AABB_HalfedgeGraph_edge_example.cpp | 7 +---- 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/AABB_tree/doc_tex/AABB_tree_ref/AABB_HalfedgeGraph_segment_primitive.tex b/AABB_tree/doc_tex/AABB_tree_ref/AABB_HalfedgeGraph_segment_primitive.tex index 16fadbfcdb9..83ada459cb2 100644 --- a/AABB_tree/doc_tex/AABB_tree_ref/AABB_HalfedgeGraph_segment_primitive.tex +++ b/AABB_tree/doc_tex/AABB_tree_ref/AABB_HalfedgeGraph_segment_primitive.tex @@ -28,14 +28,11 @@ the memory footprint. The default is \ccc{CGAL::Tag_false} (datum is not stored) \ccCreation \ccCreationVariable{p} -\ccConstructor{AABB_HalfedgeGraph_segment_primitive(Id id)} -{Constructs a primitive, the datum triangle is the one corresponding to \ccc{id}. -HalfedgeGraph used in boost graph free functions is the default constructed one. This constructor is tailored for a \ccc{HalfedgeGraph} -of type \ccc{CGAL::Polyhedron_3} class, where the \ccc{edge_descriptor} is a handle and the graph need not to be known to extract -the corresponding segment and reference point.} - -\ccConstructor{AABB_HalfedgeGraph_segment_primitive(std::pair graph_and_id)} -{Constructs a primitive, the graph and the id being given as a pair. The example below gives a way to call this constructor the insert-by-range method of the class \ccc{CGAL::AABB_tree}.} +\ccConstructor{ +template +AABB_HalfedgeGraph_segment_primitive(Iterator it,const HalfedgeGraph& graph)} +{Constructs a primitive. The \ccc{value_type} of \ccc{Iterator} must be \ccc{Id}. +The example below gives a way to call this constructor the insert-by-range method of the class \ccc{CGAL::AABB_tree}.} \ccSeeAlso diff --git a/AABB_tree/doc_tex/AABB_tree_ref/AABB_tree.tex b/AABB_tree/doc_tex/AABB_tree_ref/AABB_tree.tex index 287980c9305..aa1ad671e43 100644 --- a/AABB_tree/doc_tex/AABB_tree_ref/AABB_tree.tex +++ b/AABB_tree/doc_tex/AABB_tree_ref/AABB_tree.tex @@ -42,25 +42,27 @@ Class \ccRefName\ is a static data structure for efficient intersection and dist \ccCreationVariable{tree} \ccConstructor{AABB_tree();}{Constructs an empty tree.} -\ccConstructor{template < class InputIterator> +\ccConstructor{template < class InputIterator, class ... T> AABB_tree( InputIterator begin, - InputIterator beyond);}{Builds the AABB tree data structure. Type \ccc{InputIterator} can be any const iterator such that \ccc{Primitive} has a constructor taking a \ccc{InputIterator} as argument. The tree stays empty if the memory allocation is not successful.} + InputIterator beyond, + T ... t);}{Equivalent to constructing an empty tree and calling \ccc{insert(first,last,t...)}.} \ccOperations -\ccMethod{template < class InputIterator> +\ccMethod{template < class InputIterator, class ... T> void rebuild(InputIterator begin, - InputIterator beyond);}{Clears the current tree and rebuilds it from scratch. See constructor above for the parameters. } -\ccGlue + InputIterator beyond, + T ... t);}{Equivalent to calling \ccc{clear()} followed by \ccc{insert(first,last,t...)}.} + \ccMethod{void clear();}{Clears the AABB tree. } -\ccGlue -\ccMethod{template - void insert(InputIterator begin, InputIterator beyond);} - {Add a sequence of primitives to the set of primitive of the AABB - tree. Type \ccc{InputIterator} can be any const iterator such that \ccc{Primitive} - has a constructor taking an InputIterator as argument.} -\ccGlue + +\ccMethod{template + void insert(InputIterator begin, InputIterator beyond, T ... t);} + {Add a sequence of primitives to the set of primitives of the AABB + tree. Type \ccc{InputIterator} is any iterator and parameter pack \ccc{T} any types such that \ccc{Primitive} + has a constructor with the following signature: \ccc{Primitive(InputIterator, T...)}.} + \ccMethod{void insert(const Primitive p);} {Add a primitive to the set of primitives of the AABB tree.} diff --git a/AABB_tree/examples/AABB_tree/AABB_HalfedgeGraph_edge_example.cpp b/AABB_tree/examples/AABB_tree/AABB_HalfedgeGraph_edge_example.cpp index 5c25f1f3e48..49e3958f405 100644 --- a/AABB_tree/examples/AABB_tree/AABB_HalfedgeGraph_edge_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_HalfedgeGraph_edge_example.cpp @@ -29,12 +29,7 @@ void run(const HalfedgeGraph& graph){ // constructs the AABB tree and the internal search tree for // efficient distance queries. - Tree tree(boost::make_transform_iterator(boost::edges(graph).first, - boost::bind(&std::make_pair, - &graph, _1)), - boost::make_transform_iterator(boost::edges(graph).second, - boost::bind(&std::make_pair, - &graph, _1))); + Tree tree(boost::edges(graph).first,boost::edges(graph).second,graph); tree.accelerate_distance_queries(); // counts #intersections with a triangle query