28 #pragma warning(disable:4786) // identifier was truncated to '255' 42 typedef vector<unsigned int>
IndexBuf;
44 char qh_version[] =
"SOLID 2.0";
49 int curlong, totlong, exitcode;
56 coordT *array =
new coordT[
numVerts()*3];
57 coordT *
p = &array[0];
66 qh_init_A(stdin, stdout, stderr, 0, NULL);
67 if (exitcode = setjmp(qh errexit)) exit(exitcode);
68 sprintf(
options,
"qhull Qx i s Tcv C-0");
70 qh_init_B(&array[0],
numVerts(), 3, ismalloc);
77 setT *vertices = qh_facet3vertex(facet);
78 FOREACHvertex_(vertices) facetIndices.push_back(qh_pointid(vertex->point));
79 for (
int i = 0, j = facetIndices.size()-1;
80 i < facetIndices.size(); j = i++)
81 indexBuf[facetIndices[j]].push_back(facetIndices[i]);
82 facetIndices.erase(facetIndices.begin(), facetIndices.end());
91 while (
indexBuf[curr_vertex].size() == 0) ++curr_vertex;
97 qh_freeqhull(!qh_ALL);
98 qh_memfreeshort(&curlong, &totlong);
106 int last_vertex = -1;
110 int i = 0, n = curr_cobound.
size();
112 (curr_cobound[i] == last_vertex || (d =
dot((*
this)[curr_cobound[i]], v)) <= h))
125 Polytope(b, c, v), cobound(0), curr_vertex(0) {}
132 for (
int i = 1; i <
numVerts(); ++i) {
133 if ((d =
dot((*
this)[i], v)) > h) { c = i; h = d; }
static ssgLoaderOptionsEx options
Scalar dot(const Quaternion &q1, const Quaternion &q2)
Polyhedron(const VertexBase &b, int c, const unsigned int v[])
Point support(const Vector &) const
vector< unsigned int > IndexBuf