diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-10-31 01:58:50 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-10-31 01:58:50 (GMT) |
commit | e0c5673e1bf965fbb1bbbef2562a54be1a3144a3 (patch) | |
tree | 5996824c15ccca985630ff07294a5b79158e4d86 /src/node.h | |
parent | b3f4c98c80acaa414f7bdacc86314d97267acba5 (diff) |
Reverted accidental commits
git-svn-id: http://svn.clifford.at/openscad/trunk@573 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/node.h')
-rw-r--r-- | src/node.h | 57 |
1 files changed, 11 insertions, 46 deletions
@@ -8,8 +8,6 @@ #include "cgal.h" #endif -#include "traverser.h" - extern int progress_report_count; extern void (*progress_report_f)(const class AbstractNode*, void*, int); extern void *progress_report_vp; @@ -19,47 +17,23 @@ void progress_report_fin(); class AbstractNode { - // FIXME: the idx_counter/idx is mostly (only?) for debugging. - // We can hash on pointer value or smth. else. - // -> remove and - // use smth. else to display node identifier in CSG tree output? static int idx_counter; // Node instantiation index public: - AbstractNode(const class ModuleInstantiation *mi); - virtual ~AbstractNode(); - virtual Response accept(const class State &state, class Visitor &visitor) const; - virtual std::string toString() const; - - // FIXME: Make return value a reference - const std::list<AbstractNode*> getChildren() const { - return this->children.toList().toStdList(); - } - int index() const { return this->idx; } - static void resetIndexCounter() { idx_counter = 1; } - // FIXME: Rewrite to STL container? - // FIXME: Make protected QVector<AbstractNode*> children; - const ModuleInstantiation *modinst; + const class ModuleInstantiation *modinst; - // progress_mark is a running number used for progress indication - // FIXME: Make all progress handling external, put it in the traverser class? int progress_mark; void progress_prepare(); void progress_report() const; - int idx; // Node index (unique per tree) - - // FIXME: Remove these three with dump() method + int idx; QString dump_cache; - virtual QString mk_cache_id() const; - virtual QString dump(QString indent) const; - - // FIXME: Rewrite to visitor - virtual class CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const; - // FIXME: Rewrite to visitor + AbstractNode(const ModuleInstantiation *mi); + virtual ~AbstractNode(); + virtual QString mk_cache_id() const; #ifdef ENABLE_CGAL struct cgal_nef_cache_entry { CGAL_Nef_polyhedron N; @@ -67,21 +41,19 @@ public: cgal_nef_cache_entry(const CGAL_Nef_polyhedron &N); }; static QCache<QString, cgal_nef_cache_entry> cgal_nef_cache; - virtual CGAL_Nef_polyhedron renderCSGMesh() const; + virtual CGAL_Nef_polyhedron render_cgal_nef_polyhedron() const; class CSGTerm *render_csg_term_from_nef(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background, const char *statement, int convexity) const; #endif + virtual class CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const; + virtual QString dump(QString indent) const; }; class AbstractIntersectionNode : public AbstractNode { public: AbstractIntersectionNode(const ModuleInstantiation *mi) : AbstractNode(mi) { }; - virtual ~AbstractIntersectionNode() { }; - virtual Response accept(const class State &state, class Visitor &visitor) const; - virtual std::string toString() const; - #ifdef ENABLE_CGAL - virtual CGAL_Nef_polyhedron renderCSGMesh() const; + virtual CGAL_Nef_polyhedron render_cgal_nef_polyhedron() const; #endif virtual CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const; virtual QString dump(QString indent) const; @@ -90,24 +62,17 @@ public: class AbstractPolyNode : public AbstractNode { public: - AbstractPolyNode(const ModuleInstantiation *mi) : AbstractNode(mi) { }; - virtual ~AbstractPolyNode() { }; - virtual Response accept(const class State &state, class Visitor &visitor) const; - enum render_mode_e { RENDER_CGAL, RENDER_OPENCSG }; + AbstractPolyNode(const ModuleInstantiation *mi) : AbstractNode(mi) { }; virtual class PolySet *render_polyset(render_mode_e mode) const = 0; #ifdef ENABLE_CGAL - virtual CGAL_Nef_polyhedron renderCSGMesh() const; + virtual CGAL_Nef_polyhedron render_cgal_nef_polyhedron() const; #endif virtual CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const; static CSGTerm *render_csg_term_from_ps(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background, PolySet *ps, const ModuleInstantiation *modinst, int idx); }; -std::ostream &operator<<(std::ostream &stream, const AbstractNode &node); -// FIXME: Doesn't belong here.. -std::ostream &operator<<(std::ostream &stream, const QString &str); - #endif |