1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#include <Domain.hpp>
#include <Union.hpp>
#include <Intersection.hpp>
#include <Difference.hpp>
#include <Not.hpp>
void Domain::__buildReferenceAssociation(const Object& o)
{
if (o.hasReference()) {
const TinyVector<3, real_t>& ref = o.reference();
if (__povToReference.find(ref) == __povToReference.end()) {
const size_t n = __povToReference.size() + 1;
__povToReference[ref] = n;
ffout(2) << "\t\t" << ref << " -> " << n << '\n';
}
}
const Shape& shape = (*o.shape());
switch(shape.type()) {
case Shape::union_: {
const Union& U = static_cast<const Union&>(shape);
for (Union::const_iterator i = U.begin();
i != U.end(); ++i) {
__buildReferenceAssociation(*(*i));
}
break;
}
case Shape::difference: {
const Difference& D = static_cast<const Difference&>(shape);
for (Difference::const_iterator i = D.begin();
i != D.end(); ++i) {
__buildReferenceAssociation(*(*i));
}
break;
}
case Shape::intersection: {
const Intersection& I = static_cast<const Intersection&>(shape);
for (Intersection::const_iterator i = I.begin();
i != I.end(); ++i) {
__buildReferenceAssociation(*(*i));
}
break;
}
case Shape::not_: {
const Object& notObject = *(static_cast<const Not&>(shape).object());
__buildReferenceAssociation(notObject);
break;
}
default: {
;
}
}
}
|