From 42043dd97d8902c50dbd0b4ed4bde22b0104c88c Mon Sep 17 00:00:00 2001 From: don bright Date: Sat, 18 Aug 2012 15:40:15 +0200 Subject: maintain order of polygons in evaluateCGALMesh to fix issue 177. add option to dump more info to csgchain diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 1b307be..ee04e05 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -34,8 +34,8 @@ #include #include -#include #include +#include CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const AbstractNode &node) { @@ -445,9 +445,9 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps) struct PolyReducer { Grid2d grid; - boost::unordered_map, std::pair > edge_to_poly; - boost::unordered_map points; - typedef boost::unordered_map > PolygonMap; + std::map, std::pair > edge_to_poly; + std::map points; + typedef std::map > PolygonMap; PolygonMap polygons; int poly_n; diff --git a/src/csgterm.cc b/src/csgterm.cc index 4e6912b..8b0c8a4 100644 --- a/src/csgterm.cc +++ b/src/csgterm.cc @@ -178,7 +178,7 @@ void CSGChain::import(shared_ptr term, CSGTerm::type_e type) } } -std::string CSGChain::dump() +std::string CSGChain::dump(bool full=false) { std::stringstream dump; @@ -193,6 +193,11 @@ std::string CSGChain::dump() else if (types[i] == CSGTerm::TYPE_INTERSECTION) dump << " *"; dump << labels[i]; + if (full) { + dump << " polyset: \n" << polysets[i]->dump() << "\n"; + dump << " matrix: \n" << matrices[i].matrix() << "\n"; + dump << " color: \n" << colors[i] << "\n"; + } } dump << "\n"; return dump.str(); diff --git a/src/csgterm.h b/src/csgterm.h index 4278d85..95cfafd 100644 --- a/src/csgterm.h +++ b/src/csgterm.h @@ -59,7 +59,7 @@ public: void add(const shared_ptr &polyset, const Transform3d &m, const Color4f &color, CSGTerm::type_e type, std::string label); void import(shared_ptr term, CSGTerm::type_e type = CSGTerm::TYPE_UNION); - std::string dump(); + std::string dump(bool full); BoundingBox getBoundingBox() const; }; -- cgit v0.10.1