38 enum MocQueryOp { AND,OR,XOR,NOT,NONE };
40 class MocQueryComponent
47 MocQueryComponent(MocQueryOp op_)
50 planck_assert(op_!=NONE,
"bad operator");
66 MocQueryComponent(MocQueryOp op_,
int nops_)
74 planck_assert(nops>=2,
"bad nops");
77 planck_assert(nops==2,
"bad nops");
80 planck_assert(nops==1,
"bad nops");
83 planck_fail(
"bad operator");
87 MocQueryComponent(
const vec3 &cnt,
double rad)
88 : op (NONE), nops(0), center(cnt.Norm()), radius(rad) {}
91 template<
typename I> Moc<I> mocQuery (
int order,
92 const std::vector<MocQueryComponent> &comp);
94 template<
typename I> Moc<I> mocQueryInclusive (
int order,
int omax,
95 const std::vector<MocQueryComponent> &comp);
97 std::vector<MocQueryComponent> prepPolygon (
const std::vector<vec3> &vertex);
99 template<
typename I>
inline Moc<I> mocQuery (
int order,
100 const std::vector<vec3> &vertex)
101 {
return mocQuery<I>(order, prepPolygon(vertex)); }
103 template<
typename I>
inline Moc<I> mocQueryInclusive (
int order,
int omax,
104 const std::vector<vec3> &vertex)
105 {
return mocQueryInclusive<I>(order, omax, prepPolygon(vertex)); }