diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-26 03:04:44 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-26 03:09:15 +0300 |
commit | 8a68f4f80814a28d68055a0ae0b22a7efe1c2619 (patch) | |
tree | c89d4c3343836b0b8321be1beb55d7b547a6d6a3 /source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp | |
parent | 15f3cf7f8f956a6372b6a99788b622946ba3d1e5 (diff) |
Cleanup: replace unsigned with uint, use function style casts for C++
Diffstat (limited to 'source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp')
-rw-r--r-- | source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp index d73d457713c..024a6a82b72 100644 --- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp +++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp @@ -430,12 +430,12 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, int nSamples = 0; vector<WFace *> wFaces; WFace *wFace = nullptr; - unsigned count = 0; - unsigned count_step = (unsigned)ceil(0.01f * vedges.size()); - unsigned tmpQI = 0; - unsigned qiClasses[256]; - unsigned maxIndex, maxCard; - unsigned qiMajority; + uint count = 0; + uint count_step = uint(ceil(0.01f * vedges.size())); + uint tmpQI = 0; + uint qiClasses[256]; + uint maxIndex, maxCard; + uint qiMajority; for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) { if (iRenderMonitor) { if (iRenderMonitor->testBreak()) { @@ -582,7 +582,7 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, // ViewEdge // qi -- // Find the minimum value that is >= the majority of the QI - for (unsigned count = 0, i = 0; i < 256; ++i) { + for (uint count = 0, i = 0; i < 256; ++i) { count += qiClasses[i]; if (count >= qiMajority) { (*ve)->setQI(i); @@ -639,10 +639,10 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, int nSamples = 0; vector<WFace *> wFaces; WFace *wFace = nullptr; - unsigned tmpQI = 0; - unsigned qiClasses[256]; - unsigned maxIndex, maxCard; - unsigned qiMajority; + uint tmpQI = 0; + uint qiClasses[256]; + uint maxIndex, maxCard; + uint qiMajority; for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) { if (iRenderMonitor && iRenderMonitor->testBreak()) { break; @@ -816,13 +816,13 @@ static void computeFastVisibility(ViewMap *ioViewMap, G &grid, real epsilon) vector<ViewEdge *> &vedges = ioViewMap->ViewEdges(); FEdge *fe, *festart; - unsigned nSamples = 0; + uint nSamples = 0; vector<WFace *> wFaces; WFace *wFace = nullptr; - unsigned tmpQI = 0; - unsigned qiClasses[256]; - unsigned maxIndex, maxCard; - unsigned qiMajority; + uint tmpQI = 0; + uint qiClasses[256]; + uint maxIndex, maxCard; + uint qiMajority; bool even_test; for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) { // Find an edge to test @@ -950,7 +950,7 @@ static void computeVeryFastVisibility(ViewMap *ioViewMap, G &grid, real epsilon) vector<ViewEdge *> &vedges = ioViewMap->ViewEdges(); FEdge *fe; - unsigned qi = 0; + uint qi = 0; WFace *wFace = nullptr; for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) { @@ -1531,19 +1531,19 @@ void ViewMapBuilder::ComputeEdgesVisibility(ViewMap *ioViewMap, } } -static const unsigned gProgressBarMaxSteps = 10; -static const unsigned gProgressBarMinSize = 2000; +static const uint gProgressBarMaxSteps = 10; +static const uint gProgressBarMinSize = 2000; void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilon) { vector<ViewEdge *> &vedges = ioViewMap->ViewEdges(); bool progressBarDisplay = false; - unsigned progressBarStep = 0; - unsigned vEdgesSize = vedges.size(); - unsigned fEdgesSize = ioViewMap->FEdges().size(); + uint progressBarStep = 0; + uint vEdgesSize = vedges.size(); + uint fEdgesSize = ioViewMap->FEdges().size(); if (_pProgressBar != nullptr && fEdgesSize > gProgressBarMinSize) { - unsigned progressBarSteps = min(gProgressBarMaxSteps, vEdgesSize); + uint progressBarSteps = min(gProgressBarMaxSteps, vEdgesSize); progressBarStep = vEdgesSize / progressBarSteps; _pProgressBar->reset(); _pProgressBar->setLabelText("Computing Ray casting Visibility"); @@ -1552,16 +1552,16 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo progressBarDisplay = true; } - unsigned counter = progressBarStep; + uint counter = progressBarStep; FEdge *fe, *festart; int nSamples = 0; vector<Polygon3r *> aFaces; Polygon3r *aFace = nullptr; - unsigned tmpQI = 0; - unsigned qiClasses[256]; - unsigned maxIndex, maxCard; - unsigned qiMajority; - static unsigned timestamp = 1; + uint tmpQI = 0; + uint qiClasses[256]; + uint maxIndex, maxCard; + uint qiMajority; + static uint timestamp = 1; for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) { if (_pRenderMonitor && _pRenderMonitor->testBreak()) { break; @@ -1695,12 +1695,12 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, real ep { vector<ViewEdge *> &vedges = ioViewMap->ViewEdges(); bool progressBarDisplay = false; - unsigned progressBarStep = 0; - unsigned vEdgesSize = vedges.size(); - unsigned fEdgesSize = ioViewMap->FEdges().size(); + uint progressBarStep = 0; + uint vEdgesSize = vedges.size(); + uint fEdgesSize = ioViewMap->FEdges().size(); if (_pProgressBar != nullptr && fEdgesSize > gProgressBarMinSize) { - unsigned progressBarSteps = min(gProgressBarMaxSteps, vEdgesSize); + uint progressBarSteps = min(gProgressBarMaxSteps, vEdgesSize); progressBarStep = vEdgesSize / progressBarSteps; _pProgressBar->reset(); _pProgressBar->setLabelText("Computing Ray casting Visibility"); @@ -1709,16 +1709,16 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, real ep progressBarDisplay = true; } - unsigned counter = progressBarStep; + uint counter = progressBarStep; FEdge *fe, *festart; - unsigned nSamples = 0; + uint nSamples = 0; vector<Polygon3r *> aFaces; Polygon3r *aFace = nullptr; - unsigned tmpQI = 0; - unsigned qiClasses[256]; - unsigned maxIndex, maxCard; - unsigned qiMajority; - static unsigned timestamp = 1; + uint tmpQI = 0; + uint qiClasses[256]; + uint maxIndex, maxCard; + uint qiMajority; + static uint timestamp = 1; bool even_test; for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) { if (_pRenderMonitor && _pRenderMonitor->testBreak()) { @@ -1828,12 +1828,12 @@ void ViewMapBuilder::ComputeVeryFastRayCastingVisibility(ViewMap *ioViewMap, rea { vector<ViewEdge *> &vedges = ioViewMap->ViewEdges(); bool progressBarDisplay = false; - unsigned progressBarStep = 0; - unsigned vEdgesSize = vedges.size(); - unsigned fEdgesSize = ioViewMap->FEdges().size(); + uint progressBarStep = 0; + uint vEdgesSize = vedges.size(); + uint fEdgesSize = ioViewMap->FEdges().size(); if (_pProgressBar != nullptr && fEdgesSize > gProgressBarMinSize) { - unsigned progressBarSteps = min(gProgressBarMaxSteps, vEdgesSize); + uint progressBarSteps = min(gProgressBarMaxSteps, vEdgesSize); progressBarStep = vEdgesSize / progressBarSteps; _pProgressBar->reset(); _pProgressBar->setLabelText("Computing Ray casting Visibility"); @@ -1842,11 +1842,11 @@ void ViewMapBuilder::ComputeVeryFastRayCastingVisibility(ViewMap *ioViewMap, rea progressBarDisplay = true; } - unsigned counter = progressBarStep; + uint counter = progressBarStep; FEdge *fe; - unsigned qi = 0; + uint qi = 0; Polygon3r *aFace = nullptr; - static unsigned timestamp = 1; + static uint timestamp = 1; for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) { if (_pRenderMonitor && _pRenderMonitor->testBreak()) { break; @@ -1882,7 +1882,7 @@ void ViewMapBuilder::FindOccludee(FEdge *fe, Grid *iGrid, real epsilon, Polygon3r **oaPolygon, - unsigned timestamp, + uint timestamp, Vec3r &u, Vec3r &A, Vec3r &origin, @@ -1986,7 +1986,7 @@ void ViewMapBuilder::FindOccludee(FEdge *fe, } void ViewMapBuilder::FindOccludee( - FEdge *fe, Grid *iGrid, real epsilon, Polygon3r **oaPolygon, unsigned timestamp) + FEdge *fe, Grid *iGrid, real epsilon, Polygon3r **oaPolygon, uint timestamp) { OccludersSet occluders; @@ -2030,7 +2030,7 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe, real epsilon, set<ViewShape *> &oOccluders, Polygon3r **oaPolygon, - unsigned timestamp) + uint timestamp) { OccludersSet occluders; int qi = 0; @@ -2326,8 +2326,8 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi { vector<SVertex *> &svertices = ioViewMap->SVertices(); bool progressBarDisplay = false; - unsigned sVerticesSize = svertices.size(); - unsigned fEdgesSize = ioViewMap->FEdges().size(); + uint sVerticesSize = svertices.size(); + uint fEdgesSize = ioViewMap->FEdges().size(); #if 0 if (_global.debug & G_DEBUG_FREESTYLE) { ViewMap::fedges_container &fedges = ioViewMap->FEdges(); @@ -2338,10 +2338,10 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi } } #endif - unsigned progressBarStep = 0; + uint progressBarStep = 0; if (_pProgressBar != nullptr && fEdgesSize > gProgressBarMinSize) { - unsigned progressBarSteps = min(gProgressBarMaxSteps, sVerticesSize); + uint progressBarSteps = min(gProgressBarMaxSteps, sVerticesSize); progressBarStep = sVerticesSize / progressBarSteps; _pProgressBar->reset(); _pProgressBar->setLabelText("Computing Sweep Line Intersections"); @@ -2350,7 +2350,7 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi progressBarDisplay = true; } - unsigned counter = progressBarStep; + uint counter = progressBarStep; sort(svertices.begin(), svertices.end(), less_SVertex2D(epsilon)); @@ -2500,8 +2500,8 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi progressBarStep = 0; if (progressBarDisplay) { - unsigned iEdgesSize = iedges.size(); - unsigned progressBarSteps = min(gProgressBarMaxSteps, iEdgesSize); + uint iEdgesSize = iedges.size(); + uint progressBarSteps = min(gProgressBarMaxSteps, iEdgesSize); progressBarStep = iEdgesSize / progressBarSteps; _pProgressBar->reset(); _pProgressBar->setLabelText("Splitting intersected edges"); |