| 44 |
|
* |
| 45 |
|
* Created by Charles F. Vardeman II on 11 Dec 2006. |
| 46 |
|
* @author Charles F. Vardeman II |
| 47 |
< |
* @version $Id: ConvexHull.cpp,v 1.3 2007-05-30 18:47:03 chuckv Exp $ |
| 47 |
> |
* @version $Id: ConvexHull.cpp,v 1.4 2007-05-30 19:51:07 chuckv Exp $ |
| 48 |
|
* |
| 49 |
|
*/ |
| 50 |
|
|
| 66 |
|
int curlong,totlong; |
| 67 |
|
|
| 68 |
|
int numpoints = pos.size(); |
| 69 |
< |
|
| 70 |
< |
coordT points[numpoints][dim_]; |
| 71 |
< |
|
| 69 |
> |
|
| 70 |
> |
coordT* points; |
| 71 |
> |
points = (coordT*) malloc(sizeof(coordT) * (numpoints*dim_)); |
| 72 |
> |
|
| 73 |
|
for (int i=0; i<numpoints; i++) { |
| 74 |
< |
points[i][0] = pos[i][0]; |
| 75 |
< |
points[i][1] = pos[i][1]; |
| 76 |
< |
points[i][2] = pos[i][2]; |
| 74 |
> |
points[dim_ * i] = pos[i][0]; |
| 75 |
> |
points[dim_ * i + 1] = pos[i][1]; |
| 76 |
> |
points[dim_ * i + 2] = pos[i][2]; |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
|
| 79 |
– |
|
| 80 |
|
qh_initflags (const_cast<char *>(options_.c_str())); |
| 81 |
< |
qh_init_B (points[0], numpoints, dim_, ismalloc); |
| 81 |
> |
qh_init_B (points, numpoints, dim_, ismalloc); |
| 82 |
|
qh_qhull(); |
| 83 |
|
qh_check_output(); |
| 84 |
|
|