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/AverageAreaGridDensityProvider.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/AverageAreaGridDensityProvider.cpp')
-rw-r--r-- | source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp index 4832d08f2bc..d293ed8189f 100644 --- a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp +++ b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp @@ -34,6 +34,8 @@ #include "AverageAreaGridDensityProvider.h" +#include "BKE_global.h" + AverageAreaGridDensityProvider::AverageAreaGridDensityProvider(OccluderSource& source, const real proscenium[4], real sizeFactor) : GridDensityProvider(source) @@ -76,16 +78,22 @@ void AverageAreaGridDensityProvider::initialize(const real proscenium[4], real s cellArea += (max[0] - min[0]) * (max[1] - min[1]); ++numFaces; } - cout << "Total area: " << cellArea << ". Number of faces: " << numFaces << "." << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Total area: " << cellArea << ". Number of faces: " << numFaces << "." << endl; + } cellArea /= numFaces; cellArea *= sizeFactor; - cout << "Building grid with average area " << cellArea << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Building grid with average area " << cellArea << endl; + } _cellSize = sqrt(cellArea); // Now we know how many cells make each side of our grid _cellsX = ceil(prosceniumWidth / _cellSize); _cellsY = ceil(prosceniumHeight / _cellSize); - cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl; + } // Make sure the grid exceeds the proscenium by a small amount float safetyZone = 0.1f; @@ -95,7 +103,9 @@ void AverageAreaGridDensityProvider::initialize(const real proscenium[4], real s if (_cellsY * _cellSize < prosceniumHeight * (1.0 + safetyZone)) { _cellsY = prosceniumHeight * (1.0 + safetyZone) / _cellSize; } - cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl; + } // Find grid origin _cellOrigin[0] = ((proscenium[0] + proscenium[1]) / 2.0) - (_cellsX / 2.0) * _cellSize; |