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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-04-09 04:46:49 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-04-09 04:46:49 +0400
commit800f86c8454ced85c29d1dcb04dcb163689a89d3 (patch)
tree4598a2ea78a1d1cf6a4c0a9e7030de4c826a006d /source/blender/freestyle/intern/stroke
parente6bd510dde6289efcead80e3d21cb21876282a56 (diff)
Attempt to fix a potential name conflict between Freestyle and the compositor.
A crash in the Freestyle renderer was reported by Ton on IRC with a stack trace below. Note that #2 is in Freestyle, whereas #1 is in the compositor. The problem was observed in a debug build on OS X 10.7 (gcc 4.2, openmp disabled, no llvm). ---------------------------------------------------------------------- Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 [Switching to process 72386 thread 0xf303] 0x0000000100c129f3 in NodeBase::~NodeBase (this=0x10e501c80) at COM_NodeBase.cpp:43 43 delete (this->m_outputsockets.back()); Current language: auto; currently c++ (gdb) where #0 0x0000000100c129f3 in NodeBase::~NodeBase (this=0x10e501c80) at COM_NodeBase.cpp:43 #1 0x0000000100c29066 in Node::~Node (this=0x10e501c80) at COM_Node.h:49 #2 0x000000010089c273 in NodeShape::~NodeShape (this=0x10e501c80) at NodeShape.cpp:43 #3 0x000000010089910b in NodeGroup::destroy (this=0x10e501da0) at NodeGroup.cpp:61 #4 0x00000001008990cd in NodeGroup::destroy (this=0x10e5014b0) at NodeGroup.cpp:59 #5 0x00000001008990cd in NodeGroup::destroy (this=0x114e18da0) at NodeGroup.cpp:59 #6 0x00000001007e6602 in Controller::ClearRootNode (this=0x114e19640) at Controller.cpp:329 #7 0x00000001007ea52e in Controller::LoadMesh (this=0x114e19640, re=0x10aba4638, srl=0x1140f5258) at Controller.cpp:302 #8 0x00000001008030ad in prepare (re=0x10aba4638, srl=0x1140f5258) at FRS_freestyle.cpp:302 #9 0x000000010080457a in FRS_do_stroke_rendering (re=0x10aba4638, srl=0x1140f5258) at FRS_freestyle.cpp:600 #10 0x00000001006aeb9d in add_freestyle (re=0x10aba4638) at pipeline.c:1584 #11 0x00000001006aceb7 in do_render_3d (re=0x10aba4638) at pipeline.c:1094 #12 0x00000001006ae061 in do_render_fields_blur_3d (re=0x10aba4638) at pipeline.c:1367 #13 0x00000001006afa16 in do_render_composite_fields_blur_3d (re=0x10aba4638) at pipeline.c:1815 #14 0x00000001006b04e4 in do_render_all_options (re=0x10aba4638) at pipeline.c:2021 ---------------------------------------------------------------------- Apparently a name conflict between the two Blender modules is taking place. The present commit hence intends to address it by putting all the Freestyle C++ classes in the namespace 'Freestyle'. This revision will also prevent potential name conflicts with other Blender modules in the future. Special thanks to Lukas Toenne for the help with C++ namespace.
Diffstat (limited to 'source/blender/freestyle/intern/stroke')
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedFunctions0D.h4
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h4
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedPredicates1D.h4
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h4
-rw-r--r--source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/BasicStrokeShaders.h5
-rw-r--r--source/blender/freestyle/intern/stroke/Canvas.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/Canvas.h4
-rw-r--r--source/blender/freestyle/intern/stroke/Chain.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/Chain.h4
-rw-r--r--source/blender/freestyle/intern/stroke/ChainingIterators.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/ChainingIterators.h4
-rw-r--r--source/blender/freestyle/intern/stroke/ContextFunctions.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/ContextFunctions.h4
-rw-r--r--source/blender/freestyle/intern/stroke/Curve.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/Curve.h5
-rw-r--r--source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h4
-rw-r--r--source/blender/freestyle/intern/stroke/CurveIterators.h4
-rw-r--r--source/blender/freestyle/intern/stroke/Modifiers.h4
-rw-r--r--source/blender/freestyle/intern/stroke/Module.h4
-rw-r--r--source/blender/freestyle/intern/stroke/Operators.cpp11
-rw-r--r--source/blender/freestyle/intern/stroke/Operators.h4
-rw-r--r--source/blender/freestyle/intern/stroke/PSStrokeRenderer.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/PSStrokeRenderer.h4
-rw-r--r--source/blender/freestyle/intern/stroke/Predicates0D.h4
-rw-r--r--source/blender/freestyle/intern/stroke/Predicates1D.h4
-rw-r--r--source/blender/freestyle/intern/stroke/QInformationMap.h4
-rw-r--r--source/blender/freestyle/intern/stroke/Stroke.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/Stroke.h3
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeAdvancedIterators.h4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeIO.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeIO.h4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeIterators.h4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeLayer.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeLayer.h4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRenderer.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRenderer.h4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRep.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRep.h4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeShader.h4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeTesselator.cpp4
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeTesselator.h4
-rw-r--r--source/blender/freestyle/intern/stroke/StyleModule.h4
-rw-r--r--source/blender/freestyle/intern/stroke/TextStrokeRenderer.cpp3
-rw-r--r--source/blender/freestyle/intern/stroke/TextStrokeRenderer.h5
48 files changed, 193 insertions, 7 deletions
diff --git a/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp b/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp
index 84ff1da6000..65de8471135 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp
+++ b/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp
@@ -32,6 +32,8 @@
#include "../view_map/Functions0D.h"
#include "../view_map/SteerableViewMap.h"
+namespace Freestyle {
+
namespace Functions0D {
int DensityF0D::operator()(Interface0DIterator& iter)
@@ -110,3 +112,5 @@ int GetViewMapGradientNormF0D::operator()(Interface0DIterator& iter)
}
} // end of namespace Functions0D
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.h b/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.h
index b8b5c37bfa2..f8204fb2c1c 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.h
+++ b/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.h
@@ -39,6 +39,8 @@
//
///////////////////////////////////////////////////////////
+namespace Freestyle {
+
namespace Functions0D {
// DensityF0D
@@ -219,4 +221,6 @@ public:
} // end of namespace Functions0D
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_ADVANCED_FUNCTIONS_0D_H__
diff --git a/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp b/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
index f7d8020531d..ed527080f36 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
+++ b/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
@@ -31,6 +31,8 @@
#include "../view_map/SteerableViewMap.h"
+namespace Freestyle {
+
// FIXME
namespace Functions1D {
@@ -129,3 +131,5 @@ int GetViewMapGradientNormF1D::operator()(Interface1D& inter)
}
} // Functions1D namespace
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h b/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
index e634206f007..48534439217 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
+++ b/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
@@ -38,6 +38,8 @@
//
///////////////////////////////////////////////////////////
+namespace Freestyle {
+
namespace Functions1D {
// DensityF1D
@@ -288,4 +290,6 @@ public:
} // end of namespace Functions1D
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_ADVANCED_FUNCTIONS_1D_H__
diff --git a/source/blender/freestyle/intern/stroke/AdvancedPredicates1D.h b/source/blender/freestyle/intern/stroke/AdvancedPredicates1D.h
index f08a4095469..f650e32b278 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedPredicates1D.h
+++ b/source/blender/freestyle/intern/stroke/AdvancedPredicates1D.h
@@ -40,6 +40,8 @@
//
///////////////////////////////////////////////////////////
+namespace Freestyle {
+
namespace Predicates1D {
// DensityLowerThanUP1D
@@ -85,4 +87,6 @@ private:
} // end of namespace Predicates1D
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_ADVANCED_PREDICATES_1D_H__
diff --git a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
index 6880f62be07..00d0171f80b 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
+++ b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
@@ -31,6 +31,8 @@
#include "../system/PseudoNoise.h"
#include "../system/RandGen.h"
+namespace Freestyle {
+
/////////////////////////////////////////
//
// CALLIGRAPHICS SHADER
@@ -395,3 +397,5 @@ void Omitter::omit(real sizeWindow, real thrVari, real thrFlat, real lFlat)
}
#endif
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
index f59dddb5f57..3cb8e11491e 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
+++ b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
@@ -30,6 +30,8 @@
#include "BasicStrokeShaders.h"
+namespace Freestyle {
+
/*! [ Thickness Shader ].
* Assigns thicknesses to the stroke vertices so that the stroke looks like made with a calligraphic tool.
* i.e. The stroke will be the thickest in a main direction, the thinest in the direction perpendicular to this one,
@@ -216,4 +218,6 @@ protected:
real _lengthFlat;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_ADVANCED_STROKE_SHADERS_H__
diff --git a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
index 5e6738639aa..c507f137f4c 100644
--- a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
+++ b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
@@ -51,6 +51,8 @@ extern "C" {
# include "IMB_imbuf_types.h"
}
+namespace Freestyle {
+
// Internal function
#if 0 // soc
@@ -1128,3 +1130,5 @@ int fstreamShader::shade(Stroke& stroke) const
}
} // end of namespace StrokeShaders
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.h b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.h
index e02408cb1b7..10c7563b82c 100644
--- a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.h
+++ b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.h
@@ -37,6 +37,9 @@
#include "../geometry/Geom.h"
using namespace std;
+
+namespace Freestyle {
+
using namespace Geometry;
namespace StrokeShaders {
@@ -892,4 +895,6 @@ public:
} // end of namespace StrokeShaders
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_BASIC_STROKE_SHADERS_H__
diff --git a/source/blender/freestyle/intern/stroke/Canvas.cpp b/source/blender/freestyle/intern/stroke/Canvas.cpp
index 7953e4a718c..09c8d9ed74e 100644
--- a/source/blender/freestyle/intern/stroke/Canvas.cpp
+++ b/source/blender/freestyle/intern/stroke/Canvas.cpp
@@ -54,6 +54,8 @@ extern "C" {
using namespace std;
+namespace Freestyle {
+
LIB_STROKE_EXPORT
Canvas *Canvas::_pInstance = 0;
@@ -466,3 +468,5 @@ float Canvas::readMapPixel(const char *iMapName, int level, int x, int y)
return pyramid->pixel(x, height() - 1 - y, level);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/Canvas.h b/source/blender/freestyle/intern/stroke/Canvas.h
index 81ded0effd7..dc752f1c94d 100644
--- a/source/blender/freestyle/intern/stroke/Canvas.h
+++ b/source/blender/freestyle/intern/stroke/Canvas.h
@@ -40,6 +40,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
using namespace Geometry;
struct ltstr
@@ -239,4 +241,6 @@ public:
void setModified(unsigned index, bool b);
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CANVAS_H__
diff --git a/source/blender/freestyle/intern/stroke/Chain.cpp b/source/blender/freestyle/intern/stroke/Chain.cpp
index c319a006d32..c09ccbd393a 100644
--- a/source/blender/freestyle/intern/stroke/Chain.cpp
+++ b/source/blender/freestyle/intern/stroke/Chain.cpp
@@ -30,6 +30,8 @@
#include "../view_map/ViewMapAdvancedIterators.h"
#include "../view_map/ViewMapIterators.h"
+namespace Freestyle {
+
void Chain::push_viewedge_back(ViewEdge *iViewEdge, bool orientation)
{
ViewEdge::vertex_iterator v;
@@ -147,3 +149,5 @@ void Chain::push_viewedge_front(ViewEdge *iViewEdge, bool orientation)
if (!_fedgeB)
_fedgeB = (orientation) ? iViewEdge->fedgeB() : iViewEdge->fedgeA();
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/Chain.h b/source/blender/freestyle/intern/stroke/Chain.h
index 35aafd6014b..95e825e270b 100644
--- a/source/blender/freestyle/intern/stroke/Chain.h
+++ b/source/blender/freestyle/intern/stroke/Chain.h
@@ -32,6 +32,8 @@
#include "../view_map/ViewMap.h"
+namespace Freestyle {
+
/*! Class to represent a 1D elements issued from the chaining process.
* A Chain is the last step before the Stroke and is used in the Splitting and Creation processes.
*/
@@ -106,4 +108,6 @@ public:
}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CHAIN_H__
diff --git a/source/blender/freestyle/intern/stroke/ChainingIterators.cpp b/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
index fa06bc2e730..4408f5cd796 100644
--- a/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
+++ b/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
@@ -29,6 +29,8 @@
#include "../system/TimeStamp.h"
+namespace Freestyle {
+
ViewEdge *AdjacencyIterator::operator*()
{
return (*_internalIterator).first;
@@ -193,3 +195,5 @@ int ChainPredicateIterator::traverse(const AdjacencyIterator& ait)
result = 0;
return 0;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/ChainingIterators.h b/source/blender/freestyle/intern/stroke/ChainingIterators.h
index 54557bf4e29..8d01cea84e7 100644
--- a/source/blender/freestyle/intern/stroke/ChainingIterators.h
+++ b/source/blender/freestyle/intern/stroke/ChainingIterators.h
@@ -42,6 +42,8 @@
//using namespace ViewEdgeInternal;
+namespace Freestyle {
+
//
// Adjacency iterator used in the chaining process
//
@@ -397,4 +399,6 @@ public:
}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CHAINING_ITERATORS_H__
diff --git a/source/blender/freestyle/intern/stroke/ContextFunctions.cpp b/source/blender/freestyle/intern/stroke/ContextFunctions.cpp
index 6893cd28eb6..42d27a0e5c3 100644
--- a/source/blender/freestyle/intern/stroke/ContextFunctions.cpp
+++ b/source/blender/freestyle/intern/stroke/ContextFunctions.cpp
@@ -32,6 +32,8 @@
#include "../system/TimeStamp.h"
+namespace Freestyle {
+
namespace ContextFunctions {
unsigned GetTimeStampCF()
@@ -78,3 +80,5 @@ FEdge *GetSelectedFEdgeCF()
}
} // ContextFunctions namespace
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/ContextFunctions.h b/source/blender/freestyle/intern/stroke/ContextFunctions.h
index 453329e83a8..5c0b88fd412 100644
--- a/source/blender/freestyle/intern/stroke/ContextFunctions.h
+++ b/source/blender/freestyle/intern/stroke/ContextFunctions.h
@@ -34,6 +34,8 @@
#include "../image/GaussianFilter.h"
#include "../image/Image.h"
+namespace Freestyle {
+
//
// Context Functions definitions
//
@@ -110,4 +112,6 @@ FEdge *GetSelectedFEdgeCF();
} // end of namespace ContextFunctions
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CONTEXT_FUNCTIONS_H__
diff --git a/source/blender/freestyle/intern/stroke/Curve.cpp b/source/blender/freestyle/intern/stroke/Curve.cpp
index 6a945eb664d..b7bbe533a19 100644
--- a/source/blender/freestyle/intern/stroke/Curve.cpp
+++ b/source/blender/freestyle/intern/stroke/Curve.cpp
@@ -31,6 +31,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -923,3 +925,5 @@ void Curve::computeCurvatureAndOrientation ()
}
#endif
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/Curve.h b/source/blender/freestyle/intern/stroke/Curve.h
index a88792a75ee..7e09a482e4c 100644
--- a/source/blender/freestyle/intern/stroke/Curve.h
+++ b/source/blender/freestyle/intern/stroke/Curve.h
@@ -42,6 +42,9 @@
#include "../system/BaseIterator.h"
using namespace std;
+
+namespace Freestyle {
+
using namespace Geometry;
/**********************************/
@@ -579,4 +582,6 @@ public:
virtual Interface0DIterator pointsEnd(float t = 0.0f);
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CURVE_H__
diff --git a/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h b/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h
index 1f2199a525a..956842580c5 100644
--- a/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h
+++ b/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h
@@ -30,6 +30,8 @@
#include "Stroke.h"
+namespace Freestyle {
+
namespace CurveInternal {
class CurvePoint_const_traits : public Const_traits<CurvePoint*>
@@ -373,4 +375,6 @@ protected:
} // end of namespace CurveInternal
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CURVE_ADVANCED_ITERATORS_H__
diff --git a/source/blender/freestyle/intern/stroke/CurveIterators.h b/source/blender/freestyle/intern/stroke/CurveIterators.h
index 9d48310a00b..f2272f2f9a9 100644
--- a/source/blender/freestyle/intern/stroke/CurveIterators.h
+++ b/source/blender/freestyle/intern/stroke/CurveIterators.h
@@ -31,6 +31,8 @@
#include "Curve.h"
#include "Stroke.h"
+namespace Freestyle {
+
namespace CurveInternal {
/*! iterator on a curve. Allows an iterating outside
@@ -292,4 +294,6 @@ public:
} // end of namespace CurveInternal
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CURVE_ITERATORS_H__
diff --git a/source/blender/freestyle/intern/stroke/Modifiers.h b/source/blender/freestyle/intern/stroke/Modifiers.h
index 02f5334ef87..ea386a5cbda 100644
--- a/source/blender/freestyle/intern/stroke/Modifiers.h
+++ b/source/blender/freestyle/intern/stroke/Modifiers.h
@@ -30,6 +30,8 @@
#include "TimeStamp.h"
+namespace Freestyle {
+
/* ----------------------------------------- *
* *
* modifiers *
@@ -64,4 +66,6 @@ struct TimestampModifier : public EdgeModifier<Edge>
}
};
+} /* namespace Freestyle */
+
#endif // MODIFIERS_H
diff --git a/source/blender/freestyle/intern/stroke/Module.h b/source/blender/freestyle/intern/stroke/Module.h
index ca59f1a228f..e575892e635 100644
--- a/source/blender/freestyle/intern/stroke/Module.h
+++ b/source/blender/freestyle/intern/stroke/Module.h
@@ -31,6 +31,8 @@
#include "Canvas.h"
#include "StyleModule.h"
+namespace Freestyle {
+
class Module
{
public:
@@ -72,4 +74,6 @@ private:
}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_MODULE_H__
diff --git a/source/blender/freestyle/intern/stroke/Operators.cpp b/source/blender/freestyle/intern/stroke/Operators.cpp
index 7ca3e5c1496..1ad8901fa7b 100644
--- a/source/blender/freestyle/intern/stroke/Operators.cpp
+++ b/source/blender/freestyle/intern/stroke/Operators.cpp
@@ -32,9 +32,12 @@
#include "Operators.h"
#include "Canvas.h"
#include "Stroke.h"
+#include "CurveIterators.h"
#include "BKE_global.h"
+namespace Freestyle {
+
LIB_STROKE_EXPORT Operators::I1DContainer Operators::_current_view_edges_set;
LIB_STROKE_EXPORT Operators::I1DContainer Operators::_current_chains_set;
LIB_STROKE_EXPORT Operators::I1DContainer *Operators::_current_set = NULL;
@@ -79,7 +82,6 @@ int Operators::select(UnaryPredicate1D& pred)
return 0;
}
-
int Operators::chain(ViewEdgeInternal::ViewEdgeIterator& it, UnaryPredicate1D& pred, UnaryFunction1D_void& modifier)
{
if (_current_view_edges_set.empty())
@@ -140,7 +142,6 @@ error:
return -1;
}
-
int Operators::chain(ViewEdgeInternal::ViewEdgeIterator& it, UnaryPredicate1D& pred)
{
if (_current_view_edges_set.empty())
@@ -659,8 +660,6 @@ error:
return -1;
}
-#include "CurveIterators.h"
-
// Internal function
static int __recursiveSplit(Chain *_curve, UnaryFunction0D<double>& func, UnaryPredicate1D& pred, float sampling,
Operators::I1DContainer& newChains, Operators::I1DContainer& splitted_chains)
@@ -814,7 +813,6 @@ int Operators::recursiveSplit(UnaryFunction0D<double>& func, UnaryPredicate1D& p
return 0;
}
-
// recursive split with pred 0D
static int __recursiveSplit(Chain *_curve, UnaryFunction0D<double>& func, UnaryPredicate0D& pred0d,
UnaryPredicate1D& pred, float sampling,
@@ -1205,7 +1203,6 @@ inline int applyShading(Stroke& stroke, vector<StrokeShader*>& shaders)
return 0;
}
-
int Operators::create(UnaryPredicate1D& pred, vector<StrokeShader*> shaders)
{
//Canvas* canvas = Canvas::getInstance();
@@ -1272,3 +1269,5 @@ void Operators::reset()
_current_set = &_current_view_edges_set;
_current_strokes_set.clear();
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/Operators.h b/source/blender/freestyle/intern/stroke/Operators.h
index 1233e4e3e4f..7cff86eafce 100644
--- a/source/blender/freestyle/intern/stroke/Operators.h
+++ b/source/blender/freestyle/intern/stroke/Operators.h
@@ -43,6 +43,8 @@
#include "../view_map/Interface1D.h"
#include "../view_map/ViewMap.h"
+namespace Freestyle {
+
/*! Class defining the operators used in a style module.
* There are 4 classes of operators: Selection, Chaining, Splitting and Creating. All these operators are
* user controlled in the scripting language through Functors, Predicates and Shaders that are taken as arguments.
@@ -264,4 +266,6 @@ private:
static StrokesContainer _current_strokes_set;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_OPERATORS_H__
diff --git a/source/blender/freestyle/intern/stroke/PSStrokeRenderer.cpp b/source/blender/freestyle/intern/stroke/PSStrokeRenderer.cpp
index 9ae6ce11755..edfa3007ea6 100644
--- a/source/blender/freestyle/intern/stroke/PSStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/stroke/PSStrokeRenderer.cpp
@@ -28,6 +28,8 @@
#include "Canvas.h"
#include "PSStrokeRenderer.h"
+namespace Freestyle {
+
PSStrokeRenderer::PSStrokeRenderer(const char *iFileName) : StrokeRenderer()
{
if (!iFileName)
@@ -97,3 +99,5 @@ void PSStrokeRenderer::Close()
if (_ofstream.is_open())
_ofstream.close();
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/PSStrokeRenderer.h b/source/blender/freestyle/intern/stroke/PSStrokeRenderer.h
index d90b91ac19d..7958fbb311b 100644
--- a/source/blender/freestyle/intern/stroke/PSStrokeRenderer.h
+++ b/source/blender/freestyle/intern/stroke/PSStrokeRenderer.h
@@ -34,6 +34,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -59,4 +61,6 @@ protected:
mutable ofstream _ofstream;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_PS_STROKE_RENDERER_H__
diff --git a/source/blender/freestyle/intern/stroke/Predicates0D.h b/source/blender/freestyle/intern/stroke/Predicates0D.h
index 818b4d99716..6a24740f386 100644
--- a/source/blender/freestyle/intern/stroke/Predicates0D.h
+++ b/source/blender/freestyle/intern/stroke/Predicates0D.h
@@ -33,6 +33,8 @@
#include "../view_map/Functions0D.h"
+namespace Freestyle {
+
//
// UnaryPredicate0D (base class for predicates in 0D)
//
@@ -176,4 +178,6 @@ public:
} // end of namespace Predicates0D
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_PREDICATES_0D_H__
diff --git a/source/blender/freestyle/intern/stroke/Predicates1D.h b/source/blender/freestyle/intern/stroke/Predicates1D.h
index 70cd22507d0..54c04f6b71e 100644
--- a/source/blender/freestyle/intern/stroke/Predicates1D.h
+++ b/source/blender/freestyle/intern/stroke/Predicates1D.h
@@ -40,6 +40,8 @@
#include "../view_map/Interface1D.h"
#include "../view_map/Functions1D.h"
+namespace Freestyle {
+
//
// UnaryPredicate1D (base class for predicates in 1D)
//
@@ -578,4 +580,6 @@ public:
} // end of namespace Predicates1D
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_PREDICATES_1D_H__
diff --git a/source/blender/freestyle/intern/stroke/QInformationMap.h b/source/blender/freestyle/intern/stroke/QInformationMap.h
index a0a946a2343..827b408ed8a 100644
--- a/source/blender/freestyle/intern/stroke/QInformationMap.h
+++ b/source/blender/freestyle/intern/stroke/QInformationMap.h
@@ -32,6 +32,8 @@
#include "InformationMap.h"
+namespace Freestyle {
+
class QInformationMap : public InformationMap
{
private:
@@ -63,4 +65,6 @@ protected:
virtual float computeGaussian(int x, int y);
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_Q_INFORMATION_MAP_H__
diff --git a/source/blender/freestyle/intern/stroke/Stroke.cpp b/source/blender/freestyle/intern/stroke/Stroke.cpp
index aae131e8da8..a0b75241066 100644
--- a/source/blender/freestyle/intern/stroke/Stroke.cpp
+++ b/source/blender/freestyle/intern/stroke/Stroke.cpp
@@ -32,6 +32,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -945,3 +947,5 @@ real Stroke::local_average_density(float sigma , int iCombination ) const
return density_edge_function<Stroke>(*this, iCombination);
}
#endif
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/Stroke.h b/source/blender/freestyle/intern/stroke/Stroke.h
index 5e728aeaed1..a8291eb783d 100644
--- a/source/blender/freestyle/intern/stroke/Stroke.h
+++ b/source/blender/freestyle/intern/stroke/Stroke.h
@@ -39,6 +39,7 @@
#include "../system/FreestyleConfig.h"
#include "../system/StringUtils.h"
+namespace Freestyle {
//
// StrokeAttribute
@@ -812,4 +813,6 @@ Stroke::Stroke(InputVertexIterator iBegin, InputVertexIterator iEnd)
_id = 0;
}
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STROKE_H__
diff --git a/source/blender/freestyle/intern/stroke/StrokeAdvancedIterators.h b/source/blender/freestyle/intern/stroke/StrokeAdvancedIterators.h
index 9dfcc191c44..eb6b0a70c28 100644
--- a/source/blender/freestyle/intern/stroke/StrokeAdvancedIterators.h
+++ b/source/blender/freestyle/intern/stroke/StrokeAdvancedIterators.h
@@ -31,6 +31,8 @@
#include "Stroke.h"
+namespace Freestyle {
+
namespace StrokeInternal {
class vertex_const_traits : public Const_traits<StrokeVertex*>
@@ -181,4 +183,6 @@ public:
} // end of namespace StrokeInternal
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STROKE_ADVANCED_ITERATORS_H__
diff --git a/source/blender/freestyle/intern/stroke/StrokeIO.cpp b/source/blender/freestyle/intern/stroke/StrokeIO.cpp
index 252b7ef1664..0360b7bba4a 100644
--- a/source/blender/freestyle/intern/stroke/StrokeIO.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeIO.cpp
@@ -29,6 +29,8 @@
#include "StrokeIO.h"
+namespace Freestyle {
+
ostream& operator<<(ostream& out, const StrokeAttribute& iStrokeAttribute)
{
out << " StrokeAttribute" << endl;
@@ -68,3 +70,5 @@ ostream& operator<<(ostream& out, const Stroke& iStroke)
}
return out;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/StrokeIO.h b/source/blender/freestyle/intern/stroke/StrokeIO.h
index ef031b7b471..daaf6239987 100644
--- a/source/blender/freestyle/intern/stroke/StrokeIO.h
+++ b/source/blender/freestyle/intern/stroke/StrokeIO.h
@@ -34,6 +34,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
LIB_STROKE_EXPORT
ostream& operator<<(ostream& out, const StrokeAttribute& iStrokeAttribute);
@@ -43,4 +45,6 @@ ostream& operator<<(ostream& out, const StrokeVertex& iStrokeVertex);
LIB_STROKE_EXPORT
ostream& operator<<(ostream& out, const Stroke& iStroke);
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STROKE_IO_H__
diff --git a/source/blender/freestyle/intern/stroke/StrokeIterators.h b/source/blender/freestyle/intern/stroke/StrokeIterators.h
index ed28f8ace17..2f9691be7dd 100644
--- a/source/blender/freestyle/intern/stroke/StrokeIterators.h
+++ b/source/blender/freestyle/intern/stroke/StrokeIterators.h
@@ -30,6 +30,8 @@
#include "Stroke.h"
+namespace Freestyle {
+
namespace StrokeInternal {
//
@@ -219,4 +221,6 @@ private:
} // end of namespace StrokeInternal
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STROKE_ITERATORS_H__
diff --git a/source/blender/freestyle/intern/stroke/StrokeLayer.cpp b/source/blender/freestyle/intern/stroke/StrokeLayer.cpp
index a0bd81775db..67552d6ebf2 100644
--- a/source/blender/freestyle/intern/stroke/StrokeLayer.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeLayer.cpp
@@ -29,6 +29,8 @@
#include "Stroke.h"
#include "StrokeLayer.h"
+namespace Freestyle {
+
StrokeLayer::~StrokeLayer()
{
clear();
@@ -61,3 +63,5 @@ void StrokeLayer::clear()
delete *s;
_strokes.clear();
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/StrokeLayer.h b/source/blender/freestyle/intern/stroke/StrokeLayer.h
index 119e03a3ec6..ff36c40fd0a 100644
--- a/source/blender/freestyle/intern/stroke/StrokeLayer.h
+++ b/source/blender/freestyle/intern/stroke/StrokeLayer.h
@@ -30,6 +30,8 @@
#include <deque>
+namespace Freestyle {
+
class Stroke;
class StrokeRenderer;
class StrokeLayer
@@ -96,4 +98,6 @@ public:
}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STROKE_LAYER_H__
diff --git a/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp b/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
index 64a578ad6d3..f9d7413e2f9 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
@@ -31,6 +31,8 @@
using namespace std;
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -129,3 +131,5 @@ string TextureManager::Options::getBrushesPath()
{
return _brushes_path;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/StrokeRenderer.h b/source/blender/freestyle/intern/stroke/StrokeRenderer.h
index 4f550656b02..5ee1eaf17eb 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRenderer.h
+++ b/source/blender/freestyle/intern/stroke/StrokeRenderer.h
@@ -38,6 +38,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -135,4 +137,6 @@ public:
static TextureManager *_textureManager;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STROKE_RENDERER_H__
diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
index 1447c69d24c..42fd9660b08 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
@@ -33,6 +33,8 @@
using namespace std;
+namespace Freestyle {
+
//
// STROKE VERTEX REP
/////////////////////////////////////
@@ -780,3 +782,5 @@ void StrokeRep::Render(const StrokeRenderer *iRenderer)
{
iRenderer->RenderStrokeRep(this);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.h b/source/blender/freestyle/intern/stroke/StrokeRep.h
index 8470e5eeae5..bc6d7e67a68 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRep.h
+++ b/source/blender/freestyle/intern/stroke/StrokeRep.h
@@ -32,6 +32,8 @@
#include "../geometry/Geom.h"
+namespace Freestyle {
+
using namespace Geometry;
#if 0
@@ -207,4 +209,6 @@ public:
}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STROKE_REP_H__
diff --git a/source/blender/freestyle/intern/stroke/StrokeShader.h b/source/blender/freestyle/intern/stroke/StrokeShader.h
index 139f5fd6325..d0cf3b8066b 100644
--- a/source/blender/freestyle/intern/stroke/StrokeShader.h
+++ b/source/blender/freestyle/intern/stroke/StrokeShader.h
@@ -34,6 +34,8 @@
#include "../python/Director.h"
+namespace Freestyle {
+
//
// StrokeShader base class
//
@@ -97,4 +99,6 @@ public:
}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STROKE_SHADERS_H__
diff --git a/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp b/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
index 7839e6ee253..443e14bd0f3 100644
--- a/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
@@ -32,6 +32,8 @@
#include "../scene_graph/NodeGroup.h"
#include "../scene_graph/NodeShape.h"
+namespace Freestyle {
+
LineRep *StrokeTesselator::Tesselate(Stroke *iStroke)
{
if (0 == iStroke)
@@ -85,3 +87,5 @@ NodeGroup *StrokeTesselator::Tesselate(StrokeVertexIterator begin, StrokeVertexI
return group;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/StrokeTesselator.h b/source/blender/freestyle/intern/stroke/StrokeTesselator.h
index 309ceefb000..b9020b9b35e 100644
--- a/source/blender/freestyle/intern/stroke/StrokeTesselator.h
+++ b/source/blender/freestyle/intern/stroke/StrokeTesselator.h
@@ -32,6 +32,8 @@
#include "../scene_graph/LineRep.h"
+namespace Freestyle {
+
class StrokeTesselator
{
public:
@@ -68,4 +70,6 @@ private:
bool _overloadFrsMaterial;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STROKE_TESSELATOR_H__
diff --git a/source/blender/freestyle/intern/stroke/StyleModule.h b/source/blender/freestyle/intern/stroke/StyleModule.h
index c8ccdf51ea0..336a3251a60 100644
--- a/source/blender/freestyle/intern/stroke/StyleModule.h
+++ b/source/blender/freestyle/intern/stroke/StyleModule.h
@@ -41,6 +41,8 @@
using namespace std;
+namespace Freestyle {
+
class StyleModule
{
public:
@@ -174,4 +176,6 @@ protected:
Interpreter *_inter;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STYLE_MODULE_H__
diff --git a/source/blender/freestyle/intern/stroke/TextStrokeRenderer.cpp b/source/blender/freestyle/intern/stroke/TextStrokeRenderer.cpp
index 37583660dd2..9d7cb051fdf 100644
--- a/source/blender/freestyle/intern/stroke/TextStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/stroke/TextStrokeRenderer.cpp
@@ -23,6 +23,8 @@
# include "Canvas.h"
# include "StrokeIterators.h"
+namespace Freestyle {
+
TextStrokeRenderer::TextStrokeRenderer(const char *iFileName)
:StrokeRenderer()
{
@@ -77,3 +79,4 @@ void TextStrokeRenderer::Close()
_ofstream.close();
}
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/stroke/TextStrokeRenderer.h b/source/blender/freestyle/intern/stroke/TextStrokeRenderer.h
index 144724f26f8..cd56f9d54e3 100644
--- a/source/blender/freestyle/intern/stroke/TextStrokeRenderer.h
+++ b/source/blender/freestyle/intern/stroke/TextStrokeRenderer.h
@@ -39,6 +39,8 @@
# include "../system/FreestyleConfig.h"
# include <fstream>
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -64,5 +66,6 @@ protected:
mutable ofstream _ofstream;
};
-#endif // TEXTSTROKERENDERER_H
+} /* namespace Freestyle */
+#endif // TEXTSTROKERENDERER_H