Tulip  5.7.4
Large graphs analysis and drawing
ConvexHull.h
1 /*
2  *
3  * This file is part of Tulip (https://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 #ifndef TLP_GEO_CONVEX_HULL_H
20 #define TLP_GEO_CONVEX_HULL_H
21 #include <vector>
22 #include <tulip/Coord.h>
23 
24 namespace tlp {
25 
26 /**
27  * \brief function for computing a 2D convex hull
28  *
29  * Computes a 2D convex hull using the Qhull library (www.qhull.org)
30  *
31  * Computes the 2D convex hull and returns a list of indexes for the
32  * points on the convex hull in counterclockwise order.
33  *
34  * The convexHull vector is automatically cleared.
35  *
36  */
37 TLP_SCOPE void convexHull(const std::vector<Coord> &points, std::vector<unsigned int> &convexHull);
38 
39 /**
40  * \brief function for computing a 2D/3D convex hull
41  *
42  * Computes a 2D/3D convex hull using the Qhull library (www.qhull.org)
43  *
44  * Computes a 2D/3D convex hull and returns a list of the hull facets (segments for 2D, triangles
45  * for 3D)
46  * and a list of neighbors facets for each facet. A facet is defined by a list of indexes in the
47  * points vector.
48  * The neighbors facets of a facet are defined by a list of indexes in the convexHullFacets vector
49  * (facetNeighbors[i] stores the neighbors of facet convexHullFacets[i]).
50  *
51  * The convexHullFacets and facetNeighbors vectors are automatically cleared.
52  */
53 TLP_SCOPE void convexHull(const std::vector<Coord> &points,
54  std::vector<std::vector<unsigned int>> &convexHullFacets,
55  std::vector<std::vector<unsigned int>> &facetNeighbors);
56 
57 /*@}*/
58 } // namespace tlp
59 #endif
void convexHull(const std::vector< Coord > &points, std::vector< unsigned int > &convexHull)
function for computing a 2D convex hull