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:
Diffstat (limited to 'source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp')
-rw-r--r--source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp18
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;