diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-04 03:27:20 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-04 03:27:20 +0400 |
commit | ec78eb353f71341f84999f47a7222becaadb8598 (patch) | |
tree | 0ae6937bcd59f93e0cec512f7b902686cf210e22 /source/blender/freestyle/intern/view_map/SphericalGrid.cpp | |
parent | 699da2fb0d9012cef5e45cc1b547a01fd92dbc1c (diff) |
New command-line option --debug-freestyle to enable verbose debug messages
on the console during Freestyle rendering. The debug prints are turned off
by default now. Errors are still printed on the console.
A patch set implementing this functionality was provided by Bastien Montagne.
Many thanks! :)
Diffstat (limited to 'source/blender/freestyle/intern/view_map/SphericalGrid.cpp')
-rw-r--r-- | source/blender/freestyle/intern/view_map/SphericalGrid.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/view_map/SphericalGrid.cpp b/source/blender/freestyle/intern/view_map/SphericalGrid.cpp index 1052965d472..4582fb40b61 100644 --- a/source/blender/freestyle/intern/view_map/SphericalGrid.cpp +++ b/source/blender/freestyle/intern/view_map/SphericalGrid.cpp @@ -37,6 +37,8 @@ #include "SphericalGrid.h" +#include "BKE_global.h" + using namespace std; // Helper Classes @@ -81,9 +83,11 @@ SphericalGrid::Iterator::Iterator(SphericalGrid& grid, Vec3r& center, real epsil // Find target cell _cell = grid.findCell(_target); #if SPHERICAL_GRID_LOGGING - cout << "Searching for occluders of edge centered at " << _target << " in cell [" - << _cell->boundary[0] << ", " << _cell->boundary[1] << ", " << _cell->boundary[2] - << ", " << _cell->boundary[3] << "] (" << _cell->faces.size() << " occluders)" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Searching for occluders of edge centered at " << _target << " in cell [" + << _cell->boundary[0] << ", " << _cell->boundary[1] << ", " << _cell->boundary[2] + << ", " << _cell->boundary[3] << "] (" << _cell->faces.size() << " occluders)" << endl; + } #endif // Set iterator @@ -99,16 +103,24 @@ SphericalGrid::SphericalGrid(OccluderSource& source, GridDensityProvider& densit Vec3r& viewpoint, bool enableQI) : _viewpoint(viewpoint), _enableQI(enableQI) { - cout << "Generate Cell structure" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Generate Cell structure" << endl; + } // Generate Cell structure assignCells(source, density, viewMap); - cout << "Distribute occluders" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Distribute occluders" << endl; + } // Fill Cells distributePolygons(source); - cout << "Reorganize cells" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Reorganize cells" << endl; + } // Reorganize Cells reorganizeCells(); - cout << "Ready to use SphericalGrid" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Ready to use SphericalGrid" << endl; + } } SphericalGrid::~SphericalGrid() {} @@ -175,7 +187,9 @@ void SphericalGrid::distributePolygons(OccluderSource& source) } ++nFaces; } - cout << "Distributed " << nFaces << " occluders. Retained " << nKeptFaces << "." << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Distributed " << nFaces << " occluders. Retained " << nKeptFaces << "." << endl; + } } void SphericalGrid::reorganizeCells() |