summaryrefslogtreecommitdiff
path: root/src/node.cc
diff options
context:
space:
mode:
authordonbright <hugh.m.bright@gmail.com>2013-03-05 23:47:14 (GMT)
committerdonbright <hugh.m.bright@gmail.com>2013-03-05 23:47:14 (GMT)
commit42f21c3a0850083d245aa3ac346a53e876f0679e (patch)
treefacf41750e0fe27cc4cdaf352c9c8e687011d103 /src/node.cc
parent422c668dcb538f181683ae51305bf8d3404f48d6 (diff)
parent4734172c3a16cc06b09e4d2131aa8e380bd0f226 (diff)
Merge pull request #288 from openscad/issue11_2
Issue11 2
Diffstat (limited to 'src/node.cc')
-rw-r--r--src/node.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/node.cc b/src/node.cc
index e61174f..a7a7630 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -32,6 +32,7 @@
#include <iostream>
#include <algorithm>
+#include <boost/foreach.hpp>
size_t AbstractNode::idx_counter;
@@ -101,3 +102,14 @@ std::ostream &operator<<(std::ostream &stream, const AbstractNode &node)
stream << node.toString();
return stream;
}
+
+// Do we have an explicit root node (! modifier)?
+AbstractNode *find_root_tag(AbstractNode *n)
+{
+ BOOST_FOREACH(AbstractNode *v, n->children) {
+ if (v->modinst->tag_root) return v;
+ if (AbstractNode *vroot = find_root_tag(v)) return vroot;
+ }
+ return NULL;
+}
+
contact: Jan Huwald // Impressum