Tulip  4.7.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
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 
20 /**
21  *
22  * This file is part of Tulip (www.tulip-software.org)
23  *
24  * Authors: David Auber and the Tulip development Team
25  * from LaBRI, University of Bordeaux
26  *
27  * Tulip is free software; you can redistribute it and/or modify
28  * it under the terms of the GNU Lesser General Public License
29  * as published by the Free Software Foundation, either version 3
30  * of the License, or (at your option) any later version.
31  *
32  * Tulip is distributed in the hope that it will be useful,
33  * but WITHOUT ANY WARRANTY; without even the implied warranty of
34  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
35  * See the GNU General Public License for more details.
36  *
37  */
38 #ifndef TLP_GEO_CONVEX_HULL_H
39 #define TLP_GEO_CONVEX_HULL_H
40 #include <vector>
41 #include <tulip/Coord.h>
42 
43 namespace tlp {
44 
45 /**
46  * \brief function for computing a 2D convex hull
47  *
48  * Computes a 2D convex hull using the Qhull library (www.qhull.org)
49  *
50  * Computes the 2D convex hull and returns a list of indexes for the
51  * points on the convex hull in counterclockwise order.
52  *
53  * The convexHull vector is automatically cleared.
54  *
55  */
56 TLP_SCOPE void convexHull(const std::vector<Coord> &points,
57  std::vector<unsigned int> &convexHull);
58 
59 /**
60  * \brief function for computing a 2D/3D convex hull
61  *
62  * Computes a 2D/3D convex hull using the Qhull library (www.qhull.org)
63  *
64  * Computes a 2D/3D convex hull and returns a list of the hull facets (segments for 2D, triangles for 3D)
65  * and a list of neighbors facets for each facet. A facet is defined by a list of indexes in the points vector.
66  * The neighbors facets of a facet are defined by a list of indexes in the convexHullFacets vector
67  * (facetNeighbors[i] stores the neighbors of facet convexHullFacets[i]).
68  *
69  * The convexHullFacets and facetNeighbors vectors are automatically cleared.
70  */
71 TLP_SCOPE void convexHull(const std::vector<Coord> &points,
72  std::vector<std::vector<unsigned int> > &convexHullFacets,
73  std::vector<std::vector<unsigned int> > &facetNeighbors);
74 
75 /*@}*/
76 
77 }
78 #endif
void convexHull(const std::vector< Coord > &points, std::vector< unsigned int > &convexHull)
function for computing a 2D convex hull