diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2011-09-20 02:25:05 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2011-09-20 02:25:05 (GMT) |
commit | ccc88b0c433e9d66ea24dfd26ad6e835196acca5 (patch) | |
tree | 4dbdefbe26b9a4843a98fb18928236c7dbf6f69c /src | |
parent | 24fa66ca38a5f9ce656af4d72109d9ad3a1e2526 (diff) |
get throwntogetherrenderer working in tests (initalize csgInfo to null)
Diffstat (limited to 'src')
-rw-r--r-- | src/csgterm.cc | 20 | ||||
-rw-r--r-- | src/csgterm.h | 1 | ||||
-rw-r--r-- | src/mainwin.cc | 13 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/csgterm.cc b/src/csgterm.cc index 8306aaf..5bccff8 100644 --- a/src/csgterm.cc +++ b/src/csgterm.cc @@ -227,6 +227,26 @@ std::string CSGChain::dump() return dump.str(); } + +std::string CSGChain::fulldump() +{ + std::stringstream dump; + dump << "\nsizes: \n"; + dump << " polysets: " << polysets.size(); + dump << " matrices: " << matrices.size(); + dump << " colors: " << colors.size(); + dump << " types: " << types.size(); + dump << " labels: " << labels.size(); + dump << "\ndata: \n"; + for (size_t i = 0; i < polysets.size(); i++) dump << (*polysets[i]).polygons.size() << "\n"; + for (size_t i = 0; i < matrices.size(); i++) dump << *matrices[i] << "\n"; + for (size_t i = 0; i < colors.size(); i++) dump << *colors[i] << "\n"; + for (size_t i = 0; i < types.size(); i++) dump << types[i] << "\n"; + for (size_t i = 0; i < labels.size(); i++) dump << labels[i] << "\n"; + dump << "\n"; + return dump.str(); +} + BoundingBox CSGChain::getBoundingBox() const { BoundingBox bbox; diff --git a/src/csgterm.h b/src/csgterm.h index c12b7ae..c4e88a6 100644 --- a/src/csgterm.h +++ b/src/csgterm.h @@ -50,6 +50,7 @@ public: void add(const shared_ptr<PolySet> &polyset, double *m, double *color, CSGTerm::type_e type, std::string label); void import(CSGTerm *term, CSGTerm::type_e type = CSGTerm::TYPE_UNION); std::string dump(); + std::string fulldump(); BoundingBox getBoundingBox() const; }; diff --git a/src/mainwin.cc b/src/mainwin.cc index 56502f2..f3f53a1 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -95,6 +95,8 @@ using namespace boost::lambda; #endif // ENABLE_CGAL +using std::cerr; + // Global application state unsigned int GuiLocker::gui_locked = 0; @@ -876,6 +878,17 @@ void MainWindow::compileCSG(bool procevents) this->highlights_chain, this->background_chain); + fprintf(stderr, "Dump root chain\n"); + cerr << this->root_chain->fulldump(); + cerr << this->highlights_chain; + cerr << this->background_chain; +/* fprintf(stderr, "dump highlights\n"); + this->highlights_chain->dump(); + fprintf(stderr, "dump background\n"); + this->background_chain->dump();*/ + fprintf(stderr, "end dump\n"); + + PRINT("CSG generation finished."); int s = t.elapsed() / 1000; PRINTF("Total rendering time: %d hours, %d minutes, %d seconds", s / (60*60), (s / 60) % 60, s % 60); |