diff options
Diffstat (limited to 'source/blender/freestyle/intern/view_map')
4 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/freestyle/intern/view_map/BoxGrid.cpp b/source/blender/freestyle/intern/view_map/BoxGrid.cpp index eac6765da99..4c79d6c2fa1 100644 --- a/source/blender/freestyle/intern/view_map/BoxGrid.cpp +++ b/source/blender/freestyle/intern/view_map/BoxGrid.cpp @@ -188,8 +188,8 @@ void BoxGrid::reorganizeCells() void BoxGrid::getCellCoordinates(const Vec3r &point, unsigned &x, unsigned &y) { - x = min(_cellsX - 1, (unsigned)floor(max((double)0.0f, point[0] - _cellOrigin[0]) / _cellSize)); - y = min(_cellsY - 1, (unsigned)floor(max((double)0.0f, point[1] - _cellOrigin[1]) / _cellSize)); + x = min(_cellsX - 1, (unsigned)floor(max(double(0.0f), point[0] - _cellOrigin[0]) / _cellSize)); + y = min(_cellsY - 1, (unsigned)floor(max(double(0.0f), point[1] - _cellOrigin[1]) / _cellSize)); } BoxGrid::Cell *BoxGrid::findCell(const Vec3r &point) diff --git a/source/blender/freestyle/intern/view_map/SphericalGrid.cpp b/source/blender/freestyle/intern/view_map/SphericalGrid.cpp index 70f10058411..5e27e344c28 100644 --- a/source/blender/freestyle/intern/view_map/SphericalGrid.cpp +++ b/source/blender/freestyle/intern/view_map/SphericalGrid.cpp @@ -184,8 +184,8 @@ void SphericalGrid::reorganizeCells() void SphericalGrid::getCellCoordinates(const Vec3r &point, unsigned &x, unsigned &y) { - x = min(_cellsX - 1, (unsigned)floor(max((double)0.0f, point[0] - _cellOrigin[0]) / _cellSize)); - y = min(_cellsY - 1, (unsigned)floor(max((double)0.0f, point[1] - _cellOrigin[1]) / _cellSize)); + x = min(_cellsX - 1, (unsigned)floor(max(double(0.0f), point[0] - _cellOrigin[0]) / _cellSize)); + y = min(_cellsY - 1, (unsigned)floor(max(double(0.0f), point[1] - _cellOrigin[1]) / _cellSize)); } SphericalGrid::Cell *SphericalGrid::findCell(const Vec3r &point) diff --git a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp index 88f94e152a1..0a05d469585 100644 --- a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp +++ b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp @@ -29,10 +29,10 @@ using namespace Geometry; SteerableViewMap::SteerableViewMap(uint nbOrientations) { _nbOrientations = nbOrientations; - _bound = cos(M_PI / (float)_nbOrientations); + _bound = cos(M_PI / float(_nbOrientations)); for (uint i = 0; i < _nbOrientations; ++i) { - _directions.emplace_back(cos((float)i * M_PI / (float)_nbOrientations), - sin((float)i * M_PI / (float)_nbOrientations)); + _directions.emplace_back(cos(float(i) * M_PI / float(_nbOrientations)), + sin(float(i) * M_PI / float(_nbOrientations))); } Build(); } @@ -101,7 +101,7 @@ double SteerableViewMap::ComputeWeight(const Vec2d &dir, unsigned i) dotp = 1.0; } - return cos((float)_nbOrientations / 2.0 * acos(dotp)); + return cos(float(_nbOrientations) / 2.0 * acos(dotp)); } double *SteerableViewMap::AddFEdge(FEdge *iFEdge) @@ -246,7 +246,7 @@ void SteerableViewMap::saveSteerableViewMap() const for (int y = 0; y < oh; ++y) { // soc for (int x = 0; x < ow; ++x) { // soc - int c = (int)(coeff * _imagesPyramids[i]->pixel(x, y, j)); + int c = int(coeff * _imagesPyramids[i]->pixel(x, y, j)); if (c > 255) { c = 255; } diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp index bbf9962b0e6..343f6a8f761 100644 --- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp +++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp @@ -445,7 +445,7 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, stringstream ss; ss << "Freestyle: Visibility computations " << (100 * count / vedges.size()) << "%"; iRenderMonitor->setInfo(ss.str()); - iRenderMonitor->progress((float)count / vedges.size()); + iRenderMonitor->progress(float(count) / vedges.size()); } count++; } @@ -607,7 +607,7 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, #endif // occludee -- if (!wFaces.empty()) { - if (wFaces.size() <= (float)nSamples / 2.0f) { + if (wFaces.size() <= float(nSamples) / 2.0f) { (*ve)->setaShape(nullptr); } else { @@ -623,7 +623,7 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, stringstream ss; ss << "Freestyle: Visibility computations " << (100 * count / vedges.size()) << "%"; iRenderMonitor->setInfo(ss.str()); - iRenderMonitor->progress((float)count / vedges.size()); + iRenderMonitor->progress(float(count) / vedges.size()); } } @@ -796,7 +796,7 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, #endif // occludee -- if (!wFaces.empty()) { - if (wFaces.size() <= (float)nSamples / 2.0f) { + if (wFaces.size() <= float(nSamples) / 2.0f) { (*ve)->setaShape(nullptr); } else { @@ -1668,7 +1668,7 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo #endif // occludee -- if (!aFaces.empty()) { - if (aFaces.size() <= (float)nSamples / 2.0f) { + if (aFaces.size() <= float(nSamples) / 2.0f) { (*ve)->setaShape(nullptr); } else { |