Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-04 03:27:20 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-04 03:27:20 +0400
commitec78eb353f71341f84999f47a7222becaadb8598 (patch)
tree0ae6937bcd59f93e0cec512f7b902686cf210e22 /source/blender/freestyle/intern/view_map/BoxGrid.cpp
parent699da2fb0d9012cef5e45cc1b547a01fd92dbc1c (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/BoxGrid.cpp')
-rw-r--r--source/blender/freestyle/intern/view_map/BoxGrid.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/view_map/BoxGrid.cpp b/source/blender/freestyle/intern/view_map/BoxGrid.cpp
index 6b2804b17ce..c83ab44a259 100644
--- a/source/blender/freestyle/intern/view_map/BoxGrid.cpp
+++ b/source/blender/freestyle/intern/view_map/BoxGrid.cpp
@@ -37,6 +37,8 @@
#include "BoxGrid.h"
+#include "BKE_global.h"
+
using namespace std;
// Helper Classes
@@ -80,9 +82,11 @@ BoxGrid::Iterator::Iterator (BoxGrid& grid, Vec3r& center, real epsilon)
// Find target cell
_cell = grid.findCell(_target);
#if BOX_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,18 +103,26 @@ BoxGrid::BoxGrid(OccluderSource& source, GridDensityProvider& density, ViewMap *
: _viewpoint(viewpoint), _enableQI(enableQI)
{
// Generate Cell structure
- cout << "Generate Cell structure" << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << "Generate Cell structure" << endl;
+ }
assignCells(source, density, viewMap);
// Fill Cells
- cout << "Distribute occluders" << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << "Distribute occluders" << endl;
+ }
distributePolygons(source);
// Reorganize Cells
- cout << "Reorganize cells" << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << "Reorganize cells" << endl;
+ }
reorganizeCells();
- cout << "Ready to use BoxGrid" << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << "Ready to use BoxGrid" << endl;
+ }
}
BoxGrid::~BoxGrid() {}
@@ -178,7 +190,9 @@ void BoxGrid::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 BoxGrid::reorganizeCells()