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')
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp2
-rw-r--r--source/blender/freestyle/intern/stroke/Canvas.cpp18
-rw-r--r--source/blender/freestyle/intern/stroke/ChainingIterators.cpp22
-rw-r--r--source/blender/freestyle/intern/stroke/Curve.cpp78
-rw-r--r--source/blender/freestyle/intern/stroke/Operators.cpp16
-rw-r--r--source/blender/freestyle/intern/stroke/Stroke.cpp50
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRenderer.cpp6
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRep.cpp14
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeTesselator.cpp4
9 files changed, 105 insertions, 105 deletions
diff --git a/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp b/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
index ef151365fa0..c01d95211d8 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
+++ b/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
@@ -43,7 +43,7 @@ int GetSteerableViewMapDensityF1D::operator()(Interface1D &inter)
Interface0D &i0D = (*it);
Interface0D &i0Dnext = (*itnext);
fe = i0D.getFEdge(i0Dnext);
- if (fe == 0) {
+ if (fe == nullptr) {
cerr << "GetSteerableViewMapDensityF1D warning: no FEdge between " << i0D.getId() << " and "
<< i0Dnext.getId() << endl;
// compute the direction between these two ???
diff --git a/source/blender/freestyle/intern/stroke/Canvas.cpp b/source/blender/freestyle/intern/stroke/Canvas.cpp
index 14c74c0f127..dc1a6fac4a9 100644
--- a/source/blender/freestyle/intern/stroke/Canvas.cpp
+++ b/source/blender/freestyle/intern/stroke/Canvas.cpp
@@ -48,17 +48,17 @@ using namespace std;
namespace Freestyle {
-Canvas *Canvas::_pInstance = 0;
+Canvas *Canvas::_pInstance = nullptr;
-const char *Canvas::_MapsPath = 0;
+const char *Canvas::_MapsPath = nullptr;
Canvas::Canvas()
{
- _SelectedFEdge = 0;
+ _SelectedFEdge = nullptr;
_pInstance = this;
PseudoNoise::init(42);
- _Renderer = 0;
- _current_sm = NULL;
+ _Renderer = nullptr;
+ _current_sm = nullptr;
_steerableViewMap = new SteerableViewMap(NB_STEERABLE_VIEWMAP - 1);
_basic = false;
}
@@ -76,12 +76,12 @@ Canvas::Canvas(const Canvas &iBrother)
Canvas::~Canvas()
{
- _pInstance = 0;
+ _pInstance = nullptr;
Clear();
if (_Renderer) {
delete _Renderer;
- _Renderer = 0;
+ _Renderer = nullptr;
}
// FIXME: think about an easy control for the maps memory management...
if (!_maps.empty()) {
@@ -347,8 +347,8 @@ void Canvas::loadMap(const char *iFileName,
qimg = &newMap;
#endif
/* OCIO_TODO: support different input color space */
- ImBuf *qimg = IMB_loadiffname(filePath.c_str(), 0, NULL);
- if (qimg == 0) {
+ ImBuf *qimg = IMB_loadiffname(filePath.c_str(), 0, nullptr);
+ if (qimg == nullptr) {
cerr << "Could not load image file " << filePath << endl;
return;
}
diff --git a/source/blender/freestyle/intern/stroke/ChainingIterators.cpp b/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
index 2b2ab0dc14a..51c04c8346e 100644
--- a/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
+++ b/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
@@ -76,19 +76,19 @@ int ChainingIterator::increment()
_increment = true;
ViewVertex *vertex = getVertex();
if (!vertex) {
- _edge = 0;
+ _edge = nullptr;
return 0;
}
AdjacencyIterator it = AdjacencyIterator(vertex, _restrictToSelection, _restrictToUnvisited);
if (it.isEnd()) {
- _edge = 0;
+ _edge = nullptr;
return 0;
}
if (traverse(it) < 0) {
return -1;
}
_edge = result;
- if (_edge == 0) {
+ if (_edge == nullptr) {
return 0;
}
if (_edge->A() == vertex) {
@@ -105,19 +105,19 @@ int ChainingIterator::decrement()
_increment = false;
ViewVertex *vertex = getVertex();
if (!vertex) {
- _edge = 0;
+ _edge = nullptr;
return 0;
}
AdjacencyIterator it = AdjacencyIterator(vertex, _restrictToSelection, _restrictToUnvisited);
if (it.isEnd()) {
- _edge = 0;
+ _edge = nullptr;
return 0;
}
if (traverse(it) < 0) {
return -1;
}
_edge = result;
- if (_edge == 0) {
+ if (_edge == nullptr) {
return 0;
}
if (_edge->B() == vertex) {
@@ -150,12 +150,12 @@ int ChainSilhouetteIterator::traverse(const AdjacencyIterator &ait)
}
++it;
}
- result = 0;
+ result = nullptr;
return 0;
}
if (nextVertex->getNature() & Nature::NON_T_VERTEX) {
// soc NonTVertex *nontvertex = (NonTVertex*)nextVertex;
- ViewEdge *newEdge(0);
+ ViewEdge *newEdge(nullptr);
// we'll try to chain the edges by keeping the same nature...
// the preseance order is : SILHOUETTE, BORDER, CREASE, MATERIAL_BOUNDARY, EDGE_MARK,
// SUGGESTIVE, VALLEY, RIDGE
@@ -185,13 +185,13 @@ int ChainSilhouetteIterator::traverse(const AdjacencyIterator &ait)
result = newEdge;
}
else {
- result = 0;
+ result = nullptr;
}
return 0;
}
}
}
- result = 0;
+ result = nullptr;
return 0;
}
@@ -218,7 +218,7 @@ int ChainPredicateIterator::traverse(const AdjacencyIterator &ait)
}
++it;
}
- result = 0;
+ result = nullptr;
return 0;
}
diff --git a/source/blender/freestyle/intern/stroke/Curve.cpp b/source/blender/freestyle/intern/stroke/Curve.cpp
index 7129a35ffdb..95a6b2b3e57 100644
--- a/source/blender/freestyle/intern/stroke/Curve.cpp
+++ b/source/blender/freestyle/intern/stroke/Curve.cpp
@@ -40,8 +40,8 @@ namespace Freestyle {
CurvePoint::CurvePoint()
{
- __A = 0;
- __B = 0;
+ __A = nullptr;
+ __B = nullptr;
_t2d = 0;
}
@@ -50,11 +50,11 @@ CurvePoint::CurvePoint(SVertex *iA, SVertex *iB, float t)
__A = iA;
__B = iB;
_t2d = t;
- if ((iA == 0) && (t == 1.0f)) {
+ if ((iA == nullptr) && (t == 1.0f)) {
_Point2d = __B->point2d();
_Point3d = __B->point3d();
}
- else if ((iB == 0) && (t == 0.0f)) {
+ else if ((iB == nullptr) && (t == 0.0f)) {
_Point2d = __A->point2d();
_Point3d = __A->point3d();
}
@@ -66,17 +66,17 @@ CurvePoint::CurvePoint(SVertex *iA, SVertex *iB, float t)
CurvePoint::CurvePoint(CurvePoint *iA, CurvePoint *iB, float t3)
{
- __A = 0;
- __B = 0;
+ __A = nullptr;
+ __B = nullptr;
float t1 = iA->t2d();
float t2 = iB->t2d();
- if ((iA->A() == iB->A()) && (iA->B() == iB->B()) && (iA->A() != 0) && (iA->B() != 0) &&
- (iB->A() != 0) && (iB->B() != 0)) {
+ if ((iA->A() == iB->A()) && (iA->B() == iB->B()) && (iA->A() != nullptr) && (iA->B() != nullptr) &&
+ (iB->A() != nullptr) && (iB->B() != nullptr)) {
__A = iA->A();
__B = iB->B();
_t2d = t1 + t2 * t3 - t1 * t3;
}
- else if ((iA->B() == 0) && (iB->B() == 0)) {
+ else if ((iA->B() == nullptr) && (iB->B() == nullptr)) {
__A = iA->A();
__B = iB->A();
_t2d = t3;
@@ -133,15 +133,15 @@ CurvePoint::CurvePoint(CurvePoint *iA, CurvePoint *iB, float t3)
_t2d = t2 * t3;
}
}
- else if (iA->A() != 0 && iB->A() != 0 &&
+ else if (iA->A() != nullptr && iB->A() != nullptr &&
(iA->A()->point3d() - iB->A()->point3d()).norm() < 1.0e-6) {
goto iA_A_eq_iB_A;
}
- else if (iA->B() != 0 && iB->B() != 0 &&
+ else if (iA->B() != nullptr && iB->B() != nullptr &&
(iA->B()->point3d() - iB->B()->point3d()).norm() < 1.0e-6) {
goto iA_B_eq_iB_B;
}
- else if (iA->B() != 0 && iB->A() != 0 &&
+ else if (iA->B() != nullptr && iB->A() != nullptr &&
(iA->B()->point3d() - iB->A()->point3d()).norm() < 1.0e-6) {
goto iA_B_eq_iB_A;
}
@@ -162,7 +162,7 @@ CurvePoint::CurvePoint(CurvePoint *iA, CurvePoint *iB, float t3)
cerr << "Fatal error in CurvePoint::CurvePoint(CurvePoint *iA, CurvePoint *iB, float t3)"
<< endl;
}
- BLI_assert(__A != 0 && __B != 0);
+ BLI_assert(__A != nullptr && __B != nullptr);
#if 0
_Point2d = __A->point2d() + _t2d * (__B->point2d() - __A->point2d());
@@ -195,7 +195,7 @@ CurvePoint &CurvePoint::operator=(const CurvePoint &iBrother)
FEdge *CurvePoint::fedge()
{
if (getNature() & Nature::T_VERTEX) {
- return 0;
+ return nullptr;
}
return __A->fedge();
}
@@ -206,14 +206,14 @@ FEdge *CurvePoint::getFEdge(Interface0D &inter)
if (!iVertexB) {
cerr << "Warning: CurvePoint::getFEdge() failed to cast the given 0D element to CurvePoint."
<< endl;
- return 0;
+ return nullptr;
}
if (((__A == iVertexB->__A) && (__B == iVertexB->__B)) ||
((__A == iVertexB->__B) && (__B == iVertexB->__A))) {
return __A->getFEdge(*__B);
}
- if (__B == 0) {
- if (iVertexB->__B == 0) {
+ if (__B == nullptr) {
+ if (iVertexB->__B == nullptr) {
return __A->getFEdge(*(iVertexB->__A));
}
if (iVertexB->__A == __A) {
@@ -223,7 +223,7 @@ FEdge *CurvePoint::getFEdge(Interface0D &inter)
return __A->getFEdge(*(iVertexB->__A));
}
}
- if (iVertexB->__B == 0) {
+ if (iVertexB->__B == nullptr) {
if (iVertexB->__A == __A) {
return __B->getFEdge(*(iVertexB->__A));
}
@@ -284,15 +284,15 @@ FEdge *CurvePoint::getFEdge(Interface0D &inter)
#endif
cerr << "Warning: CurvePoint::getFEdge() failed." << endl;
- return NULL;
+ return nullptr;
}
Vec3r CurvePoint::normal() const
{
- if (__B == 0) {
+ if (__B == nullptr) {
return __A->normal();
}
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->normal();
}
Vec3r Na = __A->normal();
@@ -328,7 +328,7 @@ Id CurvePoint::shape_id() const
const SShape *CurvePoint::shape() const
{
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->shape();
}
return __A->shape();
@@ -357,10 +357,10 @@ const unsigned CurvePoint::qi() const
occluder_container::const_iterator CurvePoint::occluders_begin() const
{
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->occluders_begin();
}
- if (__B == 0) {
+ if (__B == nullptr) {
return __A->occluders_begin();
}
return __A->getFEdge(*__B)->occluders_begin();
@@ -368,10 +368,10 @@ occluder_container::const_iterator CurvePoint::occluders_begin() const
occluder_container::const_iterator CurvePoint::occluders_end() const
{
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->occluders_end();
}
- if (__B == 0) {
+ if (__B == nullptr) {
return __A->occluders_end();
}
return __A->getFEdge(*__B)->occluders_end();
@@ -379,10 +379,10 @@ occluder_container::const_iterator CurvePoint::occluders_end() const
bool CurvePoint::occluders_empty() const
{
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->occluders_empty();
}
- if (__B == 0) {
+ if (__B == nullptr) {
return __A->occluders_empty();
}
return __A->getFEdge(*__B)->occluders_empty();
@@ -390,10 +390,10 @@ bool CurvePoint::occluders_empty() const
int CurvePoint::occluders_size() const
{
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->occluders_size();
}
- if (__B == 0) {
+ if (__B == nullptr) {
return __A->occluders_size();
}
return __A->getFEdge(*__B)->occluders_size();
@@ -401,10 +401,10 @@ int CurvePoint::occluders_size() const
const SShape *CurvePoint::occluded_shape() const
{
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->occluded_shape();
}
- if (__B == 0) {
+ if (__B == nullptr) {
return __A->occluded_shape();
}
return __A->getFEdge(*__B)->occluded_shape();
@@ -412,10 +412,10 @@ const SShape *CurvePoint::occluded_shape() const
const Polygon3r &CurvePoint::occludee() const
{
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->occludee();
}
- if (__B == 0) {
+ if (__B == nullptr) {
return __A->occludee();
}
return __A->getFEdge(*__B)->occludee();
@@ -423,10 +423,10 @@ const Polygon3r &CurvePoint::occludee() const
bool CurvePoint::occludee_empty() const
{
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->occludee_empty();
}
- if (__B == 0) {
+ if (__B == nullptr) {
return __A->occludee_empty();
}
return __A->getFEdge(*__B)->occludee_empty();
@@ -434,13 +434,13 @@ bool CurvePoint::occludee_empty() const
real CurvePoint::z_discontinuity() const
{
- if (__A == 0) {
+ if (__A == nullptr) {
return __B->z_discontinuity();
}
- if (__B == 0) {
+ if (__B == nullptr) {
return __A->z_discontinuity();
}
- if (__A->getFEdge(*__B) == 0) {
+ if (__A->getFEdge(*__B) == nullptr) {
return 0.0;
}
diff --git a/source/blender/freestyle/intern/stroke/Operators.cpp b/source/blender/freestyle/intern/stroke/Operators.cpp
index 307122833e4..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)
@@ -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();
@@ -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 {
@@ -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);
diff --git a/source/blender/freestyle/intern/stroke/Stroke.cpp b/source/blender/freestyle/intern/stroke/Stroke.cpp
index 2e50465d5c0..79eb37ae870 100644
--- a/source/blender/freestyle/intern/stroke/Stroke.cpp
+++ b/source/blender/freestyle/intern/stroke/Stroke.cpp
@@ -47,9 +47,9 @@ StrokeAttribute::StrokeAttribute()
_color[i] = 0.2f;
}
_color[0] = 0.8f;
- _userAttributesReal = NULL;
- _userAttributesVec2f = NULL;
- _userAttributesVec3f = NULL;
+ _userAttributesReal = nullptr;
+ _userAttributesVec2f = nullptr;
+ _userAttributesVec3f = nullptr;
_visible = true;
}
@@ -66,19 +66,19 @@ StrokeAttribute::StrokeAttribute(const StrokeAttribute &iBrother)
_userAttributesReal = new realMap(*iBrother._userAttributesReal);
}
else {
- _userAttributesReal = NULL;
+ _userAttributesReal = nullptr;
}
if (iBrother._userAttributesVec2f) {
_userAttributesVec2f = new Vec2fMap(*iBrother._userAttributesVec2f);
}
else {
- _userAttributesVec2f = NULL;
+ _userAttributesVec2f = nullptr;
}
if (iBrother._userAttributesVec3f) {
_userAttributesVec3f = new Vec3fMap(*iBrother._userAttributesVec3f);
}
else {
- _userAttributesVec3f = NULL;
+ _userAttributesVec3f = nullptr;
}
}
@@ -100,9 +100,9 @@ StrokeAttribute::StrokeAttribute(float iRColor,
_visible = true;
- _userAttributesReal = NULL;
- _userAttributesVec2f = NULL;
- _userAttributesVec3f = NULL;
+ _userAttributesReal = nullptr;
+ _userAttributesVec2f = nullptr;
+ _userAttributesVec3f = nullptr;
}
StrokeAttribute::StrokeAttribute(const StrokeAttribute &a1, const StrokeAttribute &a2, float t)
@@ -129,7 +129,7 @@ StrokeAttribute::StrokeAttribute(const StrokeAttribute &a1, const StrokeAttribut
}
}
else {
- _userAttributesReal = NULL;
+ _userAttributesReal = nullptr;
}
if ((a1._userAttributesVec2f) && (a2._userAttributesVec2f)) {
if (a1._userAttributesVec2f->size() == a2._userAttributesVec2f->size()) {
@@ -143,7 +143,7 @@ StrokeAttribute::StrokeAttribute(const StrokeAttribute &a1, const StrokeAttribut
}
}
else {
- _userAttributesVec2f = NULL;
+ _userAttributesVec2f = nullptr;
}
if ((a1._userAttributesVec3f) && (a2._userAttributesVec3f)) {
if (a1._userAttributesVec3f->size() == a2._userAttributesVec3f->size()) {
@@ -157,7 +157,7 @@ StrokeAttribute::StrokeAttribute(const StrokeAttribute &a1, const StrokeAttribut
}
}
else {
- _userAttributesVec3f = NULL;
+ _userAttributesVec3f = nullptr;
}
}
@@ -194,7 +194,7 @@ StrokeAttribute &StrokeAttribute::operator=(const StrokeAttribute &iBrother)
_userAttributesReal = new realMap(*(iBrother._userAttributesReal));
}
else {
- _userAttributesReal = NULL;
+ _userAttributesReal = nullptr;
}
if (iBrother._userAttributesVec2f) {
if (!_userAttributesVec2f) {
@@ -203,7 +203,7 @@ StrokeAttribute &StrokeAttribute::operator=(const StrokeAttribute &iBrother)
_userAttributesVec2f = new Vec2fMap(*(iBrother._userAttributesVec2f));
}
else {
- _userAttributesVec2f = NULL;
+ _userAttributesVec2f = nullptr;
}
if (iBrother._userAttributesVec3f) {
if (!_userAttributesVec3f) {
@@ -212,7 +212,7 @@ StrokeAttribute &StrokeAttribute::operator=(const StrokeAttribute &iBrother)
_userAttributesVec3f = new Vec3fMap(*(iBrother._userAttributesVec3f));
}
else {
- _userAttributesVec3f = NULL;
+ _userAttributesVec3f = nullptr;
}
return *this;
}
@@ -355,7 +355,7 @@ StrokeVertex::StrokeVertex(const StrokeVertex &iBrother) : CurvePoint(iBrother)
_StrokeLength = 0.0f;
}
-StrokeVertex::StrokeVertex(SVertex *iSVertex) : CurvePoint(iSVertex, 0, 0.0f)
+StrokeVertex::StrokeVertex(SVertex *iSVertex) : CurvePoint(iSVertex, nullptr, 0.0f)
{
_CurvilignAbscissa = 0.0f;
_StrokeLength = 0.0f;
@@ -376,7 +376,7 @@ StrokeVertex::StrokeVertex(StrokeVertex *iA, StrokeVertex *iB, float t3) : Curve
}
StrokeVertex::StrokeVertex(SVertex *iSVertex, const StrokeAttribute &iAttribute)
- : CurvePoint(iSVertex, 0, 0.0f)
+ : CurvePoint(iSVertex, nullptr, 0.0f)
{
_Attribute = iAttribute;
_CurvilignAbscissa = 0.0f;
@@ -416,11 +416,11 @@ Stroke::Stroke()
_textureId = 0;
_textureStep = 1.0;
for (int a = 0; a < MAX_MTEX; a++) {
- _mtex[a] = NULL;
+ _mtex[a] = nullptr;
}
- _nodeTree = NULL;
+ _nodeTree = nullptr;
_tips = false;
- _rep = NULL;
+ _rep = nullptr;
}
Stroke::Stroke(const Stroke &iBrother) : Interface1D(iBrother)
@@ -447,7 +447,7 @@ Stroke::Stroke(const Stroke &iBrother) : Interface1D(iBrother)
_rep = new StrokeRep(*(iBrother._rep));
}
else {
- _rep = NULL;
+ _rep = nullptr;
}
}
@@ -464,7 +464,7 @@ Stroke::~Stroke()
_ViewEdges.clear();
if (_rep) {
delete _rep;
- _rep = NULL;
+ _rep = nullptr;
}
}
@@ -489,7 +489,7 @@ Stroke &Stroke::operator=(const Stroke &iBrother)
_rep = new StrokeRep(*(iBrother._rep));
}
else {
- _rep = NULL;
+ _rep = nullptr;
}
return *this;
}
@@ -550,7 +550,7 @@ int Stroke::Resample(int iNPoints)
vertex_container newVertices;
real t = 0.0f;
- StrokeVertex *newVertex = NULL;
+ StrokeVertex *newVertex = nullptr;
vector<StrokeSegment> strokeSegments;
int N = 0;
float meanlength = 0;
@@ -661,7 +661,7 @@ int Stroke::Resample(float iSampling)
vertex_container newVertices;
real t = 0.0f;
const real limit = 0.99;
- StrokeVertex *newVertex = NULL;
+ StrokeVertex *newVertex = nullptr;
StrokeInternal::StrokeVertexIterator it = strokeVerticesBegin();
StrokeInternal::StrokeVertexIterator next = it;
++next;
diff --git a/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp b/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
index 5b2beb8f068..a4268e43a56 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
@@ -35,7 +35,7 @@ namespace Freestyle {
/* */
/**********************************/
-TextureManager *StrokeRenderer::_textureManager = 0;
+TextureManager *StrokeRenderer::_textureManager = nullptr;
StrokeRenderer::StrokeRenderer()
{
@@ -59,7 +59,7 @@ bool StrokeRenderer::loadTextures()
/* */
/**********************************/
-TextureManager *TextureManager::_pInstance = 0;
+TextureManager *TextureManager::_pInstance = nullptr;
string TextureManager::_patterns_path;
@@ -77,7 +77,7 @@ TextureManager::~TextureManager()
if (!_brushesMap.empty()) {
_brushesMap.clear();
}
- _pInstance = 0;
+ _pInstance = nullptr;
}
void TextureManager::load()
diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
index 3678461253c..aadc42beb4b 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
@@ -563,8 +563,8 @@ void Strip::computeTexCoordWithTips(const vector<StrokeVertex *> &iStrokeVertice
float texStep)
{
vector<StrokeVertex *>::const_iterator v, vend;
- StrokeVertex *sv = NULL;
- StrokeVertexRep *tvRep[2] = {NULL};
+ StrokeVertex *sv = nullptr;
+ StrokeVertexRep *tvRep[2] = {nullptr};
float l, fact, t;
float u = 0, uPrev = 0;
@@ -750,13 +750,13 @@ void Strip::computeTexCoordWithTips(const vector<StrokeVertex *> &iStrokeVertice
StrokeRep::StrokeRep()
{
- _stroke = 0;
+ _stroke = nullptr;
_strokeType = Stroke::OPAQUE_MEDIUM;
- _nodeTree = NULL;
+ _nodeTree = nullptr;
_hasTex = false;
_textureStep = 1.0;
for (int a = 0; a < MAX_MTEX; a++) {
- _mtex[a] = NULL;
+ _mtex[a] = nullptr;
}
TextureManager *ptm = TextureManager::getInstance();
if (ptm) {
@@ -786,7 +786,7 @@ StrokeRep::StrokeRep(Stroke *iStroke)
_mtex[a] = iStroke->getMTex(a);
}
else {
- _mtex[a] = NULL;
+ _mtex[a] = nullptr;
}
}
if (_textureId == 0) {
@@ -822,7 +822,7 @@ StrokeRep::StrokeRep(const StrokeRep &iBrother)
_mtex[a] = iBrother._mtex[a];
}
else {
- _mtex[a] = NULL;
+ _mtex[a] = nullptr;
}
}
for (vector<Strip *>::const_iterator s = iBrother._strips.begin(), send = iBrother._strips.end();
diff --git a/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp b/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
index e9a50067d4d..d4ebaac2459 100644
--- a/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
@@ -30,8 +30,8 @@ namespace Freestyle {
LineRep *StrokeTesselator::Tesselate(Stroke *iStroke)
{
- if (0 == iStroke) {
- return 0;
+ if (nullptr == iStroke) {
+ return nullptr;
}
LineRep *line;