summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2011-08-12 23:48:59 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2011-08-12 23:48:59 (GMT)
commitec85e65ee983258db44770f246537562a16d141b (patch)
tree9d7f4e278a0402fa7271a6089ef375703e4ef5d4
parentbe63c6eeacf7ed4604106dc0859602ba98847a4f (diff)
fix build errors on windows
-rw-r--r--src/CGALEvaluator.cc38
-rw-r--r--src/CGALEvaluator.h2
-rw-r--r--src/CSGTermEvaluator.cc20
-rw-r--r--src/CSGTermEvaluator.h2
-rw-r--r--src/func.cc1
5 files changed, 32 insertions, 31 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc
index c251343..22583a7 100644
--- a/src/CGALEvaluator.cc
+++ b/src/CGALEvaluator.cc
@@ -40,7 +40,7 @@ bool CGALEvaluator::isCached(const AbstractNode &node) const
Modifies target by applying op to target and src:
target = target [op] src
*/
-void CGALEvaluator::process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedron &src, CsgOp op)
+void CGALEvaluator::process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedron &src, CGALEvaluator::CsgOp op)
{
if (target.dim != 2 && target.dim != 3) {
assert(false && "Dimension of Nef polyhedron must be 2 or 3");
@@ -48,19 +48,19 @@ void CGALEvaluator::process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedr
if (target.dim == 2) {
switch (op) {
- case UNION:
+ case CGE_UNION:
target.p2 += src.p2;
break;
- case INTERSECTION:
+ case CGE_INTERSECTION:
target.p2 *= src.p2;
break;
- case DIFFERENCE:
+ case CGE_DIFFERENCE:
target.p2 -= src.p2;
break;
- case MINKOWSKI:
+ case CGE_MINKOWSKI:
target.p2 = minkowski2(target.p2, src.p2);
break;
- case HULL:
+ case CGE_HULL:
//FIXME: Port convex hull to a binary operator or process it all in the end somehow
// target.p2 = convexhull2(target.p2, src.p2);
// target.p2 = convexhull2(polys);
@@ -69,19 +69,19 @@ void CGALEvaluator::process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedr
}
else if (target.dim == 3) {
switch (op) {
- case UNION:
+ case CGE_UNION:
target.p3 += src.p3;
break;
- case INTERSECTION:
+ case CGE_INTERSECTION:
target.p3 *= src.p3;
break;
- case DIFFERENCE:
+ case CGE_DIFFERENCE:
target.p3 -= src.p3;
break;
- case MINKOWSKI:
+ case CGE_MINKOWSKI:
target.p3 = minkowski3(target.p3, src.p3);
break;
- case HULL:
+ case CGE_HULL:
// FIXME: Print warning: hull() not supported in 3D
break;
}
@@ -130,7 +130,7 @@ Response CGALEvaluator::visit(State &state, const AbstractNode &node)
{
if (state.isPrefix() && isCached(node)) return PruneTraversal;
if (state.isPostfix()) {
- if (!isCached(node)) applyToChildren(node, UNION);
+ if (!isCached(node)) applyToChildren(node, CGE_UNION);
addToParent(state, node);
}
return ContinueTraversal;
@@ -140,7 +140,7 @@ Response CGALEvaluator::visit(State &state, const AbstractIntersectionNode &node
{
if (state.isPrefix() && isCached(node)) return PruneTraversal;
if (state.isPostfix()) {
- if (!isCached(node)) applyToChildren(node, INTERSECTION);
+ if (!isCached(node)) applyToChildren(node, CGE_INTERSECTION);
addToParent(state, node);
}
return ContinueTraversal;
@@ -151,16 +151,16 @@ Response CGALEvaluator::visit(State &state, const CsgNode &node)
if (state.isPrefix() && isCached(node)) return PruneTraversal;
if (state.isPostfix()) {
if (!isCached(node)) {
- CsgOp op;
+ CGALEvaluator::CsgOp op;
switch (node.type) {
case CSG_TYPE_UNION:
- op = UNION;
+ op = CGE_UNION;
break;
case CSG_TYPE_DIFFERENCE:
- op = DIFFERENCE;
+ op = CGE_DIFFERENCE;
break;
case CSG_TYPE_INTERSECTION:
- op = INTERSECTION;
+ op = CGE_INTERSECTION;
break;
}
applyToChildren(node, op);
@@ -176,7 +176,7 @@ Response CGALEvaluator::visit(State &state, const TransformNode &node)
if (state.isPostfix()) {
if (!isCached(node)) {
// First union all children
- applyToChildren(node, UNION);
+ applyToChildren(node, CGE_UNION);
// Then apply transform
CGAL_Nef_polyhedron N = this->cache[this->tree.getString(node)];
@@ -235,7 +235,7 @@ Response CGALEvaluator::visit(State &state, const AbstractPolyNode &node)
if (state.isPostfix()) {
if (!isCached(node)) {
// First union all children
- applyToChildren(node, UNION);
+ applyToChildren(node, CGE_UNION);
// Then apply polyset operation
PolySet *ps = node.evaluate_polyset(AbstractPolyNode::RENDER_CGAL, &this->psevaluator);
diff --git a/src/CGALEvaluator.h b/src/CGALEvaluator.h
index 282d6ab..9a1c88c 100644
--- a/src/CGALEvaluator.h
+++ b/src/CGALEvaluator.h
@@ -22,7 +22,7 @@ using std::pair;
class CGALEvaluator : public Visitor
{
public:
- enum CsgOp {UNION, INTERSECTION, DIFFERENCE, MINKOWSKI, HULL};
+ enum CsgOp {CGE_UNION, CGE_INTERSECTION, CGE_DIFFERENCE, CGE_MINKOWSKI, CGE_HULL};
// FIXME: If a cache is not given, we need to fix this ourselves
CGALEvaluator(QHash<string, CGAL_Nef_polyhedron> &cache, const Tree &tree) : cache(cache), tree(tree), psevaluator(*this) {}
virtual ~CGALEvaluator() {}
diff --git a/src/CSGTermEvaluator.cc b/src/CSGTermEvaluator.cc
index 769c87f..451929c 100644
--- a/src/CSGTermEvaluator.cc
+++ b/src/CSGTermEvaluator.cc
@@ -45,11 +45,11 @@ void CSGTermEvaluator::applyToChildren(const AbstractNode &node, CSGTermEvaluato
if (t2 && !t1) {
t1 = t2;
} else if (t2 && t1) {
- if (op == UNION) {
+ if (op == CSGT_UNION) {
t1 = new CSGTerm(CSGTerm::TYPE_UNION, t1, t2);
- } else if (op == DIFFERENCE) {
+ } else if (op == CSGT_DIFFERENCE) {
t1 = new CSGTerm(CSGTerm::TYPE_DIFFERENCE, t1, t2);
- } else if (op == INTERSECTION) {
+ } else if (op == CSGT_INTERSECTION) {
t1 = new CSGTerm(CSGTerm::TYPE_INTERSECTION, t1, t2);
}
}
@@ -67,7 +67,7 @@ void CSGTermEvaluator::applyToChildren(const AbstractNode &node, CSGTermEvaluato
Response CSGTermEvaluator::visit(State &state, const AbstractNode &node)
{
if (state.isPostfix()) {
- applyToChildren(node, UNION);
+ applyToChildren(node, CSGT_UNION);
addToParent(state, node);
}
return ContinueTraversal;
@@ -76,7 +76,7 @@ Response CSGTermEvaluator::visit(State &state, const AbstractNode &node)
Response CSGTermEvaluator::visit(State &state, const AbstractIntersectionNode &node)
{
if (state.isPostfix()) {
- applyToChildren(node, INTERSECTION);
+ applyToChildren(node, CSGT_INTERSECTION);
addToParent(state, node);
}
return ContinueTraversal;
@@ -120,13 +120,13 @@ Response CSGTermEvaluator::visit(State &state, const CsgNode &node)
CsgOp op;
switch (node.type) {
case CSG_TYPE_UNION:
- op = UNION;
+ op = CSGT_UNION;
break;
case CSG_TYPE_DIFFERENCE:
- op = DIFFERENCE;
+ op = CSGT_DIFFERENCE;
break;
case CSG_TYPE_INTERSECTION:
- op = INTERSECTION;
+ op = CSGT_INTERSECTION;
break;
}
applyToChildren(node, op);
@@ -157,7 +157,7 @@ Response CSGTermEvaluator::visit(State &state, const TransformNode &node)
state.setMatrix(m);
}
if (state.isPostfix()) {
- applyToChildren(node, UNION);
+ applyToChildren(node, CSGT_UNION);
addToParent(state, node);
}
return ContinueTraversal;
@@ -168,7 +168,7 @@ Response CSGTermEvaluator::visit(State &state, const RenderNode &node)
{
PRINT("WARNING: Found render() statement but compiled without CGAL support!");
if (state.isPostfix()) {
- applyToChildren(node, UNION);
+ applyToChildren(node, CSGT_UNION);
addToParent(state, node);
}
return ContinueTraversal;
diff --git a/src/CSGTermEvaluator.h b/src/CSGTermEvaluator.h
index beb1201..ff62cc1 100644
--- a/src/CSGTermEvaluator.h
+++ b/src/CSGTermEvaluator.h
@@ -34,7 +34,7 @@ public:
vector<CSGTerm*> &background);
private:
- enum CsgOp {UNION, INTERSECTION, DIFFERENCE, MINKOWSKI};
+ enum CsgOp {CSGT_UNION, CSGT_INTERSECTION, CSGT_DIFFERENCE, CSGT_MINKOWSKI};
void addToParent(const State &state, const AbstractNode &node);
void applyToChildren(const AbstractNode &node, CSGTermEvaluator::CsgOp op);
diff --git a/src/func.cc b/src/func.cc
index fd4bd7e..c10963c 100644
--- a/src/func.cc
+++ b/src/func.cc
@@ -30,6 +30,7 @@
#include "dxfdim.h"
#include "builtin.h"
#include <sstream>
+#include <ctime>
#include "mathc99.h"
AbstractFunction::~AbstractFunction()
contact: Jan Huwald // Impressum