Skip to content

Commit 5e73552

Browse files
committed
Adapt documentation according to the review
1 parent 7b04675 commit 5e73552

File tree

5 files changed

+34
-26
lines changed

5 files changed

+34
-26
lines changed

Convex_hull_3/doc/Convex_hull_3/Convex_hull_3.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,12 @@ that is model of the concept `MutableFaceGraph`, e.g. `Polyhedron_3` and `Surfac
156156

157157
\section Convex_hull_3Do_intersect Intersection test of Convex Hulls
158158

159-
The `Convex_hull_3::do_intersect()` functions provide an implementation of the algorithm computing the intersection of two convex hulls by searching on the 2-sphere
160-
@todo Add \cgalCite{hornus2017convexintersection}.
159+
The `CGAL::Convex_hull_3::do_intersect()` functions provide an implementation of the algorithm computing the intersection of two convex hulls by searching on the 2-sphere \cgalCite{hornus2017convexintersection}.
161160
Input convex hulls can be provided in three forms: as range of points, as graph model of `AdjacencyGraph` or as instance of the `Convex_hull_hierarchy` class.
162161

163-
The algorithm accesses the convex hulls using the `extreme_point_3()` function, which returns the point on the hull that is furthest in a specified direction.
164-
The `Convex_hull_hierarchy` class is a data structure that represents a convex hull and is optimized for efficient `extreme_point_3()` queries,
165-
which in turn makes `do_intersect()` particularly fast when using this representation.
162+
The algorithm accesses the convex hulls using the `CGAL::extreme_point_3()` function, which returns the point on the hull that is furthest in a specified direction.
163+
The `Convex_hull_hierarchy` class is a data structure that represents a convex hull and is optimized for efficient `CGAL::extreme_point_3()` queries,
164+
which in turn makes `CGAL::Convex_hull_3::do_intersect()` particularly fast when using this representation.
166165

167166
The computational complexities of `extreme_point_3()` and consequently `do_intersect()` depend on the input type: \f$O(n)\f$ for a range of point,
168167
\f$O(\sqrt{n})\f$ on average for a graph and \f$O(\log{n})\f$ on average for a Convex_hull_hierarchy.

Convex_hull_3/examples/Convex_hull_3/do_intersect_ch3.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
1717
typedef K::Point_3 Point_3;
1818
typedef CGAL::Surface_mesh<Point_3> Mesh;
1919
typedef Mesh::Property_map<Mesh::Vertex_index, Point_3> PointMap;
20+
typedef CGAL::Convex_hull_hierarchy<Mesh> Convex_hull_hierarchy;
2021

2122
int main(int argc, char* argv[])
2223
{
@@ -52,12 +53,12 @@ int main(int argc, char* argv[])
5253
<< " extreme vertices in the input meshes.\n";
5354

5455
// Convex_hull_hierarchy is data structure for very fast intersection test of Convex_hull
55-
CGAL::Convex_hull_hierarchy<Mesh> hsm1(sm1);
56-
CGAL::Convex_hull_hierarchy<Mesh> hsm2(sm2);
56+
Convex_hull_hierarchy hsm1(sm1);
57+
Convex_hull_hierarchy hsm2(sm2);
5758
res = CGAL::Convex_hull_3::do_intersect(hsm1, hsm2);
5859
std::cout << "do convex hulls intersect? " << std::boolalpha << res << "\n";
5960

60-
// Separation distance provides the squared distance between the two objects if they do not intersect but it's slower
61+
// Separation distance provides the approximate squared distance between the two objects if they do not intersect but it's slower
6162
K::FT dist = CGAL::Convex_hull_3::separation_distance(hsm1, hsm2);
6263
std::cout << "Squared distance between convex hulls: " << dist << "\n";
6364

Convex_hull_3/include/CGAL/Convex_hull_3/distance.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,7 @@ struct Separation_distance_functor{
347347
/**
348348
* \ingroup PkgConvexHull3Predicates
349349
*
350-
* provides a lower bound on the squared distance between the convex hulls of the two point sets.
351-
* If the convex hulls do intersect, returns zero
350+
* computes a lower bound on the squared distance between the convex hulls of two point sets, returning zero when the hulls intersect.
352351
*
353352
* @tparam PointRange: is a model of `ConstRange`. The value type of its iterator is the key type of the named parameter `point_map`.
354353
* @tparam NamedParameters_1 a sequence of \ref bgl_namedparameters "Named Parameters"
@@ -381,6 +380,8 @@ struct Separation_distance_functor{
381380
* \cgalParamNEnd
382381
* \cgalNamedParamsEnd
383382
*
383+
* \note The point sets do not need to be in convex position.
384+
*
384385
*/
385386
template <class PointRange,
386387
class NamedParameters_1 = parameters::Default_named_parameters,
@@ -392,7 +393,7 @@ FT separation_distance(const PointRange& r1, const PointRange& r2,
392393
/**
393394
* \ingroup PkgConvexHull3Predicates
394395
*
395-
* provides a lower bound on the squared distance between the two convex graphs.
396+
* computes a lower bound on the squared distance between the two convex graphs, returning zero when their hulls intersect.
396397
*
397398
* @tparam AdjacencyGraph is a model of `AdjacencyGraph`.
398399
* @tparam NamedParameters_1 a sequence of \ref bgl_namedparameters "Named Parameters"
@@ -428,6 +429,8 @@ FT separation_distance(const PointRange& r1, const PointRange& r2,
428429
* \cgalParamNEnd
429430
* \cgalNamedParamsEnd
430431
*
432+
* \see `CGAL::Convex_hull_3::do_intersect`
433+
*
431434
*/
432435
template <class AdjacencyGraph,
433436
class NamedParameters_1 = parameters::Default_named_parameters,
@@ -439,9 +442,9 @@ FT separation_distance(const AdjacencyGraph& g1, const AdjacencyGraph& g2,
439442
/**
440443
* \ingroup PkgConvexHull3Predicates
441444
*
442-
* provides a lower bound on the squared distance between the two convex hulls.
445+
* computes a lower bound on the squared distance between the two convex hulls, returning zero when they intersect.
443446
*
444-
* @tparam PolygonMesh: is a model of `FaceGraph`, more details in `CGAL::Convex_hull_hierarchy`
447+
* @tparam ConvexHullHierarchy an instance of `CGAL::Convex_hull_hierarchy`
445448
* @tparam NamedParameters_1 a sequence of \ref bgl_namedparameters "Named Parameters"
446449
* @tparam NamedParameters_2 a sequence of \ref bgl_namedparameters "Named Parameters"
447450
*
@@ -473,11 +476,13 @@ FT separation_distance(const AdjacencyGraph& g1, const AdjacencyGraph& g2,
473476
* \cgalParamNEnd
474477
* \cgalNamedParamsEnd
475478
*
479+
* \see `CGAL::Convex_hull_3::do_intersect`
480+
*
476481
*/
477-
template <class PolygonMesh,
482+
template <class ConvexHullHierarchy,
478483
class NamedParameters_1 = parameters::Default_named_parameters,
479484
class NamedParameters_2 = parameters::Default_named_parameters>
480-
FT separation_distance(const Convex_hull_hierarchy<PolygonMesh>& ch1, const Convex_hull_hierarchy<PolygonMesh>& ch2,
485+
FT separation_distance(const ConvexHullHierarchy& ch1, const ConvexHullHierarchy& ch2,
481486
const NamedParameters_1& np1 = parameters::default_values(),
482487
const NamedParameters_2& np2 = parameters::default_values());
483488

Convex_hull_3/include/CGAL/Convex_hull_3/intersections.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Point_3 extreme_point_3(const PointRange& r, const Direction_3 &dir, const Named
274274
*
275275
* computes the furthest point of the convex hull along the direction.
276276
*
277-
* @tparam PolygonMesh: is a model of `MutableFaceGraph` For more details see in `CGAL::Convex_hull_hierarchy`
277+
* @tparam ConvexHullHierarchy an instance of `CGAL::Convex_hull_hierarchy`
278278
* @tparam Direction_3: is a model of CGAL::Direction_3.
279279
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
280280
*
@@ -302,8 +302,8 @@ Point_3 extreme_point_3(const PointRange& r, const Direction_3 &dir, const Named
302302
* \cgalNamedParamsEnd
303303
*
304304
*/
305-
template <class PolygonMesh, class Direction_3, class NamedParameters>
306-
Point_3 extreme_point_3(const Convex_hull_hierarchy<PolygonMesh> &ch, const Direction_3 &dir, const NamedParameters &np);
305+
template <class ConvexHullHierarchy, class Direction_3, class NamedParameters>
306+
Point_3 extreme_point_3(const ConvexHullHierarchy &ch, const Direction_3 &dir, const NamedParameters &np);
307307

308308
#else
309309

@@ -552,7 +552,7 @@ struct Do_intersect_traits<K, K, Converter, true> {
552552
/**
553553
* \ingroup PkgConvexHull3Predicates
554554
*
555-
* checks if the convex hulls of the two point sets intersect or not. The points in a set do not need to be in convex position.
555+
* checks if the convex hulls of the two point sets intersect or not.
556556
*
557557
* @tparam PointRange: is a model of `ConstRange`. The value type of its iterator is the key type of the named parameter `point_map`.
558558
* @tparam NamedParameters_1 a sequence of \ref bgl_namedparameters "Named Parameters"
@@ -585,6 +585,8 @@ struct Do_intersect_traits<K, K, Converter, true> {
585585
* \cgalParamNEnd
586586
* \cgalNamedParamsEnd
587587
*
588+
* * \note The point sets do not need to be in convex position.
589+
*
588590
*/
589591
template <class PointRange,
590592
class NamedParameters_1 = parameters::Default_named_parameters,
@@ -645,7 +647,7 @@ bool do_intersect(const AdjacencyGraph& g1, const AdjacencyGraph& g2,
645647
*
646648
* checks if the convex hulls intersect or not.
647649
*
648-
* @tparam PolygonMesh: is a model of `MutableFaceGraph`, more details in `CGAL::Convex_hull_hierarchy`
650+
* @tparam ConvexHullHierarchy an instance of `CGAL::Convex_hull_hierarchy`
649651
* @tparam NamedParameters_1 a sequence of \ref bgl_namedparameters "Named Parameters"
650652
* @tparam NamedParameters_2 a sequence of \ref bgl_namedparameters "Named Parameters"
651653
*
@@ -678,10 +680,10 @@ bool do_intersect(const AdjacencyGraph& g1, const AdjacencyGraph& g2,
678680
* \cgalNamedParamsEnd
679681
*
680682
*/
681-
template <class PolygonMesh,
683+
template <class ConvexHullHierarchy,
682684
class NamedParameters_1 = parameters::Default_named_parameters,
683685
class NamedParameters_2 = parameters::Default_named_parameters>
684-
bool do_intersect(const Convex_hull_hierarchy<PolygonMesh>& ch1, const Convex_hull_hierarchy<PolygonMesh>& ch2,
686+
bool do_intersect(const ConvexHullHierarchy& ch1, const ConvexHullHierarchy& ch2,
685687
const NamedParameters_1& np1 = parameters::default_values(),
686688
const NamedParameters_2& np2 = parameters::default_values());
687689

Convex_hull_3/include/CGAL/Convex_hull_hierarchy.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ struct Convex_hull_hierarchy{
8686
*
8787
* @tparam VertexListGraph: a model of `VertexListGraph`
8888
* @tparam NamedParameters: a sequence of named parameters
89-
* @tparam Traits: model of the concept ConvexHullTraits_3. For the purposes of checking the postcondition that the convex hull is valid, Traits must also be a model of the concept IsStronglyConvexTraits_3.
9089
*
9190
* @param g the graph
9291
* @param np an optional sequence of `Named Parameters` among the ones listed below
93-
* @param traits an instance of Traits
9492
*
9593
* \cgalNamedParamsBegin
9694
* \cgalParamNBegin{vertex_point_map}
@@ -163,13 +161,16 @@ struct Convex_hull_hierarchy{
163161
* construct the furthest point of the convex hull along the direction.
164162
*
165163
* @tparam `Direction_3` model of `Kernel::Direction_3`. The kernel does not require to be the same than the one using by the Mesh
164+
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
166165
*
167166
* @param dir the direction
167+
* @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
168168
*
169169
* \return Return a `Point_3` using the same kernel as the direction.
170170
*/
171-
template <class Direction_3, typename NamedParameters=parameters::Default_named_parameters>
172-
typename Kernel_traits<Direction_3>::Kernel::Point_3 extreme_point_3(const Direction_3 &dir, const NamedParameters & np=parameters::default_values) const {
171+
template <typename Direction_3,
172+
typename NamedParameters=parameters::Default_named_parameters>
173+
typename Kernel_traits<Direction_3>::Kernel::Point_3 extreme_point_3(const Direction_3 &dir, const NamedParameters &np=parameters::default_values) const {
173174
using CGAL::parameters::choose_parameter;
174175
using CGAL::parameters::get_parameter;
175176

0 commit comments

Comments
 (0)