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/stroke/Operators.cpp')
-rw-r--r--source/blender/freestyle/intern/stroke/Operators.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/freestyle/intern/stroke/Operators.cpp b/source/blender/freestyle/intern/stroke/Operators.cpp
index 25954c7ecbf..c73bb739e47 100644
--- a/source/blender/freestyle/intern/stroke/Operators.cpp
+++ b/source/blender/freestyle/intern/stroke/Operators.cpp
@@ -34,7 +34,7 @@ namespace Freestyle {
Operators::I1DContainer Operators::_current_view_edges_set;
Operators::I1DContainer Operators::_current_chains_set;
-Operators::I1DContainer *Operators::_current_set = NULL;
+Operators::I1DContainer *Operators::_current_set = nullptr;
Operators::StrokesContainer Operators::_current_strokes_set;
int Operators::select(UnaryPredicate1D &pred)
@@ -656,7 +656,7 @@ int Operators::sequentialSplit(UnaryPredicate0D &startingPred,
goto error;
}
} while (!startingPred.result);
- } while ((itStart != end) && (itStart != last));
+ } while (!ELEM(itStart, end, last));
}
// Update the current set of chains:
@@ -738,7 +738,7 @@ static int __recursiveSplit(Chain *_curve,
// retrieves the current splitting id
Id *newId = _curve->getSplittingId();
- if (newId == 0) {
+ if (newId == nullptr) {
newId = new Id(_curve->getId());
_curve->setSplittingId(newId);
}
@@ -810,7 +810,7 @@ int Operators::recursiveSplit(UnaryFunction0D<double> &func,
return 0;
}
- Chain *currentChain = 0;
+ Chain *currentChain = nullptr;
I1DContainer splitted_chains;
I1DContainer newChains;
I1DContainer::iterator cit = _current_chains_set.begin(), citend = _current_chains_set.end();
@@ -885,7 +885,7 @@ static int __recursiveSplit(Chain *_curve,
#endif
real _min = FLT_MAX;
++it;
- real mean = 0.f;
+ real mean = 0.0f;
// soc unused - real variance = 0.0f;
unsigned count = 0;
CurveInternal::CurvePointIterator next = it;
@@ -921,7 +921,7 @@ static int __recursiveSplit(Chain *_curve,
// retrieves the current splitting id
Id *newId = _curve->getSplittingId();
- if (newId == NULL) {
+ if (newId == nullptr) {
newId = new Id(_curve->getId());
_curve->setSplittingId(newId);
}
@@ -994,7 +994,7 @@ int Operators::recursiveSplit(UnaryFunction0D<double> &func,
return 0;
}
- Chain *currentChain = 0;
+ Chain *currentChain = nullptr;
I1DContainer splitted_chains;
I1DContainer newChains;
I1DContainer::iterator cit = _current_chains_set.begin(), citend = _current_chains_set.end();
@@ -1095,7 +1095,7 @@ static Stroke *createStroke(Interface1D &inter)
Vec2r previous = current;
SVertex *sv;
CurvePoint *cp;
- StrokeVertex *stroke_vertex = NULL;
+ StrokeVertex *stroke_vertex = nullptr;
bool hasSingularity = false;
do {
@@ -1122,7 +1122,7 @@ static Stroke *createStroke(Interface1D &inter)
stroke->push_back(stroke_vertex);
previous = current;
++it;
- } while ((it != itend) && (it != itfirst));
+ } while (!ELEM(it, itend, itfirst));
if (it == itfirst) {
// Add last vertex:
@@ -1152,7 +1152,7 @@ static Stroke *createStroke(Interface1D &inter)
// Discard the stroke if the number of stroke vertices is less than two
if (stroke->strokeVerticesSize() < 2) {
delete stroke;
- return NULL;
+ return nullptr;
}
stroke->setLength(currentCurvilignAbscissa);
if (hasSingularity) {
@@ -1198,7 +1198,7 @@ static Stroke *createStroke(Interface1D &inter)
else {
// Discard the stroke because all stroke vertices are overlapping
delete stroke;
- return NULL;
+ return nullptr;
}
current = overlapping_vertices.front()->getPoint();
Vec2r dir(target - current);