Files Classes Functions Hierarchy
#include <quickhull2D.h>
Public Member Functions | |
| quickhull2D (vector< PT > const &_pts) | |
| Compute the convex hull of the point pts. | |
Public Attributes | |
| vector< PT > const & | pts |
| Global points. | |
| vector< uint > | boundary |
| Points on the hull. | |
O(n^2) complexity in time (worst case).
Definition at line 21 of file quickhull2D.h.
| quickhull2D< PT, D >::quickhull2D | ( | vector< PT > const & | _pts | ) | [inline] |
Compute the convex hull of the point pts.
Definition at line 110 of file quickhull2D.h.
References quickhull2D< PT, D >::boundary, halfspaceContainer< HS, PT >::isInsideOrOnBoundary(), and quickhull2D< PT, D >::pts.
00111 : pts(pts_) 00112 { 00113 uintc n(pts.size()); 00114 if (n<3) 00115 return; 00116 00117 uint x0; 00118 uint x1; 00119 findMinMax(x0,x1); 00120 boundary.push_back(x0); 00121 boundary.push_back(x1); 00122 00123 assert(x0<n); 00124 assert(x1<n); 00125 00126 list<uint> index; 00127 for (uint i=0; i<n; ++i) 00128 { 00129 if (i==x0) 00130 continue; 00131 if (i==x1) 00132 continue; 00133 00134 index.push_back(i); 00135 } 00136 00137 HSC * h1 = 00138 new HSC( HS(pts[x0],pts[x1]) ,pts ); 00139 h1->isInsideOrOnBoundary(index); 00140 00141 HSC * h2 = 00142 new HSC( HS(pts[x1],pts[x0]), pts ); 00143 h2->isInsideOrOnBoundary(index); 00144 00145 cs.push_back(h1); 00146 cs.push_back(h2); 00147 00148 process(); 00149 }
| vector< uint > quickhull2D< PT, D >::boundary |
Points on the hull.
Definition at line 49 of file quickhull2D.h.
Referenced by quickhull2D< PT, D >::quickhull2D(), quickhull2Drandomized< PT, D >::quickhull2Drandomized(), and quickhull2Dtest::test05().
| vector<PT> const& quickhull2D< PT, D >::pts |
Global points.
Definition at line 46 of file quickhull2D.h.
Referenced by quickhull2D< PT, D >::quickhull2D().
1.5.8