Tulip  5.0.0
Large graphs analysis and drawing
ConvexHull.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
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,
38  std::vector<unsigned int> &convexHull);
39 
40 /**
41  * \brief function for computing a 2D/3D convex hull
42  *
43  * Computes a 2D/3D convex hull using the Qhull library (www.qhull.org)
44  *
45  * Computes a 2D/3D convex hull and returns a list of the hull facets (segments for 2D, triangles for 3D)
46  * and a list of neighbors facets for each facet. A facet is defined by a list of indexes in the points vector.
47  * The neighbors facets of a facet are defined by a list of indexes in the convexHullFacets vector
48  * (facetNeighbors[i] stores the neighbors of facet convexHullFacets[i]).
49  *
50  * The convexHullFacets and facetNeighbors vectors are automatically cleared.
51  */
52 TLP_SCOPE void convexHull(const std::vector<Coord> &points,
53  std::vector<std::vector<unsigned int> > &convexHullFacets,
54  std::vector<std::vector<unsigned int> > &facetNeighbors);
55 
56 /*@}*/
57 
58 }
59 #endif
void convexHull(const std::vector< Coord > &points, std::vector< unsigned int > &convexHull)
function for computing a 2D convex hull