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
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')
-rw-r--r--source/blender/freestyle/intern/application/AppCanvas.cpp5
-rw-r--r--source/blender/freestyle/intern/application/AppCanvas.h4
-rw-r--r--source/blender/freestyle/intern/application/AppConfig.cpp4
-rw-r--r--source/blender/freestyle/intern/application/AppConfig.h4
-rw-r--r--source/blender/freestyle/intern/application/AppView.cpp4
-rw-r--r--source/blender/freestyle/intern/application/AppView.h4
-rw-r--r--source/blender/freestyle/intern/application/Controller.cpp12
-rw-r--r--source/blender/freestyle/intern/application/Controller.h21
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp4
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h10
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp4
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h11
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h4
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp4
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderTextureManager.h4
-rw-r--r--source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp1
-rw-r--r--source/blender/freestyle/intern/geometry/BBox.h4
-rw-r--r--source/blender/freestyle/intern/geometry/Bezier.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/Bezier.h4
-rw-r--r--source/blender/freestyle/intern/geometry/FastGrid.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/FastGrid.h4
-rw-r--r--source/blender/freestyle/intern/geometry/FitCurve.cpp19
-rw-r--r--source/blender/freestyle/intern/geometry/FitCurve.h4
-rw-r--r--source/blender/freestyle/intern/geometry/Geom.h4
-rw-r--r--source/blender/freestyle/intern/geometry/GeomCleaner.cpp3
-rw-r--r--source/blender/freestyle/intern/geometry/GeomCleaner.h4
-rw-r--r--source/blender/freestyle/intern/geometry/GeomUtils.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/GeomUtils.h5
-rw-r--r--source/blender/freestyle/intern/geometry/Grid.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/Grid.h5
-rw-r--r--source/blender/freestyle/intern/geometry/GridHelpers.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/GridHelpers.h4
-rw-r--r--source/blender/freestyle/intern/geometry/HashGrid.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/HashGrid.h4
-rw-r--r--source/blender/freestyle/intern/geometry/Noise.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/Noise.h7
-rw-r--r--source/blender/freestyle/intern/geometry/Polygon.h4
-rw-r--r--source/blender/freestyle/intern/geometry/SweepLine.h4
-rw-r--r--source/blender/freestyle/intern/geometry/VecMat.h4
-rw-r--r--source/blender/freestyle/intern/geometry/matrix_util.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/matrix_util.h4
-rw-r--r--source/blender/freestyle/intern/geometry/normal_cycle.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/normal_cycle.h4
-rw-r--r--source/blender/freestyle/intern/image/GaussianFilter.cpp4
-rw-r--r--source/blender/freestyle/intern/image/GaussianFilter.h10
-rw-r--r--source/blender/freestyle/intern/image/Image.h4
-rw-r--r--source/blender/freestyle/intern/image/ImagePyramid.cpp4
-rw-r--r--source/blender/freestyle/intern/image/ImagePyramid.h4
-rw-r--r--source/blender/freestyle/intern/python/BPy_BBox.h4
-rw-r--r--source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Convert.h4
-rw-r--r--source/blender/freestyle/intern/python/BPy_FrsMaterial.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_FrsNoise.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Id.h3
-rw-r--r--source/blender/freestyle/intern/python/BPy_IntegrationType.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Interface0D.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Interface1D.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Iterator.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_MediumType.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Nature.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Operators.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_SShape.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_StrokeAttribute.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_StrokeShader.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_UnaryFunction0D.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_UnaryFunction1D.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_ViewMap.h2
-rw-r--r--source/blender/freestyle/intern/python/BPy_ViewShape.h2
-rw-r--r--source/blender/freestyle/intern/python/Director.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/DrawingStyle.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/FrsMaterial.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/LineRep.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/LineRep.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/Node.h5
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeCamera.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeCamera.h3
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeGroup.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeGroup.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeLight.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeLight.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeShape.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeShape.h5
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeTransform.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeTransform.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/OrientedLineRep.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/OrientedLineRep.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/Rep.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/SceneVisitor.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/TriangleRep.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/TriangleRep.h4
-rw-r--r--source/blender/freestyle/intern/scene_graph/VertexRep.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/VertexRep.h4
-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
-rw-r--r--source/blender/freestyle/intern/system/BaseIterator.h4
-rw-r--r--source/blender/freestyle/intern/system/BaseObject.h4
-rw-r--r--source/blender/freestyle/intern/system/Cast.h4
-rw-r--r--source/blender/freestyle/intern/system/Exception.cpp4
-rw-r--r--source/blender/freestyle/intern/system/Exception.h4
-rw-r--r--source/blender/freestyle/intern/system/FreestyleConfig.h4
-rw-r--r--source/blender/freestyle/intern/system/Id.h4
-rw-r--r--source/blender/freestyle/intern/system/Interpreter.h4
-rw-r--r--source/blender/freestyle/intern/system/Iterator.h4
-rw-r--r--source/blender/freestyle/intern/system/PointerSequence.h4
-rw-r--r--source/blender/freestyle/intern/system/Precision.h4
-rw-r--r--source/blender/freestyle/intern/system/ProgressBar.h4
-rw-r--r--source/blender/freestyle/intern/system/PseudoNoise.cpp4
-rw-r--r--source/blender/freestyle/intern/system/PseudoNoise.h4
-rw-r--r--source/blender/freestyle/intern/system/PythonInterpreter.cpp4
-rw-r--r--source/blender/freestyle/intern/system/PythonInterpreter.h6
-rw-r--r--source/blender/freestyle/intern/system/RandGen.cpp4
-rw-r--r--source/blender/freestyle/intern/system/RandGen.h4
-rw-r--r--source/blender/freestyle/intern/system/RenderMonitor.h6
-rw-r--r--source/blender/freestyle/intern/system/StringUtils.cpp4
-rw-r--r--source/blender/freestyle/intern/system/StringUtils.h4
-rw-r--r--source/blender/freestyle/intern/system/TimeStamp.cpp4
-rw-r--r--source/blender/freestyle/intern/system/TimeStamp.h4
-rw-r--r--source/blender/freestyle/intern/system/TimeUtils.h4
-rw-r--r--source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.h4
-rw-r--r--source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.h4
-rw-r--r--source/blender/freestyle/intern/view_map/BoxGrid.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/BoxGrid.h4
-rw-r--r--source/blender/freestyle/intern/view_map/CulledOccluderSource.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/CulledOccluderSource.h4
-rw-r--r--source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/FEdgeXDetector.h4
-rw-r--r--source/blender/freestyle/intern/view_map/Functions0D.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/Functions0D.h4
-rw-r--r--source/blender/freestyle/intern/view_map/Functions1D.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/Functions1D.h4
-rw-r--r--source/blender/freestyle/intern/view_map/GridDensityProvider.h4
-rw-r--r--source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.h4
-rw-r--r--source/blender/freestyle/intern/view_map/Interface0D.h4
-rw-r--r--source/blender/freestyle/intern/view_map/Interface1D.h4
-rw-r--r--source/blender/freestyle/intern/view_map/OccluderSource.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/OccluderSource.h4
-rw-r--r--source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.h4
-rw-r--r--source/blender/freestyle/intern/view_map/Silhouette.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/Silhouette.h5
-rw-r--r--source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h4
-rw-r--r--source/blender/freestyle/intern/view_map/SphericalGrid.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/SphericalGrid.h4
-rw-r--r--source/blender/freestyle/intern/view_map/SteerableViewMap.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/SteerableViewMap.h8
-rw-r--r--source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h7
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMap.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMap.h4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapBuilder.h4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapIO.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapIO.h4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapIterators.h3
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapTesselator.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapTesselator.h4
-rw-r--r--source/blender/freestyle/intern/winged_edge/Curvature.cpp4
-rw-r--r--source/blender/freestyle/intern/winged_edge/Curvature.h4
-rw-r--r--source/blender/freestyle/intern/winged_edge/Nature.h4
-rw-r--r--source/blender/freestyle/intern/winged_edge/WEdge.cpp6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WEdge.h7
-rw-r--r--source/blender/freestyle/intern/winged_edge/WFillGrid.cpp6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WFillGrid.h6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WSFillGrid.cpp6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WSFillGrid.h4
-rw-r--r--source/blender/freestyle/intern/winged_edge/WXEdge.cpp6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WXEdge.h6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.cpp6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.h6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.h4
232 files changed, 907 insertions, 80 deletions
diff --git a/source/blender/freestyle/intern/application/AppCanvas.cpp b/source/blender/freestyle/intern/application/AppCanvas.cpp
index 2def2f269dd..e385eb76fbe 100644
--- a/source/blender/freestyle/intern/application/AppCanvas.cpp
+++ b/source/blender/freestyle/intern/application/AppCanvas.cpp
@@ -33,6 +33,8 @@
#include "../system/StringUtils.h"
+namespace Freestyle {
+
AppCanvas::AppCanvas()
:Canvas()
{
@@ -205,7 +207,8 @@ void AppCanvas::RenderStroke(Stroke *iStroke)
iStroke->Render(_Renderer);
}
-
void AppCanvas::update()
{
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/application/AppCanvas.h b/source/blender/freestyle/intern/application/AppCanvas.h
index 447bd493377..9a92cf482d0 100644
--- a/source/blender/freestyle/intern/application/AppCanvas.h
+++ b/source/blender/freestyle/intern/application/AppCanvas.h
@@ -28,6 +28,8 @@
#include "../stroke/Canvas.h"
#include "AppView.h"
+namespace Freestyle {
+
class AppCanvas : public Canvas
{
public:
@@ -91,4 +93,6 @@ private:
} _pass_diffuse, _pass_z;
};
+} /* namespace Freestyle */
+
#endif // __APPCANVAS_H__
diff --git a/source/blender/freestyle/intern/application/AppConfig.cpp b/source/blender/freestyle/intern/application/AppConfig.cpp
index 2c8ef1238fa..94bda945701 100644
--- a/source/blender/freestyle/intern/application/AppConfig.cpp
+++ b/source/blender/freestyle/intern/application/AppConfig.cpp
@@ -33,6 +33,8 @@ extern "C" {
#include "BLI_path_util.h"
}
+namespace Freestyle {
+
namespace Config {
Path *Path::_pInstance = 0;
@@ -95,3 +97,5 @@ string Path::getEnvVar(const string& iEnvVarName)
}
} // End of namepace Config
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/application/AppConfig.h b/source/blender/freestyle/intern/application/AppConfig.h
index b713c17f341..d647b7fc59c 100644
--- a/source/blender/freestyle/intern/application/AppConfig.h
+++ b/source/blender/freestyle/intern/application/AppConfig.h
@@ -34,6 +34,8 @@
using namespace std;
+namespace Freestyle {
+
namespace Config {
class Path {
@@ -98,4 +100,6 @@ static const real DEFAULT_DKR_EPSILON = 0.0;
} // End of namepace Config
+} /* namespace Freestyle */
+
#endif // __APP_CONFIG_H__
diff --git a/source/blender/freestyle/intern/application/AppView.cpp b/source/blender/freestyle/intern/application/AppView.cpp
index 4937ec0eab6..ae202412c09 100644
--- a/source/blender/freestyle/intern/application/AppView.cpp
+++ b/source/blender/freestyle/intern/application/AppView.cpp
@@ -56,6 +56,8 @@ extern "C" {
#include "FRS_freestyle.h"
}
+namespace Freestyle {
+
AppView::AppView(const char *iName)
{
_Fovy = DEG2RADF(30.0f);
@@ -189,3 +191,5 @@ real AppView::GetFocalLength()
real Near = std::max(0.1, (real)(-2.0f * _maxAbs + distanceToSceneCenter()));
return Near;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/application/AppView.h b/source/blender/freestyle/intern/application/AppView.h
index 1c7f19607db..0a9bc6449f4 100644
--- a/source/blender/freestyle/intern/application/AppView.h
+++ b/source/blender/freestyle/intern/application/AppView.h
@@ -31,6 +31,8 @@
#include "../scene_graph/NodeDrawingStyle.h"
#include "../system/Precision.h"
+namespace Freestyle {
+
using namespace Geometry;
class AppView
@@ -228,4 +230,6 @@ protected:
NodeDrawingStyle *_p2DSelectionNode;
};
+} /* namespace Freestyle */
+
#endif // __APPVIEW_H__
diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp
index 5b010d5ebc2..aaa8542d63b 100644
--- a/source/blender/freestyle/intern/application/Controller.cpp
+++ b/source/blender/freestyle/intern/application/Controller.cpp
@@ -63,19 +63,11 @@
#include "BKE_global.h"
-// XXX Not inside an "extern C" block???
#include "DNA_freestyle_types.h"
-// XXX Are those "ifdef __cplusplus" useful here?
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "FRS_freestyle.h"
-#ifdef __cplusplus
-}
-#endif
+namespace Freestyle {
Controller::Controller()
{
@@ -1043,3 +1035,5 @@ void Controller::init_options()
setPassDiffuse(NULL, 0, 0);
setPassZ(NULL, 0, 0);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/application/Controller.h b/source/blender/freestyle/intern/application/Controller.h
index 3ac3ba0654c..ff9a85f8041 100644
--- a/source/blender/freestyle/intern/application/Controller.h
+++ b/source/blender/freestyle/intern/application/Controller.h
@@ -40,6 +40,13 @@
#include "../view_map/FEdgeXDetector.h"
#include "../view_map/ViewMapBuilder.h"
+extern "C" {
+#include "render_types.h"
+#include "DNA_scene_types.h"
+}
+
+namespace Freestyle {
+
class AppView;
class NodeGroup;
class WShape;
@@ -51,18 +58,6 @@ class InteractiveShader;
class Shader;
class StrokeRenderer;
-// XXX Are those "ifdef __cplusplus" useful here?
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "render_types.h"
-#include "DNA_scene_types.h"
-
-#ifdef __cplusplus
-}
-#endif
-
class Controller
{
public:
@@ -247,4 +242,6 @@ private:
extern Controller *g_pController;
+} /* namespace Freestyle */
+
#endif // __CONTROLLER_H__
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
index 915493dad7a..2f98a042e27 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
@@ -28,6 +28,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
BlenderFileLoader::BlenderFileLoader(Render *re, SceneRenderLayer *srl)
{
_re = re;
@@ -756,3 +758,5 @@ void BlenderFileLoader::insertShapeNode(ObjectInstanceRen *obi, int id)
currentMesh->AddChild(shape);
_Scene->AddChild(currentMesh);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
index 48c20b6b931..fd0672d8e13 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
@@ -39,11 +39,7 @@
#include "../system/FreestyleConfig.h"
#include "../system/RenderMonitor.h"
-// XXX Are those "ifdef __cplusplus" useful here?
-#ifdef __cplusplus
extern "C" {
-#endif
-
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
@@ -55,11 +51,9 @@ extern "C" {
#include "BKE_scene.h"
#include "BLI_math.h"
-
-#ifdef __cplusplus
}
-#endif
+namespace Freestyle {
class NodeGroup;
@@ -128,4 +122,6 @@ protected:
RenderMonitor *_pRenderMonitor;
};
+} /* namespace Freestyle */
+
#endif // __BLENDER_FILE_LOADER_H__
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
index 05fc30a6bd5..0bd990ad03a 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
@@ -60,6 +60,8 @@ extern "C" {
}
#endif
+namespace Freestyle {
+
BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : StrokeRenderer()
{
// TEMPORARY - need a texture manager
@@ -510,3 +512,5 @@ Render *BlenderStrokeRenderer::RenderScene(Render *re)
RE_RenderFreestyleStrokes(freestyle_render, G.main, freestyle_scene);
return freestyle_render;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
index 43e7a699b5e..f4af5e3aba0 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
@@ -28,19 +28,14 @@
#include "../stroke/StrokeRenderer.h"
#include "../system/FreestyleConfig.h"
-// XXX Are those "ifdef __cplusplus" useful here?
-#ifdef __cplusplus
extern "C" {
-#endif
-
#include "DNA_material_types.h"
#include "DNA_scene_types.h"
#include "render_types.h"
-
-#ifdef __cplusplus
}
-#endif
+
+namespace Freestyle {
class LIB_STROKE_EXPORT BlenderStrokeRenderer : public StrokeRenderer
{
@@ -68,4 +63,6 @@ protected:
unsigned int get_stroke_mesh_id(void) const;
};
+} /* namespace Freestyle */
+
#endif // __BLENDER_STROKE_RENDERER_H__
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h b/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h
index 7848b75749f..7419d49ba4d 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h
@@ -34,6 +34,8 @@ extern "C" {
#include "BKE_text.h"
}
+namespace Freestyle {
+
class BlenderStyleModule : public StyleModule
{
public:
@@ -58,4 +60,6 @@ private:
struct Text *_text;
};
+} /* namespace Freestyle */
+
#endif // __BLENDERSTYLEMODULE_H__
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp b/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp
index c1eaa1f5928..7b397f5eea1 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp
@@ -26,6 +26,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
BlenderTextureManager::BlenderTextureManager()
: TextureManager()
{
@@ -95,3 +97,5 @@ unsigned int BlenderTextureManager::loadBrush(string sname, Stroke::MediumType m
return 0;
#endif
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.h b/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.h
index d55ed8d7ddc..1484188851d 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.h
@@ -29,6 +29,8 @@
# include "../stroke/StrokeRep.h"
# include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
/*! Class to load textures */
class LIB_RENDERING_EXPORT BlenderTextureManager : public TextureManager
{
@@ -43,4 +45,6 @@ protected:
virtual void loadStandardBrushes();
};
+} /* namespace Freestyle */
+
#endif // __BLENDERTEXTUREMANAGER_H__
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
index 325c314a570..56d12612dbc 100644
--- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
+++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
@@ -32,6 +32,7 @@
#include "../application/Controller.h"
using namespace std;
+using namespace Freestyle;
extern "C" {
diff --git a/source/blender/freestyle/intern/geometry/BBox.h b/source/blender/freestyle/intern/geometry/BBox.h
index 57c073df84a..8220bc6c65b 100644
--- a/source/blender/freestyle/intern/geometry/BBox.h
+++ b/source/blender/freestyle/intern/geometry/BBox.h
@@ -28,6 +28,8 @@
* \date 22/05/2003
*/
+namespace Freestyle {
+
template <class Point>
class BBox
{
@@ -144,4 +146,6 @@ BBox<Point>& operator+(const BBox<Point> &b1, const BBox<Point> &b2)
return BBox<Point>(new_min, new_max);
}
+} /* namespace Freestyle */
+
#endif // __BBOX_H__
diff --git a/source/blender/freestyle/intern/geometry/Bezier.cpp b/source/blender/freestyle/intern/geometry/Bezier.cpp
index 200c1856b80..e69830f3529 100644
--- a/source/blender/freestyle/intern/geometry/Bezier.cpp
+++ b/source/blender/freestyle/intern/geometry/Bezier.cpp
@@ -30,6 +30,8 @@
using namespace std;
+namespace Freestyle {
+
BezierCurveSegment::BezierCurveSegment()
{
}
@@ -118,3 +120,5 @@ void BezierCurve::AddControlPoint(const Vec2d& iPoint)
_currentSegment->AddControlPoint(iPoint);
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/Bezier.h b/source/blender/freestyle/intern/geometry/Bezier.h
index ec11dc5f691..4bd8dc8df4b 100644
--- a/source/blender/freestyle/intern/geometry/Bezier.h
+++ b/source/blender/freestyle/intern/geometry/Bezier.h
@@ -34,6 +34,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
using namespace Geometry;
class LIB_GEOMETRY_EXPORT BezierCurveSegment
@@ -86,4 +88,6 @@ public:
}
};
+} /* namespace Freestyle */
+
#endif // __BEZIER_H__
diff --git a/source/blender/freestyle/intern/geometry/FastGrid.cpp b/source/blender/freestyle/intern/geometry/FastGrid.cpp
index d6892174a76..438cac3c209 100644
--- a/source/blender/freestyle/intern/geometry/FastGrid.cpp
+++ b/source/blender/freestyle/intern/geometry/FastGrid.cpp
@@ -29,6 +29,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
void FastGrid::clear()
{
if (!_cells)
@@ -78,3 +80,5 @@ void FastGrid::fillCell(const Vec3u& p, Cell& cell)
assert(p[2] < _cells_nb[2]);
_cells[_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]] = &cell;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/FastGrid.h b/source/blender/freestyle/intern/geometry/FastGrid.h
index b680212bbcf..510a2b94225 100644
--- a/source/blender/freestyle/intern/geometry/FastGrid.h
+++ b/source/blender/freestyle/intern/geometry/FastGrid.h
@@ -32,6 +32,8 @@
#include "Grid.h"
+namespace Freestyle {
+
/*! Class to define a regular grid used for ray casting computations
* We don't use a hashtable here. The grid is explicitly stored for faster computations.
* However, this might result in significant increase in memory usage (compared to the regular grid)
@@ -76,4 +78,6 @@ protected:
unsigned _cells_size;
};
+} /* namespace Freestyle */
+
#endif // __FASTGRID_H__
diff --git a/source/blender/freestyle/intern/geometry/FitCurve.cpp b/source/blender/freestyle/intern/geometry/FitCurve.cpp
index d2e74597b2d..0e5d839f361 100644
--- a/source/blender/freestyle/intern/geometry/FitCurve.cpp
+++ b/source/blender/freestyle/intern/geometry/FitCurve.cpp
@@ -34,13 +34,9 @@
using namespace std;
-typedef Vector2 *BezierCurve;
+namespace Freestyle {
-// XXX Do we need "#ifdef __cplusplus" at all here???
-#ifdef __cplusplus
-extern "C"
-{
-#endif
+typedef Vector2 *BezierCurve;
/* Forward declarations */
static double *Reparameterize(Vector2 *d, int first, int last, double *u, BezierCurve bezCurve);
@@ -332,7 +328,6 @@ static double B0(double u)
return (tmp * tmp * tmp);
}
-
static double B1(double u)
{
double tmp = 1.0 - u;
@@ -416,9 +411,6 @@ static double *ChordLengthParameterize(Vector2 *d, int first, int last)
return u;
}
-
-
-
/*
* ComputeMaxError :
* Find the maximum squared distance of digitized points to fitted curve.
@@ -474,11 +466,6 @@ static Vector2 V2SubII(Vector2 a, Vector2 b)
return c;
}
-#ifdef __cplusplus
-}
-#endif
-
-
//------------------------- WRAPPER -----------------------------//
FitCurveWrapper::FitCurveWrapper()
@@ -591,3 +578,5 @@ void FitCurveWrapper::FitCubic(Vector2 *d, int first, int last, Vector2 tHat1, V
V2Negate(&tHatCenter);
FitCubic(d, splitPoint, last, tHatCenter, tHat2, error);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/FitCurve.h b/source/blender/freestyle/intern/geometry/FitCurve.h
index c339f1155a1..809ef875c0a 100644
--- a/source/blender/freestyle/intern/geometry/FitCurve.h
+++ b/source/blender/freestyle/intern/geometry/FitCurve.h
@@ -35,6 +35,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
using namespace Geometry;
/* 2d point */
@@ -115,4 +117,6 @@ protected:
void FitCubic(Vector2 *d, int first, int last, Vector2 tHat1, Vector2 tHat2, double error);
};
+} /* namespace Freestyle */
+
#endif // __FITCURVE_H__
diff --git a/source/blender/freestyle/intern/geometry/Geom.h b/source/blender/freestyle/intern/geometry/Geom.h
index 865c11fc785..ffef032e1eb 100644
--- a/source/blender/freestyle/intern/geometry/Geom.h
+++ b/source/blender/freestyle/intern/geometry/Geom.h
@@ -34,6 +34,8 @@
#include "../system/Precision.h"
+namespace Freestyle {
+
namespace Geometry {
typedef VecMat::Vec2<unsigned> Vec2u;
@@ -74,4 +76,6 @@ typedef VecMat::SquareMatrix<real, 4> Matrix44r;
} // end of namespace Geometry
+} /* namespace Freestyle */
+
#endif // __GEOM_H__
diff --git a/source/blender/freestyle/intern/geometry/GeomCleaner.cpp b/source/blender/freestyle/intern/geometry/GeomCleaner.cpp
index f80aa41a17e..acbc668118e 100644
--- a/source/blender/freestyle/intern/geometry/GeomCleaner.cpp
+++ b/source/blender/freestyle/intern/geometry/GeomCleaner.cpp
@@ -47,6 +47,7 @@
using namespace std;
+namespace Freestyle {
void GeomCleaner::SortIndexedVertexArray(const float *iVertices, unsigned iVSize, const unsigned *iIndices,
unsigned iISize, real **oVertices, unsigned **oIndices)
@@ -231,3 +232,5 @@ void GeomCleaner::CleanIndexedVertexArray(const float *iVertices, unsigned iVSiz
for (i = 0; i < iISize; i++)
(*oIndices)[i] = 3 * newIndices[iIndices[i] / 3];
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/GeomCleaner.h b/source/blender/freestyle/intern/geometry/GeomCleaner.h
index 5e8c02111ac..46ee6337ecc 100644
--- a/source/blender/freestyle/intern/geometry/GeomCleaner.h
+++ b/source/blender/freestyle/intern/geometry/GeomCleaner.h
@@ -32,6 +32,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
using namespace Geometry;
class LIB_GEOMETRY_EXPORT GeomCleaner
@@ -217,4 +219,6 @@ bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2)
}
#endif
+} /* namespace Freestyle */
+
#endif // __GEOMCLEANER_H__
diff --git a/source/blender/freestyle/intern/geometry/GeomUtils.cpp b/source/blender/freestyle/intern/geometry/GeomUtils.cpp
index fca749f84a3..abe13b85cd2 100644
--- a/source/blender/freestyle/intern/geometry/GeomUtils.cpp
+++ b/source/blender/freestyle/intern/geometry/GeomUtils.cpp
@@ -27,6 +27,8 @@
#include "GeomUtils.h"
+namespace Freestyle {
+
namespace GeomUtils {
// This internal procedure is defined below.
@@ -774,3 +776,5 @@ inline void fromCoordAToCoordB(const Vec3r&p, Vec3r& q, const real transform[4][
}
} // end of namespace GeomUtils
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/GeomUtils.h b/source/blender/freestyle/intern/geometry/GeomUtils.h
index 2ae52892cb1..dbb7a5d4e75 100644
--- a/source/blender/freestyle/intern/geometry/GeomUtils.h
+++ b/source/blender/freestyle/intern/geometry/GeomUtils.h
@@ -35,6 +35,9 @@
#include "../system/FreestyleConfig.h"
using namespace std;
+
+namespace Freestyle {
+
using namespace Geometry;
namespace GeomUtils {
@@ -267,4 +270,6 @@ void fromCameraToWorld(const Vec3r& p, Vec3r& q, const real model_view_matrix[4]
} // end of namespace GeomUtils
+} /* namespace Freestyle */
+
#endif // __GEOMUTILS_H__
diff --git a/source/blender/freestyle/intern/geometry/Grid.cpp b/source/blender/freestyle/intern/geometry/Grid.cpp
index e1ab4a0d53f..49e115b4333 100644
--- a/source/blender/freestyle/intern/geometry/Grid.cpp
+++ b/source/blender/freestyle/intern/geometry/Grid.cpp
@@ -31,6 +31,8 @@
#include "BBox.h"
#include "Grid.h"
+namespace Freestyle {
+
// Grid Visitors
/////////////////
void allOccludersGridVisitor::examineOccluder(Polygon3r *occ)
@@ -382,3 +384,5 @@ bool Grid::initInfiniteRay (const Vec3r &orig, const Vec3r& dir, unsigned timest
return true;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/Grid.h b/source/blender/freestyle/intern/geometry/Grid.h
index 866d4887306..8ba74f9ba2c 100644
--- a/source/blender/freestyle/intern/geometry/Grid.h
+++ b/source/blender/freestyle/intern/geometry/Grid.h
@@ -46,6 +46,9 @@ extern "C" {
}
using namespace std;
+
+namespace Freestyle {
+
using namespace Geometry;
typedef vector<Polygon3r*> OccludersSet;
@@ -374,4 +377,6 @@ private:
OccludersSet::iterator it, end;
};
+} /* namespace Freestyle */
+
#endif // __GRID_H__
diff --git a/source/blender/freestyle/intern/geometry/GridHelpers.cpp b/source/blender/freestyle/intern/geometry/GridHelpers.cpp
index ee4829a20f2..2b809608edf 100644
--- a/source/blender/freestyle/intern/geometry/GridHelpers.cpp
+++ b/source/blender/freestyle/intern/geometry/GridHelpers.cpp
@@ -29,6 +29,8 @@
#include "GridHelpers.h"
+namespace Freestyle {
+
void GridHelpers::getDefaultViewProscenium(real viewProscenium[4])
{
// Get proscenium boundary for culling
@@ -50,3 +52,5 @@ void GridHelpers::getDefaultViewProscenium(real viewProscenium[4])
GridHelpers::Transform::~Transform ()
{
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/GridHelpers.h b/source/blender/freestyle/intern/geometry/GridHelpers.h
index fc3f810954d..57b56ca2ff4 100644
--- a/source/blender/freestyle/intern/geometry/GridHelpers.h
+++ b/source/blender/freestyle/intern/geometry/GridHelpers.h
@@ -37,6 +37,8 @@
#include "../winged_edge/WEdge.h"
+namespace Freestyle {
+
namespace GridHelpers {
/*! Computes the distance from a point P to a segment AB */
@@ -205,4 +207,6 @@ inline void expandProscenium (real proscenium[4], const Vec3r& point)
}; // GridHelpers namespace
+} /* namespace Freestyle */
+
#endif // __GRIDHELPERS_H__
diff --git a/source/blender/freestyle/intern/geometry/HashGrid.cpp b/source/blender/freestyle/intern/geometry/HashGrid.cpp
index 08764906765..0b576b6f368 100644
--- a/source/blender/freestyle/intern/geometry/HashGrid.cpp
+++ b/source/blender/freestyle/intern/geometry/HashGrid.cpp
@@ -27,6 +27,8 @@
#include "HashGrid.h"
+namespace Freestyle {
+
void HashGrid::clear()
{
if (!_cells.empty()) {
@@ -44,3 +46,5 @@ void HashGrid::configure(const Vec3r& orig, const Vec3r& size, unsigned nb)
{
Grid::configure(orig, size, nb);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/HashGrid.h b/source/blender/freestyle/intern/geometry/HashGrid.h
index 09a3e806f02..7013a969eb5 100644
--- a/source/blender/freestyle/intern/geometry/HashGrid.h
+++ b/source/blender/freestyle/intern/geometry/HashGrid.h
@@ -42,6 +42,8 @@
#include "Grid.h"
+namespace Freestyle {
+
/*! Defines a hash table used for searching the Cells */
struct GridHasher
{
@@ -106,4 +108,6 @@ protected:
GridHashTable _cells;
};
+} /* namespace Freestyle */
+
#endif // __HASHGRID_H__
diff --git a/source/blender/freestyle/intern/geometry/Noise.cpp b/source/blender/freestyle/intern/geometry/Noise.cpp
index 866b347a811..b21ded9dd95 100644
--- a/source/blender/freestyle/intern/geometry/Noise.cpp
+++ b/source/blender/freestyle/intern/geometry/Noise.cpp
@@ -32,6 +32,8 @@
#include "Noise.h"
+namespace Freestyle {
+
#define SCURVE(a) ((a) * (a) * (3.0 - 2.0 * (a)))
#if 0 // XXX Unused
@@ -272,3 +274,5 @@ Noise::Noise(long seed)
g3[_NOISE_B + i][j] = g3[i][j];
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/Noise.h b/source/blender/freestyle/intern/geometry/Noise.h
index 8dd35f75917..f0135e07321 100644
--- a/source/blender/freestyle/intern/geometry/Noise.h
+++ b/source/blender/freestyle/intern/geometry/Noise.h
@@ -32,10 +32,13 @@
#include "../system/FreestyleConfig.h"
+using namespace std;
+
+namespace Freestyle {
+
#define _NOISE_B 0x100
using namespace Geometry;
-using namespace std;
/*! Class to provide Perlin Noise functionalities */
class LIB_GEOMETRY_EXPORT Noise
@@ -73,4 +76,6 @@ private:
int start;
};
+} /* namespace Freestyle */
+
#endif // __NOISE_H__
diff --git a/source/blender/freestyle/intern/geometry/Polygon.h b/source/blender/freestyle/intern/geometry/Polygon.h
index 9068da34297..8f7ab8e440c 100644
--- a/source/blender/freestyle/intern/geometry/Polygon.h
+++ b/source/blender/freestyle/intern/geometry/Polygon.h
@@ -35,6 +35,8 @@
using namespace std;
+namespace Freestyle {
+
namespace Geometry {
template <class Point>
@@ -211,4 +213,6 @@ private:
} // end of namespace Geometry
+} /* namespace Freestyle */
+
#endif // __POLYGON_H__
diff --git a/source/blender/freestyle/intern/geometry/SweepLine.h b/source/blender/freestyle/intern/geometry/SweepLine.h
index fc1c20fd458..8777dd0ba51 100644
--- a/source/blender/freestyle/intern/geometry/SweepLine.h
+++ b/source/blender/freestyle/intern/geometry/SweepLine.h
@@ -31,6 +31,8 @@
#include <list>
#include <vector>
+namespace Freestyle {
+
/*! Class to define the intersection berween two segments*/
template<class Edge>
class Intersection
@@ -322,4 +324,6 @@ private:
std::vector<Intersection<Segment<T, Point> > *> _Intersections; // the list of all intersections.
};
+} /* namespace Freestyle */
+
#endif // __SWEEPLINE_H__
diff --git a/source/blender/freestyle/intern/geometry/VecMat.h b/source/blender/freestyle/intern/geometry/VecMat.h
index c614fc9a0a0..5319bbc0feb 100644
--- a/source/blender/freestyle/intern/geometry/VecMat.h
+++ b/source/blender/freestyle/intern/geometry/VecMat.h
@@ -34,6 +34,8 @@
#include <math.h>
#include <vector>
+namespace Freestyle {
+
namespace VecMat {
namespace Internal {
@@ -967,4 +969,6 @@ inline std::ostream& operator<<(std::ostream& s, const Matrix<T, M, N>& m)
} // end of namespace VecMat
+} /* namespace Freestyle */
+
#endif // __VECMAT_H__
diff --git a/source/blender/freestyle/intern/geometry/matrix_util.cpp b/source/blender/freestyle/intern/geometry/matrix_util.cpp
index de74b39279b..7905dda5843 100644
--- a/source/blender/freestyle/intern/geometry/matrix_util.cpp
+++ b/source/blender/freestyle/intern/geometry/matrix_util.cpp
@@ -40,6 +40,8 @@
#include "matrix_util.h"
+namespace Freestyle {
+
namespace OGF {
namespace MatrixUtil {
@@ -261,3 +263,5 @@ namespace MatrixUtil {
} // MatrixUtil namespace
} // OGF namespace
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/matrix_util.h b/source/blender/freestyle/intern/geometry/matrix_util.h
index f6da4955738..162e2f85d3c 100644
--- a/source/blender/freestyle/intern/geometry/matrix_util.h
+++ b/source/blender/freestyle/intern/geometry/matrix_util.h
@@ -41,6 +41,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
namespace OGF {
namespace MatrixUtil {
@@ -66,4 +68,6 @@ namespace MatrixUtil {
} // OGF namespace
+} /* namespace Freestyle */
+
#endif // __MATRIX_UTIL__
diff --git a/source/blender/freestyle/intern/geometry/normal_cycle.cpp b/source/blender/freestyle/intern/geometry/normal_cycle.cpp
index bcba23702fd..951614c8f22 100644
--- a/source/blender/freestyle/intern/geometry/normal_cycle.cpp
+++ b/source/blender/freestyle/intern/geometry/normal_cycle.cpp
@@ -39,6 +39,8 @@
#include "matrix_util.h"
#include "normal_cycle.h"
+namespace Freestyle {
+
namespace OGF {
//_________________________________________________________
@@ -95,3 +97,5 @@ void NormalCycle::end()
//_________________________________________________________
} // OGF namespace
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/geometry/normal_cycle.h b/source/blender/freestyle/intern/geometry/normal_cycle.h
index 272a34365f6..66439e04058 100644
--- a/source/blender/freestyle/intern/geometry/normal_cycle.h
+++ b/source/blender/freestyle/intern/geometry/normal_cycle.h
@@ -43,6 +43,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
using namespace Geometry;
namespace OGF {
@@ -138,4 +140,6 @@ inline void NormalCycle::accumulate_dihedral_angle(const Vec3r& edge, const doub
} // OGF namespace
+} /* namespace Freestyle */
+
#endif // __MESH_TOOLS_MATH_NORMAL_CYCLE__
diff --git a/source/blender/freestyle/intern/image/GaussianFilter.cpp b/source/blender/freestyle/intern/image/GaussianFilter.cpp
index 955d3bffef0..9d0a6a00b44 100644
--- a/source/blender/freestyle/intern/image/GaussianFilter.cpp
+++ b/source/blender/freestyle/intern/image/GaussianFilter.cpp
@@ -29,6 +29,8 @@
#include "GaussianFilter.h"
+namespace Freestyle {
+
GaussianFilter::GaussianFilter(float iSigma)
{
_sigma = iSigma;
@@ -103,3 +105,5 @@ void GaussianFilter::computeMask()
}
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/image/GaussianFilter.h b/source/blender/freestyle/intern/image/GaussianFilter.h
index 82007dba1d1..b300ec00989 100644
--- a/source/blender/freestyle/intern/image/GaussianFilter.h
+++ b/source/blender/freestyle/intern/image/GaussianFilter.h
@@ -33,6 +33,12 @@
#include "../system/FreestyleConfig.h"
+extern "C" {
+#include "BLI_math.h"
+}
+
+namespace Freestyle {
+
class LIB_IMAGE_EXPORT GaussianFilter
{
protected:
@@ -119,8 +125,6 @@ protected:
*/
-#include <math.h>
-
#ifdef __MACH__
# define sqrtf(x) (sqrt(x))
#endif
@@ -152,4 +156,6 @@ float GaussianFilter::getSmoothedPixel(Map *map, int x, int y)
return L;
}
+} /* namespace Freestyle */
+
#endif // __GAUSSIANFILTER_H__
diff --git a/source/blender/freestyle/intern/image/Image.h b/source/blender/freestyle/intern/image/Image.h
index 6eb0ad07967..e4a8e3f9041 100644
--- a/source/blender/freestyle/intern/image/Image.h
+++ b/source/blender/freestyle/intern/image/Image.h
@@ -30,6 +30,8 @@
#include <string.h> // for memcpy
+namespace Freestyle {
+
//
// Image base class, for all types of images
//
@@ -405,4 +407,6 @@ protected:
float *_lvl;
};
+} /* namespace Freestyle */
+
#endif // __IMAGE_H__
diff --git a/source/blender/freestyle/intern/image/ImagePyramid.cpp b/source/blender/freestyle/intern/image/ImagePyramid.cpp
index e2a5a782895..251f47bc44c 100644
--- a/source/blender/freestyle/intern/image/ImagePyramid.cpp
+++ b/source/blender/freestyle/intern/image/ImagePyramid.cpp
@@ -33,6 +33,8 @@
using namespace std;
+namespace Freestyle {
+
#if 0
ImagePyramid::ImagePyramid(const GrayImage& level0, unsigned nbLevels)
{
@@ -183,3 +185,5 @@ void GaussianPyramid::BuildPyramid(GrayImage *level0, unsigned nbLevels)
}
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/image/ImagePyramid.h b/source/blender/freestyle/intern/image/ImagePyramid.h
index c8989778619..c3f3f63e4e7 100644
--- a/source/blender/freestyle/intern/image/ImagePyramid.h
+++ b/source/blender/freestyle/intern/image/ImagePyramid.h
@@ -32,6 +32,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
class GrayImage;
class LIB_IMAGE_EXPORT ImagePyramid
@@ -106,4 +108,6 @@ public:
/* modifiers */
};
+} /* namespace Freestyle */
+
#endif // __IMAGEPYRAMID_H__
diff --git a/source/blender/freestyle/intern/python/BPy_BBox.h b/source/blender/freestyle/intern/python/BPy_BBox.h
index 00e88058974..6f8a3d21c50 100644
--- a/source/blender/freestyle/intern/python/BPy_BBox.h
+++ b/source/blender/freestyle/intern/python/BPy_BBox.h
@@ -29,7 +29,9 @@
#include "../geometry/BBox.h"
#include "../geometry/Geom.h"
-using namespace Geometry;
+
+using namespace Freestyle;
+using namespace Freestyle::Geometry;
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h b/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h
index 70fb2394389..9622ca1eb98 100644
--- a/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h
+++ b/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h
@@ -29,6 +29,8 @@
#include "../stroke/Predicates0D.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h b/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h
index 144d2094d94..07a3d2986ce 100644
--- a/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h
+++ b/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h
@@ -29,6 +29,8 @@
#include "../stroke/Predicates1D.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp b/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp
index d9d49236b13..e44dfdf0bae 100644
--- a/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp
+++ b/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp
@@ -27,6 +27,8 @@
#include "../stroke/ContextFunctions.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.h b/source/blender/freestyle/intern/python/BPy_Convert.h
index 098272da1d5..1df4901757b 100644
--- a/source/blender/freestyle/intern/python/BPy_Convert.h
+++ b/source/blender/freestyle/intern/python/BPy_Convert.h
@@ -29,7 +29,9 @@
#include <typeinfo>
#include "../geometry/Geom.h"
-using namespace Geometry;
+
+using namespace Freestyle;
+using namespace Freestyle::Geometry;
// BBox
#include "../geometry/BBox.h"
diff --git a/source/blender/freestyle/intern/python/BPy_FrsMaterial.h b/source/blender/freestyle/intern/python/BPy_FrsMaterial.h
index e533a870409..62a9f2c9a78 100644
--- a/source/blender/freestyle/intern/python/BPy_FrsMaterial.h
+++ b/source/blender/freestyle/intern/python/BPy_FrsMaterial.h
@@ -29,6 +29,8 @@
#include "../scene_graph/FrsMaterial.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_FrsNoise.h b/source/blender/freestyle/intern/python/BPy_FrsNoise.h
index 0ef4e23226d..14d8696d0cb 100644
--- a/source/blender/freestyle/intern/python/BPy_FrsNoise.h
+++ b/source/blender/freestyle/intern/python/BPy_FrsNoise.h
@@ -29,6 +29,8 @@
#include "../geometry/Noise.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_Id.h b/source/blender/freestyle/intern/python/BPy_Id.h
index 78fdfcd2384..d4b635a4ea5 100644
--- a/source/blender/freestyle/intern/python/BPy_Id.h
+++ b/source/blender/freestyle/intern/python/BPy_Id.h
@@ -27,10 +27,13 @@
#include <Python.h>
#include <iostream>
+
using namespace std;
#include "../system/Id.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_IntegrationType.h b/source/blender/freestyle/intern/python/BPy_IntegrationType.h
index 801a2a9f703..36b925f1ee7 100644
--- a/source/blender/freestyle/intern/python/BPy_IntegrationType.h
+++ b/source/blender/freestyle/intern/python/BPy_IntegrationType.h
@@ -29,6 +29,8 @@
#include "../view_map/Interface1D.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_Interface0D.h b/source/blender/freestyle/intern/python/BPy_Interface0D.h
index 905281b8a40..02929bcdbc7 100644
--- a/source/blender/freestyle/intern/python/BPy_Interface0D.h
+++ b/source/blender/freestyle/intern/python/BPy_Interface0D.h
@@ -29,6 +29,8 @@
#include "../view_map/Interface0D.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_Interface1D.h b/source/blender/freestyle/intern/python/BPy_Interface1D.h
index 053021423cc..9bc447725e9 100644
--- a/source/blender/freestyle/intern/python/BPy_Interface1D.h
+++ b/source/blender/freestyle/intern/python/BPy_Interface1D.h
@@ -29,6 +29,8 @@
#include "../view_map/Interface1D.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_Iterator.h b/source/blender/freestyle/intern/python/BPy_Iterator.h
index ad86dec7278..a739787aa85 100644
--- a/source/blender/freestyle/intern/python/BPy_Iterator.h
+++ b/source/blender/freestyle/intern/python/BPy_Iterator.h
@@ -29,6 +29,8 @@
#include "../system/Iterator.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_MediumType.h b/source/blender/freestyle/intern/python/BPy_MediumType.h
index 92efefd02c7..120829e0b40 100644
--- a/source/blender/freestyle/intern/python/BPy_MediumType.h
+++ b/source/blender/freestyle/intern/python/BPy_MediumType.h
@@ -29,6 +29,8 @@
#include "../stroke/Stroke.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_Nature.h b/source/blender/freestyle/intern/python/BPy_Nature.h
index 3d7514ecf60..0b9901bbe06 100644
--- a/source/blender/freestyle/intern/python/BPy_Nature.h
+++ b/source/blender/freestyle/intern/python/BPy_Nature.h
@@ -29,6 +29,8 @@
#include "../winged_edge/Nature.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_Operators.h b/source/blender/freestyle/intern/python/BPy_Operators.h
index a38feec89c8..be9514f46d8 100644
--- a/source/blender/freestyle/intern/python/BPy_Operators.h
+++ b/source/blender/freestyle/intern/python/BPy_Operators.h
@@ -29,6 +29,8 @@
#include "../stroke/Operators.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_SShape.h b/source/blender/freestyle/intern/python/BPy_SShape.h
index 996c9c6c50f..8e7d3b63582 100644
--- a/source/blender/freestyle/intern/python/BPy_SShape.h
+++ b/source/blender/freestyle/intern/python/BPy_SShape.h
@@ -29,6 +29,8 @@
#include "../view_map/Silhouette.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.h b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.h
index 3951e87c38c..6d30b6b1421 100644
--- a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.h
+++ b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.h
@@ -29,6 +29,8 @@
#include "../stroke/Stroke.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_StrokeShader.h b/source/blender/freestyle/intern/python/BPy_StrokeShader.h
index 76799f5fe54..19af6006c10 100644
--- a/source/blender/freestyle/intern/python/BPy_StrokeShader.h
+++ b/source/blender/freestyle/intern/python/BPy_StrokeShader.h
@@ -33,6 +33,8 @@ using namespace std;
#include "../stroke/StrokeShader.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_UnaryFunction0D.h b/source/blender/freestyle/intern/python/BPy_UnaryFunction0D.h
index c01fb527740..3b6a2ab79e6 100644
--- a/source/blender/freestyle/intern/python/BPy_UnaryFunction0D.h
+++ b/source/blender/freestyle/intern/python/BPy_UnaryFunction0D.h
@@ -29,6 +29,8 @@
#include "../view_map/Functions0D.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_UnaryFunction1D.h b/source/blender/freestyle/intern/python/BPy_UnaryFunction1D.h
index e08d1d6e9fb..87c4430fd14 100644
--- a/source/blender/freestyle/intern/python/BPy_UnaryFunction1D.h
+++ b/source/blender/freestyle/intern/python/BPy_UnaryFunction1D.h
@@ -29,6 +29,8 @@
#include "../view_map/Functions1D.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.h b/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.h
index 455fd30bce7..0101a5f508a 100644
--- a/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.h
+++ b/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.h
@@ -29,6 +29,8 @@
#include "../stroke/Predicates0D.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.h b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.h
index 9454c020228..fd37e1dc13a 100644
--- a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.h
+++ b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.h
@@ -29,6 +29,8 @@
#include "../stroke/Predicates1D.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_ViewMap.h b/source/blender/freestyle/intern/python/BPy_ViewMap.h
index ce972dba204..5150c6fbebd 100644
--- a/source/blender/freestyle/intern/python/BPy_ViewMap.h
+++ b/source/blender/freestyle/intern/python/BPy_ViewMap.h
@@ -29,6 +29,8 @@
#include "../view_map/ViewMap.h"
+using namespace Freestyle;
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/source/blender/freestyle/intern/python/BPy_ViewShape.h b/source/blender/freestyle/intern/python/BPy_ViewShape.h
index 06ca9284252..7727b131e1b 100644
--- a/source/blender/freestyle/intern/python/BPy_ViewShape.h
+++ b/source/blender/freestyle/intern/python/BPy_ViewShape.h
@@ -29,6 +29,8 @@
#include "../view_map/ViewMap.h"
+using namespace Freestyle;
+
#include "BPy_SShape.h"
#ifdef __cplusplus
diff --git a/source/blender/freestyle/intern/python/Director.h b/source/blender/freestyle/intern/python/Director.h
index 4d825828f53..d58a51b65b2 100644
--- a/source/blender/freestyle/intern/python/Director.h
+++ b/source/blender/freestyle/intern/python/Director.h
@@ -25,6 +25,7 @@
#ifndef __FREESTYLE_PYTHON_DIRECTOR_H__
#define __FREESTYLE_PYTHON_DIRECTOR_H__
+namespace Freestyle {
class UnaryPredicate0D;
class UnaryPredicate1D;
class BinaryPredicate0D;
@@ -36,6 +37,9 @@ class Interface1D;
class Interface0DIterator;
class Stroke;
class StrokeShader;
+}
+
+using namespace Freestyle;
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/freestyle/intern/scene_graph/DrawingStyle.h b/source/blender/freestyle/intern/scene_graph/DrawingStyle.h
index 073cf0448bc..b95e96a09aa 100644
--- a/source/blender/freestyle/intern/scene_graph/DrawingStyle.h
+++ b/source/blender/freestyle/intern/scene_graph/DrawingStyle.h
@@ -28,6 +28,8 @@
* \date 10/10/2002
*/
+namespace Freestyle {
+
class DrawingStyle
{
public:
@@ -118,4 +120,6 @@ DrawingStyle& DrawingStyle::operator=(const DrawingStyle& ds)
return *this;
}
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_DRAWING_STYLE_H__
diff --git a/source/blender/freestyle/intern/scene_graph/FrsMaterial.h b/source/blender/freestyle/intern/scene_graph/FrsMaterial.h
index aad68efbea1..43a61e772f9 100644
--- a/source/blender/freestyle/intern/scene_graph/FrsMaterial.h
+++ b/source/blender/freestyle/intern/scene_graph/FrsMaterial.h
@@ -30,6 +30,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
/*! Class defining a material */
class FrsMaterial
{
@@ -369,4 +371,6 @@ bool FrsMaterial::operator==(const FrsMaterial& m) const
return (!((*this) != m));
}
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_MATERIAL_H__
diff --git a/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp b/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp
index 67e6aa99303..8a2740b94df 100644
--- a/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp
+++ b/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp
@@ -27,6 +27,8 @@
#include "IndexedFaceSet.h"
+namespace Freestyle {
+
IndexedFaceSet::IndexedFaceSet() : Rep()
{
_Vertices = NULL;
@@ -321,3 +323,5 @@ void IndexedFaceSet::ComputeBBox()
setBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h b/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
index 422691d4d0e..2995360fb24 100644
--- a/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
+++ b/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
@@ -36,6 +36,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
class LIB_SCENE_GRAPH_EXPORT IndexedFaceSet : public Rep
{
public:
@@ -312,4 +314,6 @@ protected:
unsigned int _displayList;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_INDEXED_FACE_SET_H__
diff --git a/source/blender/freestyle/intern/scene_graph/LineRep.cpp b/source/blender/freestyle/intern/scene_graph/LineRep.cpp
index 88348648024..e7d81113974 100644
--- a/source/blender/freestyle/intern/scene_graph/LineRep.cpp
+++ b/source/blender/freestyle/intern/scene_graph/LineRep.cpp
@@ -27,6 +27,8 @@
#include "LineRep.h"
+namespace Freestyle {
+
void LineRep::ComputeBBox()
{
real XMax = _vertices.front()[0];
@@ -62,3 +64,5 @@ void LineRep::ComputeBBox()
setBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/LineRep.h b/source/blender/freestyle/intern/scene_graph/LineRep.h
index 6491e89ac97..c5de30309f6 100644
--- a/source/blender/freestyle/intern/scene_graph/LineRep.h
+++ b/source/blender/freestyle/intern/scene_graph/LineRep.h
@@ -37,6 +37,8 @@
using namespace std;
+namespace Freestyle {
+
/*! Base class for all lines objects */
class LIB_SCENE_GRAPH_EXPORT LineRep : public Rep
{
@@ -148,4 +150,6 @@ private:
float _width;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_LINE_REP_H__
diff --git a/source/blender/freestyle/intern/scene_graph/Node.h b/source/blender/freestyle/intern/scene_graph/Node.h
index 6c23e6bdcba..47ce6aaf8e6 100644
--- a/source/blender/freestyle/intern/scene_graph/Node.h
+++ b/source/blender/freestyle/intern/scene_graph/Node.h
@@ -38,6 +38,9 @@
#include "../geometry/Geom.h"
using namespace std;
+
+namespace Freestyle {
+
using namespace Geometry;
class LIB_SCENE_GRAPH_EXPORT Node : public BaseObject
@@ -105,4 +108,6 @@ private:
BBox<Vec3r> _BBox;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_NODE_H__
diff --git a/source/blender/freestyle/intern/scene_graph/NodeCamera.cpp b/source/blender/freestyle/intern/scene_graph/NodeCamera.cpp
index c30252ada5e..33f40b5778f 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeCamera.cpp
+++ b/source/blender/freestyle/intern/scene_graph/NodeCamera.cpp
@@ -30,6 +30,8 @@
#include "NodeCamera.h"
+namespace Freestyle {
+
static void loadIdentity(double * matrix)
{
int i;
@@ -136,3 +138,5 @@ NodePerspectiveCamera::NodePerspectiveCamera(double left, double right, double b
projection_matrix_[14] = -1.0;
projection_matrix_[15] = 0;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/NodeCamera.h b/source/blender/freestyle/intern/scene_graph/NodeCamera.h
index c6019e60ca1..8e5cf9be52d 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeCamera.h
+++ b/source/blender/freestyle/intern/scene_graph/NodeCamera.h
@@ -34,6 +34,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
using namespace Geometry;
class NodeOrthographicCamera;
@@ -205,5 +207,6 @@ public:
NodePerspectiveCamera(double left, double right, double bottom, double top, double zNear, double zFar);
};
+} /* namespace Freestyle */
#endif // __FREESTYLE_NODE_CAMERA_H__
diff --git a/source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.cpp b/source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.cpp
index 657e6a6035d..5868cb92971 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.cpp
+++ b/source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.cpp
@@ -27,6 +27,8 @@
#include "NodeDrawingStyle.h"
+namespace Freestyle {
+
void NodeDrawingStyle::accept(SceneVisitor& v)
{
v.visitNodeDrawingStyle(*this);
@@ -37,3 +39,5 @@ void NodeDrawingStyle::accept(SceneVisitor& v)
(*node)->accept(v);
v.visitNodeDrawingStyleAfter(*this);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.h b/source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.h
index 71568eabe7c..a846b050db1 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.h
+++ b/source/blender/freestyle/intern/scene_graph/NodeDrawingStyle.h
@@ -33,6 +33,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
class LIB_SCENE_GRAPH_EXPORT NodeDrawingStyle : public NodeGroup
{
public:
@@ -101,4 +103,6 @@ private:
DrawingStyle _DrawingStyle;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_NODE_DRAWING_STYLE_H__
diff --git a/source/blender/freestyle/intern/scene_graph/NodeGroup.cpp b/source/blender/freestyle/intern/scene_graph/NodeGroup.cpp
index 202c1c8141c..35d39dcf667 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeGroup.cpp
+++ b/source/blender/freestyle/intern/scene_graph/NodeGroup.cpp
@@ -28,6 +28,8 @@
#include "NodeGroup.h"
+namespace Freestyle {
+
void NodeGroup::AddChild(Node *iChild)
{
if (NULL == iChild)
@@ -117,3 +119,5 @@ const BBox<Vec3r>& NodeGroup::UpdateBBox()
return Node::UpdateBBox();
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/NodeGroup.h b/source/blender/freestyle/intern/scene_graph/NodeGroup.h
index ce758499147..8123639e01f 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeGroup.h
+++ b/source/blender/freestyle/intern/scene_graph/NodeGroup.h
@@ -37,6 +37,8 @@
using namespace std;
+namespace Freestyle {
+
class LIB_SCENE_GRAPH_EXPORT NodeGroup : public Node
{
public:
@@ -79,4 +81,6 @@ protected:
vector<Node*> _Children;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_NODE_GROUP_H__
diff --git a/source/blender/freestyle/intern/scene_graph/NodeLight.cpp b/source/blender/freestyle/intern/scene_graph/NodeLight.cpp
index 9cb8fbc3926..5a54bc09891 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeLight.cpp
+++ b/source/blender/freestyle/intern/scene_graph/NodeLight.cpp
@@ -27,6 +27,8 @@
#include "NodeLight.h"
+namespace Freestyle {
+
int NodeLight::numberOfLights = 0;
NodeLight::NodeLight() : Node()
@@ -77,3 +79,5 @@ void NodeLight::accept(SceneVisitor& v)
{
v.visitNodeLight(*this);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/NodeLight.h b/source/blender/freestyle/intern/scene_graph/NodeLight.h
index 66a9cabd221..25e13a768ec 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeLight.h
+++ b/source/blender/freestyle/intern/scene_graph/NodeLight.h
@@ -34,6 +34,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
using namespace Geometry;
class LIB_SCENE_GRAPH_EXPORT NodeLight : public Node
@@ -103,4 +105,6 @@ private:
int _number;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_NODE_LIGHT_H__
diff --git a/source/blender/freestyle/intern/scene_graph/NodeShape.cpp b/source/blender/freestyle/intern/scene_graph/NodeShape.cpp
index 9ea94a16d79..1c1db9d9638 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeShape.cpp
+++ b/source/blender/freestyle/intern/scene_graph/NodeShape.cpp
@@ -27,6 +27,8 @@
#include "NodeShape.h"
+namespace Freestyle {
+
NodeShape::~NodeShape()
{
vector<Rep *>::iterator rep;
@@ -54,3 +56,5 @@ void NodeShape::accept(SceneVisitor& v)
(*rep)->accept(v);
v.visitNodeShapeAfter(*this);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/NodeShape.h b/source/blender/freestyle/intern/scene_graph/NodeShape.h
index fd077be6cc4..3b4491f8b6d 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeShape.h
+++ b/source/blender/freestyle/intern/scene_graph/NodeShape.h
@@ -40,6 +40,9 @@
#include "Rep.h"
using namespace std;
+
+namespace Freestyle {
+
using namespace Geometry;
class LIB_SCENE_GRAPH_EXPORT NodeShape : public Node
@@ -93,4 +96,6 @@ private:
FrsMaterial _FrsMaterial;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_NODE_SHAPE_H__
diff --git a/source/blender/freestyle/intern/scene_graph/NodeTransform.cpp b/source/blender/freestyle/intern/scene_graph/NodeTransform.cpp
index 1c990f07734..5d26e85195f 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeTransform.cpp
+++ b/source/blender/freestyle/intern/scene_graph/NodeTransform.cpp
@@ -30,6 +30,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
void NodeTransform::Translate(real x, real y, real z)
{
_Matrix(0, 3) += x;
@@ -169,3 +171,5 @@ bool NodeTransform::isScaled(const Matrix44r &M)
return false;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/NodeTransform.h b/source/blender/freestyle/intern/scene_graph/NodeTransform.h
index f61c4723c3f..544075998a4 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeTransform.h
+++ b/source/blender/freestyle/intern/scene_graph/NodeTransform.h
@@ -35,6 +35,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
using namespace Geometry;
class LIB_SCENE_GRAPH_EXPORT NodeTransform : public NodeGroup
@@ -100,4 +102,6 @@ private:
bool _Scaled;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_NODE_TRANSFORM_H__
diff --git a/source/blender/freestyle/intern/scene_graph/OrientedLineRep.cpp b/source/blender/freestyle/intern/scene_graph/OrientedLineRep.cpp
index 1e78d657b87..2c397cd18fc 100644
--- a/source/blender/freestyle/intern/scene_graph/OrientedLineRep.cpp
+++ b/source/blender/freestyle/intern/scene_graph/OrientedLineRep.cpp
@@ -29,6 +29,8 @@
#include "../system/BaseObject.h"
+namespace Freestyle {
+
void OrientedLineRep::accept(SceneVisitor& v)
{
Rep::accept(v);
@@ -37,3 +39,5 @@ void OrientedLineRep::accept(SceneVisitor& v)
else
v.visitLineRep(*this);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/OrientedLineRep.h b/source/blender/freestyle/intern/scene_graph/OrientedLineRep.h
index 19bf9cc0e88..7272d47892a 100644
--- a/source/blender/freestyle/intern/scene_graph/OrientedLineRep.h
+++ b/source/blender/freestyle/intern/scene_graph/OrientedLineRep.h
@@ -32,6 +32,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
class LIB_SCENE_GRAPH_EXPORT OrientedLineRep : public LineRep
{
public:
@@ -56,4 +58,6 @@ public:
virtual void accept(SceneVisitor& v);
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_ORIENTED_LINE_REP_H__
diff --git a/source/blender/freestyle/intern/scene_graph/Rep.h b/source/blender/freestyle/intern/scene_graph/Rep.h
index 1f90812162e..92624199c40 100644
--- a/source/blender/freestyle/intern/scene_graph/Rep.h
+++ b/source/blender/freestyle/intern/scene_graph/Rep.h
@@ -38,6 +38,8 @@
#include "../system/Id.h"
#include "../system/Precision.h"
+namespace Freestyle {
+
using namespace Geometry;
class LIB_SCENE_GRAPH_EXPORT Rep : public BaseObject
@@ -163,4 +165,6 @@ private:
FrsMaterial *_FrsMaterial;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_REP_H__
diff --git a/source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.cpp b/source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.cpp
index 6a1300b9dcf..4e87625f6f9 100644
--- a/source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.cpp
+++ b/source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.cpp
@@ -31,6 +31,8 @@
#include "IndexedFaceSet.h"
#include "ScenePrettyPrinter.h"
+namespace Freestyle {
+
#define VISIT(CLASS) \
void ScenePrettyPrinter::visit##CLASS(CLASS&) \
{ \
@@ -101,3 +103,5 @@ void ScenePrettyPrinter::visitIndexedFaceSet(IndexedFaceSet& ifs)
p += 3;
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.h b/source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.h
index 8d52c7bccce..e3fe5ee4d78 100644
--- a/source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.h
+++ b/source/blender/freestyle/intern/scene_graph/ScenePrettyPrinter.h
@@ -37,6 +37,8 @@
using namespace std;
+namespace Freestyle {
+
class ScenePrettyPrinter : public SceneVisitor
{
public:
@@ -99,4 +101,6 @@ private:
string _space;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_SCENE_PRETTY_PRINTER_H__
diff --git a/source/blender/freestyle/intern/scene_graph/SceneVisitor.h b/source/blender/freestyle/intern/scene_graph/SceneVisitor.h
index 43c760efde6..1f1be21df72 100644
--- a/source/blender/freestyle/intern/scene_graph/SceneVisitor.h
+++ b/source/blender/freestyle/intern/scene_graph/SceneVisitor.h
@@ -30,6 +30,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
#define VISIT_COMPLETE_DEF(type) \
virtual void visit##type(type&) {} \
virtual void visit##type##Before(type&) {} \
@@ -92,4 +94,6 @@ public:
VISIT_COMPLETE_DEF(FrsMaterial)
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_SCENE_VISITOR_H__
diff --git a/source/blender/freestyle/intern/scene_graph/TriangleRep.cpp b/source/blender/freestyle/intern/scene_graph/TriangleRep.cpp
index b9ff2408fba..98efefb8314 100644
--- a/source/blender/freestyle/intern/scene_graph/TriangleRep.cpp
+++ b/source/blender/freestyle/intern/scene_graph/TriangleRep.cpp
@@ -27,6 +27,8 @@
#include "TriangleRep.h"
+namespace Freestyle {
+
void TriangleRep::ComputeBBox()
{
real XMax = _vertices[0][0];
@@ -60,3 +62,5 @@ void TriangleRep::ComputeBBox()
setBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/TriangleRep.h b/source/blender/freestyle/intern/scene_graph/TriangleRep.h
index b0f4e65b520..d204d128de4 100644
--- a/source/blender/freestyle/intern/scene_graph/TriangleRep.h
+++ b/source/blender/freestyle/intern/scene_graph/TriangleRep.h
@@ -31,6 +31,8 @@
//! inherits from class Rep
#include "Rep.h"
+namespace Freestyle {
+
/*! Base class for all lines objects */
class LIB_SCENE_GRAPH_EXPORT TriangleRep : public Rep
{
@@ -140,4 +142,6 @@ public:
virtual void ComputeBBox();
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_TRIANGLE_REP_H__
diff --git a/source/blender/freestyle/intern/scene_graph/VertexRep.cpp b/source/blender/freestyle/intern/scene_graph/VertexRep.cpp
index 50349a94257..475c6d6d153 100644
--- a/source/blender/freestyle/intern/scene_graph/VertexRep.cpp
+++ b/source/blender/freestyle/intern/scene_graph/VertexRep.cpp
@@ -27,8 +27,12 @@
#include "VertexRep.h"
+namespace Freestyle {
+
void VertexRep::ComputeBBox()
{
setBBox(BBox<Vec3r>(Vec3r(_coordinates[0], _coordinates[1], _coordinates[2]),
Vec3r(_coordinates[0], _coordinates[1], _coordinates[2])));
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/scene_graph/VertexRep.h b/source/blender/freestyle/intern/scene_graph/VertexRep.h
index 41c0da1f786..1f1284fe163 100644
--- a/source/blender/freestyle/intern/scene_graph/VertexRep.h
+++ b/source/blender/freestyle/intern/scene_graph/VertexRep.h
@@ -30,6 +30,8 @@
#include "Rep.h"
+namespace Freestyle {
+
class LIB_SCENE_GRAPH_EXPORT VertexRep : public Rep
{
public:
@@ -131,4 +133,6 @@ private:
float _PointSize;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_VERTEX_REP_H__
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
diff --git a/source/blender/freestyle/intern/system/BaseIterator.h b/source/blender/freestyle/intern/system/BaseIterator.h
index 7b52582d35a..3398f08500c 100644
--- a/source/blender/freestyle/intern/system/BaseIterator.h
+++ b/source/blender/freestyle/intern/system/BaseIterator.h
@@ -30,6 +30,8 @@
#include <iterator>
+namespace Freestyle {
+
// use for iterators defintions
template <class Element>
class Nonconst_traits;
@@ -87,4 +89,6 @@ protected:
IteratorBase() {}
};
+} /* namespace Freestyle */
+
#endif // BASEITERATOR_H
diff --git a/source/blender/freestyle/intern/system/BaseObject.h b/source/blender/freestyle/intern/system/BaseObject.h
index 1ab967d36f9..c5073527297 100644
--- a/source/blender/freestyle/intern/system/BaseObject.h
+++ b/source/blender/freestyle/intern/system/BaseObject.h
@@ -31,6 +31,8 @@
#include "FreestyleConfig.h"
+namespace Freestyle {
+
class LIB_SYSTEM_EXPORT BaseObject
{
public:
@@ -67,4 +69,6 @@ private:
unsigned _ref_counter;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_BASE_OBJECT_H__
diff --git a/source/blender/freestyle/intern/system/Cast.h b/source/blender/freestyle/intern/system/Cast.h
index 0d9bf6bf208..9e115356c0e 100644
--- a/source/blender/freestyle/intern/system/Cast.h
+++ b/source/blender/freestyle/intern/system/Cast.h
@@ -28,6 +28,8 @@
* \date 01/07/2003
*/
+namespace Freestyle {
+
namespace Cast
{
template <class T, class U>
@@ -39,4 +41,6 @@ namespace Cast
}
} // end of namespace Cast
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CAST_H__
diff --git a/source/blender/freestyle/intern/system/Exception.cpp b/source/blender/freestyle/intern/system/Exception.cpp
index cdebd59ef7e..527f57a5bff 100644
--- a/source/blender/freestyle/intern/system/Exception.cpp
+++ b/source/blender/freestyle/intern/system/Exception.cpp
@@ -27,4 +27,8 @@
#include "Exception.h"
+namespace Freestyle {
+
Exception::exception_type Exception::_exception = Exception::NO_EXCEPTION;
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/system/Exception.h b/source/blender/freestyle/intern/system/Exception.h
index d49e50b66d8..a87c8730c50 100644
--- a/source/blender/freestyle/intern/system/Exception.h
+++ b/source/blender/freestyle/intern/system/Exception.h
@@ -30,6 +30,8 @@
#include "FreestyleConfig.h"
+namespace Freestyle {
+
class LIB_SYSTEM_EXPORT Exception
{
public:
@@ -60,4 +62,6 @@ private:
static exception_type _exception;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_EXCEPTION_H__
diff --git a/source/blender/freestyle/intern/system/FreestyleConfig.h b/source/blender/freestyle/intern/system/FreestyleConfig.h
index 7759645b718..42f9833836d 100644
--- a/source/blender/freestyle/intern/system/FreestyleConfig.h
+++ b/source/blender/freestyle/intern/system/FreestyleConfig.h
@@ -34,6 +34,8 @@
using namespace std;
+namespace Freestyle {
+
namespace Config {
// Directory separators
@@ -86,4 +88,6 @@ namespace Config {
} // end of namespace Config
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CONFIG_H__
diff --git a/source/blender/freestyle/intern/system/Id.h b/source/blender/freestyle/intern/system/Id.h
index 4f499bc1d69..641ae41907f 100644
--- a/source/blender/freestyle/intern/system/Id.h
+++ b/source/blender/freestyle/intern/system/Id.h
@@ -28,6 +28,8 @@
* \date 01/07/2003
*/
+namespace Freestyle {
+
/*! Class used to tag any object by an id.
* It is made of two unsigned integers.
*/
@@ -132,4 +134,6 @@ inline std::ostream& operator<<(std::ostream& s, const Id& id)
return s;
}
+} /* namespace Freestyle */
+
# endif // __FREESTYLE_ID_H__
diff --git a/source/blender/freestyle/intern/system/Interpreter.h b/source/blender/freestyle/intern/system/Interpreter.h
index 92c9a71baa8..2b23a9d7c6a 100644
--- a/source/blender/freestyle/intern/system/Interpreter.h
+++ b/source/blender/freestyle/intern/system/Interpreter.h
@@ -32,6 +32,8 @@
using namespace std;
+namespace Freestyle {
+
class LIB_SYSTEM_EXPORT Interpreter
{
public:
@@ -55,4 +57,6 @@ protected:
string _language;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_INTERPRETER_H__
diff --git a/source/blender/freestyle/intern/system/Iterator.h b/source/blender/freestyle/intern/system/Iterator.h
index e2f4c855465..07ea2ae992e 100644
--- a/source/blender/freestyle/intern/system/Iterator.h
+++ b/source/blender/freestyle/intern/system/Iterator.h
@@ -30,6 +30,8 @@
using namespace std;
+namespace Freestyle {
+
class Iterator
{
public:
@@ -65,4 +67,6 @@ public:
}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_ITERATOR_H__
diff --git a/source/blender/freestyle/intern/system/PointerSequence.h b/source/blender/freestyle/intern/system/PointerSequence.h
index c3664b863e4..e551eb6162e 100644
--- a/source/blender/freestyle/intern/system/PointerSequence.h
+++ b/source/blender/freestyle/intern/system/PointerSequence.h
@@ -61,6 +61,8 @@
#include <algorithm>
+namespace Freestyle {
+
template <typename C, typename T>
class PointerSequence : public C
{
@@ -86,4 +88,6 @@ public:
}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_POINTER_SEQUENCE_H__
diff --git a/source/blender/freestyle/intern/system/Precision.h b/source/blender/freestyle/intern/system/Precision.h
index 7b46540aa77..8b859f11444 100644
--- a/source/blender/freestyle/intern/system/Precision.h
+++ b/source/blender/freestyle/intern/system/Precision.h
@@ -28,10 +28,14 @@
* \date 30/07/2002
*/
+namespace Freestyle {
+
typedef double real;
#ifndef SWIG
static const real M_EPSILON = 0.00000001;
#endif // SWIG
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_PRECISION_H__
diff --git a/source/blender/freestyle/intern/system/ProgressBar.h b/source/blender/freestyle/intern/system/ProgressBar.h
index 54b84e45107..c1ac983a3e8 100644
--- a/source/blender/freestyle/intern/system/ProgressBar.h
+++ b/source/blender/freestyle/intern/system/ProgressBar.h
@@ -32,6 +32,8 @@
using namespace std;
+namespace Freestyle {
+
class ProgressBar
{
public:
@@ -86,4 +88,6 @@ protected:
string _label;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_PROGRESS_BAR_H__
diff --git a/source/blender/freestyle/intern/system/PseudoNoise.cpp b/source/blender/freestyle/intern/system/PseudoNoise.cpp
index 5e04f56a50c..77b7c565279 100644
--- a/source/blender/freestyle/intern/system/PseudoNoise.cpp
+++ b/source/blender/freestyle/intern/system/PseudoNoise.cpp
@@ -30,6 +30,8 @@
#include "PseudoNoise.h"
#include "RandGen.h"
+namespace Freestyle {
+
static const unsigned NB_VALUE_NOISE = 512;
real *PseudoNoise::_values;
@@ -107,3 +109,5 @@ real PseudoNoise::turbulenceLinear(real x, unsigned nbOctave)
}
return y;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/system/PseudoNoise.h b/source/blender/freestyle/intern/system/PseudoNoise.h
index aef3a7bd1f2..b190e8c8568 100644
--- a/source/blender/freestyle/intern/system/PseudoNoise.h
+++ b/source/blender/freestyle/intern/system/PseudoNoise.h
@@ -31,6 +31,8 @@
#include "FreestyleConfig.h"
#include "Precision.h"
+namespace Freestyle {
+
class LIB_SYSTEM_EXPORT PseudoNoise
{
public:
@@ -50,4 +52,6 @@ protected:
static real *_values;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_PSEUDO_NOISE_H__
diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.cpp b/source/blender/freestyle/intern/system/PythonInterpreter.cpp
index 7d2d99a6451..9e7ef39a0e4 100644
--- a/source/blender/freestyle/intern/system/PythonInterpreter.cpp
+++ b/source/blender/freestyle/intern/system/PythonInterpreter.cpp
@@ -27,5 +27,9 @@
#include "PythonInterpreter.h"
+namespace Freestyle {
+
string PythonInterpreter::_path = "";
bool PythonInterpreter::_initialized = false;
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h
index 2ceec4c2aa5..c54546b3ddd 100644
--- a/source/blender/freestyle/intern/system/PythonInterpreter.h
+++ b/source/blender/freestyle/intern/system/PythonInterpreter.h
@@ -36,7 +36,6 @@
//soc
extern "C" {
-
#include "MEM_guardedalloc.h"
#include "DNA_text_types.h"
@@ -49,9 +48,10 @@ extern "C" {
#include "BKE_text.h"
#include "BPY_extern.h"
-
}
+namespace Freestyle {
+
class LIB_SYSTEM_EXPORT PythonInterpreter : public Interpreter
{
public:
@@ -188,4 +188,6 @@ private:
static string _path;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_PYTHON_INTERPRETER_H__
diff --git a/source/blender/freestyle/intern/system/RandGen.cpp b/source/blender/freestyle/intern/system/RandGen.cpp
index 2be8326ab5c..22727db026b 100644
--- a/source/blender/freestyle/intern/system/RandGen.cpp
+++ b/source/blender/freestyle/intern/system/RandGen.cpp
@@ -27,6 +27,8 @@
#include "RandGen.h"
+namespace Freestyle {
+
//
// Macro definitions
//
@@ -129,3 +131,5 @@ void RandGen::next()
x[1] = LOW(p[1] + r[0]);
x[0] = LOW(p[0]);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/system/RandGen.h b/source/blender/freestyle/intern/system/RandGen.h
index f6f41042dbe..7d8de72c240 100644
--- a/source/blender/freestyle/intern/system/RandGen.h
+++ b/source/blender/freestyle/intern/system/RandGen.h
@@ -34,6 +34,8 @@
#include "../system/Precision.h"
+namespace Freestyle {
+
class LIB_SYSTEM_EXPORT RandGen
{
public:
@@ -44,4 +46,6 @@ private:
static void next();
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_RAND_GEN_H__
diff --git a/source/blender/freestyle/intern/system/RenderMonitor.h b/source/blender/freestyle/intern/system/RenderMonitor.h
index 47a3b799454..614513b3c56 100644
--- a/source/blender/freestyle/intern/system/RenderMonitor.h
+++ b/source/blender/freestyle/intern/system/RenderMonitor.h
@@ -29,11 +29,11 @@
*/
extern "C" {
-
#include "render_types.h"
-
}
+namespace Freestyle {
+
class RenderMonitor
{
public:
@@ -53,4 +53,6 @@ protected:
Render *_re;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_RENDER_MONITOR_H__
diff --git a/source/blender/freestyle/intern/system/StringUtils.cpp b/source/blender/freestyle/intern/system/StringUtils.cpp
index f7dc1f25071..20cec90fc9f 100644
--- a/source/blender/freestyle/intern/system/StringUtils.cpp
+++ b/source/blender/freestyle/intern/system/StringUtils.cpp
@@ -30,6 +30,8 @@
#include "FreestyleConfig.h"
#include "StringUtils.h"
+namespace Freestyle {
+
namespace StringUtils {
void getPathName(const string& path, const string& base, vector<string>& pathnames)
@@ -80,3 +82,5 @@ const char *toAscii(const char *str)
}
} // end of namespace StringUtils
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/system/StringUtils.h b/source/blender/freestyle/intern/system/StringUtils.h
index 21b60720374..983e102d439 100644
--- a/source/blender/freestyle/intern/system/StringUtils.h
+++ b/source/blender/freestyle/intern/system/StringUtils.h
@@ -47,6 +47,8 @@ extern "C" {
using namespace std;
+namespace Freestyle {
+
namespace StringUtils {
LIB_SYSTEM_EXPORT
@@ -65,4 +67,6 @@ struct ltstr
} // end of namespace StringUtils
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STRING_UTILS_H__
diff --git a/source/blender/freestyle/intern/system/TimeStamp.cpp b/source/blender/freestyle/intern/system/TimeStamp.cpp
index d8f4193fd62..dc4e717486d 100644
--- a/source/blender/freestyle/intern/system/TimeStamp.cpp
+++ b/source/blender/freestyle/intern/system/TimeStamp.cpp
@@ -27,5 +27,9 @@
#include "TimeStamp.h"
+namespace Freestyle {
+
LIB_SYSTEM_EXPORT
TimeStamp *TimeStamp::_instance = 0;
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/system/TimeStamp.h b/source/blender/freestyle/intern/system/TimeStamp.h
index 0a8f0101e6a..2ebfb359dd5 100644
--- a/source/blender/freestyle/intern/system/TimeStamp.h
+++ b/source/blender/freestyle/intern/system/TimeStamp.h
@@ -30,6 +30,8 @@
#include "FreestyleConfig.h"
+namespace Freestyle {
+
class LIB_SYSTEM_EXPORT TimeStamp
{
public:
@@ -68,4 +70,6 @@ private:
unsigned _time_stamp;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_TIME_STAMP_H__
diff --git a/source/blender/freestyle/intern/system/TimeUtils.h b/source/blender/freestyle/intern/system/TimeUtils.h
index 26b9180f6d2..a769eb5b649 100644
--- a/source/blender/freestyle/intern/system/TimeUtils.h
+++ b/source/blender/freestyle/intern/system/TimeUtils.h
@@ -32,6 +32,8 @@
#include "FreestyleConfig.h"
+namespace Freestyle {
+
class Chronometer
{
public:
@@ -54,4 +56,6 @@ private:
clock_t _start;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_TIME_UTILS_H__
diff --git a/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp b/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp
index 881177f3b5c..ed9932c3eef 100644
--- a/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp
+++ b/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp
@@ -29,6 +29,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
ArbitraryGridDensityProvider::ArbitraryGridDensityProvider(OccluderSource& source, const real proscenium[4],
unsigned numCells)
: GridDensityProvider(source), numCells(numCells)
@@ -115,3 +117,5 @@ auto_ptr<GridDensityProvider> ArbitraryGridDensityProviderFactory::newGridDensit
{
return auto_ptr<GridDensityProvider>(new ArbitraryGridDensityProvider(source, numCells));
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.h b/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.h
index 31592afbfec..652cb9b34b0 100644
--- a/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.h
+++ b/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.h
@@ -30,6 +30,8 @@
#include "GridDensityProvider.h"
+namespace Freestyle {
+
class ArbitraryGridDensityProvider : public GridDensityProvider
{
// Disallow copying and assignment
@@ -65,4 +67,6 @@ protected:
unsigned numCells;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_ARBITRARY_GRID_DENSITY_PROVIDER_H__
diff --git a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp
index d7d47ddb154..2d8d3b30f84 100644
--- a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp
+++ b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp
@@ -29,6 +29,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
AverageAreaGridDensityProvider::AverageAreaGridDensityProvider(OccluderSource& source, const real proscenium[4],
real sizeFactor)
: GridDensityProvider(source)
@@ -129,3 +131,5 @@ auto_ptr<GridDensityProvider> AverageAreaGridDensityProviderFactory::newGridDens
{
return auto_ptr<GridDensityProvider>(new AverageAreaGridDensityProvider(source, sizeFactor));
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.h b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.h
index c0d9b435c07..d63557f5cda 100644
--- a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.h
+++ b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.h
@@ -30,6 +30,8 @@
#include "GridDensityProvider.h"
+namespace Freestyle {
+
class AverageAreaGridDensityProvider : public GridDensityProvider
{
// Disallow copying and assignment
@@ -62,4 +64,6 @@ protected:
real sizeFactor;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_AVERAGE_AREA_GRID_DENSITY_PROVIDER_H__
diff --git a/source/blender/freestyle/intern/view_map/BoxGrid.cpp b/source/blender/freestyle/intern/view_map/BoxGrid.cpp
index ad15a193ac7..2e702813fb8 100644
--- a/source/blender/freestyle/intern/view_map/BoxGrid.cpp
+++ b/source/blender/freestyle/intern/view_map/BoxGrid.cpp
@@ -34,6 +34,8 @@
using namespace std;
+namespace Freestyle {
+
// Helper Classes
// OccluderData
@@ -232,3 +234,5 @@ Vec3r BoxGrid::Transform::operator()(const Vec3r& point) const
{
return Vec3r(point[0], point[1], -point[2]);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/BoxGrid.h b/source/blender/freestyle/intern/view_map/BoxGrid.h
index 9a5f8f27c03..5ceb84761bf 100644
--- a/source/blender/freestyle/intern/view_map/BoxGrid.h
+++ b/source/blender/freestyle/intern/view_map/BoxGrid.h
@@ -50,6 +50,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
class BoxGrid
{
public:
@@ -407,4 +409,6 @@ inline bool BoxGrid::insertOccluder(OccluderSource& source, OccluderData*& occlu
return occluder != NULL;
}
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_BOX_GRID_H__
diff --git a/source/blender/freestyle/intern/view_map/CulledOccluderSource.cpp b/source/blender/freestyle/intern/view_map/CulledOccluderSource.cpp
index 62d451f5023..2a1388c939b 100644
--- a/source/blender/freestyle/intern/view_map/CulledOccluderSource.cpp
+++ b/source/blender/freestyle/intern/view_map/CulledOccluderSource.cpp
@@ -33,6 +33,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
CulledOccluderSource::CulledOccluderSource(const GridHelpers::Transform& t, WingedEdge& we, ViewMap& viewMap,
bool extensiveFEdgeSearch)
: OccluderSource(t, we), rejected(0), gridSpaceOccluderProsceniumInitialized(false)
@@ -278,3 +280,5 @@ void CulledOccluderSource::expandGridSpaceOccluderProscenium(FEdge *fe)
gridSpaceOccluderProsceniumInitialized = true;
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/CulledOccluderSource.h b/source/blender/freestyle/intern/view_map/CulledOccluderSource.h
index 56493f89fa9..4bc3c490727 100644
--- a/source/blender/freestyle/intern/view_map/CulledOccluderSource.h
+++ b/source/blender/freestyle/intern/view_map/CulledOccluderSource.h
@@ -31,6 +31,8 @@
#include "OccluderSource.h"
#include "ViewMap.h"
+namespace Freestyle {
+
class CulledOccluderSource : public OccluderSource
{
// Disallow copying and assignment
@@ -59,4 +61,6 @@ private:
bool gridSpaceOccluderProsceniumInitialized;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_CULLED_OCCLUDER_SOURCE_H__
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
index b521f496c5f..2da82f175ed 100644
--- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
+++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
@@ -35,6 +35,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
void FEdgeXDetector::processShapes(WingedEdge& we)
{
bool progressBarDisplay = false;
@@ -753,3 +755,5 @@ void FEdgeXDetector::buildSmoothEdges(WXShape *iShape)
_meanKr /= (real)(_nPoints);
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
index ab4dc52fec8..fb0702278ba 100644
--- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
+++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
@@ -39,6 +39,8 @@
#include "../winged_edge/Curvature.h"
#include "../winged_edge/WXEdge.h"
+namespace Freestyle {
+
using namespace Geometry;
/*! This class takes as input a WXEdge structure and fills it */
@@ -231,4 +233,6 @@ protected:
RenderMonitor *_pRenderMonitor;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_FEDGE_X_DETECTOR_H__
diff --git a/source/blender/freestyle/intern/view_map/Functions0D.cpp b/source/blender/freestyle/intern/view_map/Functions0D.cpp
index bb2e21db238..f95690e6ff6 100644
--- a/source/blender/freestyle/intern/view_map/Functions0D.cpp
+++ b/source/blender/freestyle/intern/view_map/Functions0D.cpp
@@ -33,6 +33,8 @@
using namespace std;
+namespace Freestyle {
+
namespace Functions0D {
// Internal function
@@ -367,3 +369,5 @@ int GetOccludeeF0D::operator()(Interface0DIterator& iter)
}
} // end of namespace Functions0D
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/Functions0D.h b/source/blender/freestyle/intern/view_map/Functions0D.h
index ede82fd9c7f..5036433e586 100644
--- a/source/blender/freestyle/intern/view_map/Functions0D.h
+++ b/source/blender/freestyle/intern/view_map/Functions0D.h
@@ -43,6 +43,8 @@
#include "../system/Exception.h"
#include "../system/Precision.h"
+namespace Freestyle {
+
class FEdge;
class ViewEdge;
class SShape;
@@ -522,4 +524,6 @@ ViewShape *getOccludeeF0D(Interface0DIterator& it);
} // end of namespace Functions0D
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_FUNCTIONS_0D_H__
diff --git a/source/blender/freestyle/intern/view_map/Functions1D.cpp b/source/blender/freestyle/intern/view_map/Functions1D.cpp
index a0c15adf329..5d12c5bb251 100644
--- a/source/blender/freestyle/intern/view_map/Functions1D.cpp
+++ b/source/blender/freestyle/intern/view_map/Functions1D.cpp
@@ -30,6 +30,8 @@
using namespace std;
+namespace Freestyle {
+
namespace Functions1D {
int GetXF1D::operator()(Interface1D& inter)
@@ -262,3 +264,5 @@ void getShapeF1D(Interface1D& inter, set<ViewShape*>& oShapes)
}
} // end of namespace Functions1D
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/Functions1D.h b/source/blender/freestyle/intern/view_map/Functions1D.h
index 9de31ff0cea..b6f914cd43b 100644
--- a/source/blender/freestyle/intern/view_map/Functions1D.h
+++ b/source/blender/freestyle/intern/view_map/Functions1D.h
@@ -39,6 +39,8 @@
#include "../python/Director.h"
+namespace Freestyle {
+
//
// UnaryFunction1D (base class for functions in 1D)
//
@@ -617,4 +619,6 @@ void getShapeF1D(Interface1D& inter, set<ViewShape*>& oShapes);
} // end of namespace Functions1D
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_FUNCTIONS_1D_H__
diff --git a/source/blender/freestyle/intern/view_map/GridDensityProvider.h b/source/blender/freestyle/intern/view_map/GridDensityProvider.h
index 168f519dff7..a39f17753d4 100644
--- a/source/blender/freestyle/intern/view_map/GridDensityProvider.h
+++ b/source/blender/freestyle/intern/view_map/GridDensityProvider.h
@@ -37,6 +37,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
class GridDensityProvider
{
// Disallow copying and assignment
@@ -142,4 +144,6 @@ public:
virtual ~GridDensityProviderFactory () {}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_GRID_DENSITY_PROVIDER_H__
diff --git a/source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.cpp b/source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.cpp
index 6e687f0492a..00f5cc90cc4 100644
--- a/source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.cpp
+++ b/source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.cpp
@@ -27,6 +27,8 @@
#include "HeuristicGridDensityProviderFactory.h"
+namespace Freestyle {
+
HeuristicGridDensityProviderFactory::HeuristicGridDensityProviderFactory(real sizeFactor, unsigned numFaces)
: sizeFactor(sizeFactor), numFaces(numFaces)
{
@@ -75,3 +77,5 @@ auto_ptr<GridDensityProvider> HeuristicGridDensityProviderFactory::newGridDensit
return (auto_ptr<GridDensityProvider>) avg;
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.h b/source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.h
index 23a4e55c6a6..65f2af6df2f 100644
--- a/source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.h
+++ b/source/blender/freestyle/intern/view_map/HeuristicGridDensityProviderFactory.h
@@ -34,6 +34,8 @@
//#include "GridDensityProvider.h" // provided by *GridDensityProvider.h below
#include "Pow23GridDensityProvider.h"
+namespace Freestyle {
+
class HeuristicGridDensityProviderFactory : public GridDensityProviderFactory
{
public:
@@ -50,4 +52,6 @@ protected:
unsigned numFaces;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_HEURISTIC_GRID_DENSITY_PROVIDER_FACTORY_H__
diff --git a/source/blender/freestyle/intern/view_map/Interface0D.h b/source/blender/freestyle/intern/view_map/Interface0D.h
index 14fd5848ef5..770929b21f9 100644
--- a/source/blender/freestyle/intern/view_map/Interface0D.h
+++ b/source/blender/freestyle/intern/view_map/Interface0D.h
@@ -42,6 +42,8 @@
using namespace std;
+namespace Freestyle {
+
//
// Interface0D
//
@@ -380,4 +382,6 @@ protected:
Interface0DIteratorNested *_iterator;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_INTERFACE_0D_H__
diff --git a/source/blender/freestyle/intern/view_map/Interface1D.h b/source/blender/freestyle/intern/view_map/Interface1D.h
index 524ef2a0207..02c9468554f 100644
--- a/source/blender/freestyle/intern/view_map/Interface1D.h
+++ b/source/blender/freestyle/intern/view_map/Interface1D.h
@@ -42,6 +42,8 @@
using namespace std;
+namespace Freestyle {
+
// Integration method
/*! The different integration methods that can be invoked to integrate into a single value the set of values obtained
* from each 0D element of a 1D element.
@@ -220,4 +222,6 @@ protected:
unsigned _timeStamp;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_INTERFACE_1D_H__
diff --git a/source/blender/freestyle/intern/view_map/OccluderSource.cpp b/source/blender/freestyle/intern/view_map/OccluderSource.cpp
index 647e31c0205..dbc271cc57b 100644
--- a/source/blender/freestyle/intern/view_map/OccluderSource.cpp
+++ b/source/blender/freestyle/intern/view_map/OccluderSource.cpp
@@ -31,6 +31,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
OccluderSource::OccluderSource(const GridHelpers::Transform& t, WingedEdge& we)
: wingedEdge(we), valid(false), transform(t)
{
@@ -142,3 +144,5 @@ real OccluderSource::averageOccluderArea()
area /= numFaces;
return area;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/OccluderSource.h b/source/blender/freestyle/intern/view_map/OccluderSource.h
index a740a3dca31..1f9209d8445 100644
--- a/source/blender/freestyle/intern/view_map/OccluderSource.h
+++ b/source/blender/freestyle/intern/view_map/OccluderSource.h
@@ -32,6 +32,8 @@
#include "../winged_edge/WEdge.h"
+namespace Freestyle {
+
class OccluderSource
{
// Disallow copying and assignment
@@ -66,4 +68,6 @@ protected:
void buildCachedPolygon();
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_OCCLUDER_SOURCE_H__
diff --git a/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp b/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp
index d962bd3aa29..40a3c9f298d 100644
--- a/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp
+++ b/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.cpp
@@ -29,6 +29,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
Pow23GridDensityProvider::Pow23GridDensityProvider(OccluderSource& source, const real proscenium[4], unsigned numFaces)
: GridDensityProvider(source), numFaces(numFaces)
{
@@ -114,3 +116,5 @@ auto_ptr<GridDensityProvider> Pow23GridDensityProviderFactory::newGridDensityPro
{
return auto_ptr<GridDensityProvider>(new Pow23GridDensityProvider(source, numFaces));
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.h b/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.h
index a8406669d99..7f646790ab6 100644
--- a/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.h
+++ b/source/blender/freestyle/intern/view_map/Pow23GridDensityProvider.h
@@ -30,6 +30,8 @@
#include "GridDensityProvider.h"
+namespace Freestyle {
+
class Pow23GridDensityProvider : public GridDensityProvider
{
// Disallow copying and assignment
@@ -65,4 +67,6 @@ protected:
unsigned numFaces;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_POW_23_GRID_DENSITY_PROVIDER_H__
diff --git a/source/blender/freestyle/intern/view_map/Silhouette.cpp b/source/blender/freestyle/intern/view_map/Silhouette.cpp
index e16d6db5702..8c428746e34 100644
--- a/source/blender/freestyle/intern/view_map/Silhouette.cpp
+++ b/source/blender/freestyle/intern/view_map/Silhouette.cpp
@@ -28,6 +28,8 @@
#include "Silhouette.h"
#include "ViewMap.h"
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -411,3 +413,5 @@ const FrsMaterial& FEdgeSmooth::frs_material() const
{
return _VertexA->shape()->frs_material(_FrsMaterialIndex);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h
index 4eb27d3849e..c4221069a66 100644
--- a/source/blender/freestyle/intern/view_map/Silhouette.h
+++ b/source/blender/freestyle/intern/view_map/Silhouette.h
@@ -49,6 +49,9 @@
#include "../winged_edge/Curvature.h"
using namespace std;
+
+namespace Freestyle {
+
using namespace Geometry;
class ViewShape;
@@ -1866,4 +1869,6 @@ public:
}
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_SILHOUETTE_H__
diff --git a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp
index 1eacedd54da..8b8f42f3922 100644
--- a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp
+++ b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp
@@ -35,6 +35,8 @@
using namespace std;
+namespace Freestyle {
+
Vec3r SilhouetteGeomEngine::_Viewpoint = Vec3r(0, 0, 0);
real SilhouetteGeomEngine::_translation[3] = {0, 0, 0};
real SilhouetteGeomEngine::_modelViewMatrix[4][4] = {
@@ -313,3 +315,5 @@ Vec3r SilhouetteGeomEngine::WorldToImage(const Vec3r& M)
newPoint[2] = (-newPoint[2] - _znear) * fac; // normalize Z between 0 and 1
return newPoint;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h
index bb84c414fe1..0a1e86a1449 100644
--- a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h
+++ b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h
@@ -35,6 +35,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
using namespace Geometry;
class SVertex;
@@ -126,4 +128,6 @@ public:
static Vec3r WorldToImage(const Vec3r& M);
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_SILHOUETTE_GEOM_ENGINE_H__
diff --git a/source/blender/freestyle/intern/view_map/SphericalGrid.cpp b/source/blender/freestyle/intern/view_map/SphericalGrid.cpp
index 00e11e28651..1621bd85000 100644
--- a/source/blender/freestyle/intern/view_map/SphericalGrid.cpp
+++ b/source/blender/freestyle/intern/view_map/SphericalGrid.cpp
@@ -34,6 +34,8 @@
using namespace std;
+namespace Freestyle {
+
// Helper Classes
// OccluderData
@@ -240,3 +242,5 @@ Vec3r SphericalGrid::Transform::sphericalProjection(const Vec3r& M)
return newPoint;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/SphericalGrid.h b/source/blender/freestyle/intern/view_map/SphericalGrid.h
index 6691042b850..9551a0a3e95 100644
--- a/source/blender/freestyle/intern/view_map/SphericalGrid.h
+++ b/source/blender/freestyle/intern/view_map/SphericalGrid.h
@@ -49,6 +49,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
class SphericalGrid
{
public:
@@ -413,4 +415,6 @@ inline bool SphericalGrid::insertOccluder(OccluderSource& source, OccluderData*&
return occluder != NULL;
}
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_SPHERICAL_GRID_H__
diff --git a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
index 247c94c58e2..7693afdce07 100644
--- a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
+++ b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
@@ -45,6 +45,8 @@ extern "C" {
#include "IMB_imbuf_types.h"
}
+namespace Freestyle {
+
using namespace Geometry;
SteerableViewMap::SteerableViewMap(unsigned int nbOrientations)
@@ -293,3 +295,5 @@ void SteerableViewMap::saveSteerableViewMap() const
#endif
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/SteerableViewMap.h b/source/blender/freestyle/intern/view_map/SteerableViewMap.h
index 8ea20b3e63d..c70edcc9af2 100644
--- a/source/blender/freestyle/intern/view_map/SteerableViewMap.h
+++ b/source/blender/freestyle/intern/view_map/SteerableViewMap.h
@@ -34,10 +34,12 @@
#include "../system/FreestyleConfig.h"
-using namespace Geometry;
-
using namespace std;
+namespace Freestyle {
+
+using namespace Geometry;
+
class FEdge;
class ImagePyramid;
class GrayImage;
@@ -144,4 +146,6 @@ protected:
void Build();
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_STEERABLE_VIEW_MAP_H__
diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
index 0edf6863c79..91d077278fb 100644
--- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
@@ -35,6 +35,8 @@
using namespace std;
+namespace Freestyle {
+
void ViewEdgeXBuilder::Init(ViewShape *oVShape)
{
if (0 == oVShape)
@@ -744,3 +746,5 @@ ViewVertex *ViewEdgeXBuilder::MakeViewVertex(SVertex *iSVertex)
_pCurrentVShape->AddVertex(vva);
return vva;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h
index 91a2b41d89b..c1b228c13c6 100644
--- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h
+++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h
@@ -47,9 +47,12 @@
#include "../system/FreestyleConfig.h"
-using namespace Geometry;
using namespace std;
+namespace Freestyle {
+
+using namespace Geometry;
+
class SVertex;
/*! Defines a hash table used for searching the SVertex */
@@ -278,4 +281,6 @@ protected:
ViewShape *_pCurrentVShape;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_VIEW_EDGE_X_BUILDER_H__
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.cpp b/source/blender/freestyle/intern/view_map/ViewMap.cpp
index 44a26501e21..102581bf70f 100644
--- a/source/blender/freestyle/intern/view_map/ViewMap.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMap.cpp
@@ -33,6 +33,8 @@
#include "../geometry/GeomUtils.h"
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -745,3 +747,5 @@ void ViewEdge::UpdateFEdges()
// last one
_FEdgeB->setViewEdge(this);
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h
index 576e2f7a0ac..cd3dd7aafa2 100644
--- a/source/blender/freestyle/intern/view_map/ViewMap.h
+++ b/source/blender/freestyle/intern/view_map/ViewMap.h
@@ -39,6 +39,8 @@
#include "../system/BaseIterator.h"
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -1769,4 +1771,6 @@ inline real ViewEdge::curvature2d_as_angle(int iCombination) const
}
#endif
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_VIEW_MAP_H__
diff --git a/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h b/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
index 3b8a409812d..01e93ba77c7 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
+++ b/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
@@ -33,6 +33,8 @@
#include "../system/Iterator.h" //soc
+namespace Freestyle {
+
/**********************************/
/* */
/* */
@@ -779,4 +781,6 @@ protected:
} // end of namespace ViewEdgeInternal
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_VIEW_MAP_ADVANCED_ITERATORS_H__
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
index 1193b3407df..914a06eb27f 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
@@ -45,6 +45,8 @@
#include "BKE_global.h"
+namespace Freestyle {
+
// XXX Grmll... G is used as template's typename parameter :/
const Global &_global = G;
@@ -2382,3 +2384,5 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi
}
}
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.h b/source/blender/freestyle/intern/view_map/ViewMapBuilder.h
index 45aa28943cb..2fb98934ea9 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.h
+++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.h
@@ -52,6 +52,8 @@
#include "../winged_edge/WEdge.h"
#include "../winged_edge/WXEdge.h"
+namespace Freestyle {
+
using namespace Geometry;
class LIB_VIEW_MAP_EXPORT ViewMapBuilder
@@ -247,4 +249,6 @@ protected:
Vec3r& u, Vec3r& A, Vec3r& origin, Vec3r& edge, vector<WVertex*>& faceVertices);
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_VIEW_MAP_BUILDER_H__
diff --git a/source/blender/freestyle/intern/view_map/ViewMapIO.cpp b/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
index 8ca16ddd152..5df3e4e0d8f 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
@@ -52,6 +52,8 @@
(ptr) = NULL; \
} (void)0
+namespace Freestyle {
+
namespace ViewMapIO {
namespace Internal {
@@ -1249,3 +1251,5 @@ string getModelsPath()
} // End of namepace Options
} // End of namespace ViewMapIO
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/ViewMapIO.h b/source/blender/freestyle/intern/view_map/ViewMapIO.h
index 145c80a62da..e2223cd5734 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapIO.h
+++ b/source/blender/freestyle/intern/view_map/ViewMapIO.h
@@ -36,6 +36,8 @@
#include "../system/FreestyleConfig.h"
#include "../system/ProgressBar.h"
+namespace Freestyle {
+
namespace ViewMapIO {
static const unsigned ZERO = UINT_MAX;
@@ -119,4 +121,6 @@ istream& read<0>(istream& in, char *)
} // End of namespace ViewMapIO
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_VIEW_MAP_IO_H__
diff --git a/source/blender/freestyle/intern/view_map/ViewMapIterators.h b/source/blender/freestyle/intern/view_map/ViewMapIterators.h
index 49a411a1ee7..72d439da8bd 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapIterators.h
+++ b/source/blender/freestyle/intern/view_map/ViewMapIterators.h
@@ -32,6 +32,7 @@
#include "../system/Iterator.h" //soc
+namespace Freestyle {
/**********************************/
/* */
@@ -564,4 +565,6 @@ protected:
} // end of namespace ViewEdgeInternal
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_VIEW_MAP_ITERATORS_H__
diff --git a/source/blender/freestyle/intern/view_map/ViewMapTesselator.cpp b/source/blender/freestyle/intern/view_map/ViewMapTesselator.cpp
index 622449575ef..74716a927fc 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapTesselator.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapTesselator.cpp
@@ -27,6 +27,8 @@
#include "ViewMapTesselator.h"
+namespace Freestyle {
+
NodeGroup *ViewMapTesselator::Tesselate(ViewMap *iViewMap)
{
if (0 == iViewMap->ViewEdges().size())
@@ -40,3 +42,5 @@ NodeGroup *ViewMapTesselator::Tesselate(WShape *)
{
return NULL;
}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/view_map/ViewMapTesselator.h b/source/blender/freestyle/intern/view_map/ViewMapTesselator.h
index 7c689db0d78..7ba8c77a452 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapTesselator.h
+++ b/source/blender/freestyle/intern/view_map/ViewMapTesselator.h
@@ -39,6 +39,8 @@
#include "../winged_edge/WEdge.h"
+namespace Freestyle {
+
class NodeShape;
class NodeGroup;
class SShape;
@@ -201,4 +203,6 @@ NodeGroup *ViewMapTesselator::Tesselate(ViewEdgesIterator begin, ViewEdgesIterat
return group;
}
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_VIEW_MAP_TESSELATOR_H__
diff --git a/source/blender/freestyle/intern/winged_edge/Curvature.cpp b/source/blender/freestyle/intern/winged_edge/Curvature.cpp
index 4c791f0b45d..3d1cb907ed0 100644
--- a/source/blender/freestyle/intern/winged_edge/Curvature.cpp
+++ b/source/blender/freestyle/intern/winged_edge/Curvature.cpp
@@ -56,6 +56,8 @@
#include "../system/FreestyleConfig.h"
+namespace Freestyle {
+
static bool angle_obtuse(WVertex *v, WFace *f)
{
WOEdge *e;
@@ -637,3 +639,5 @@ void compute_curvature_tensor_one_ring(WVertex *start, NormalCycle& nc)
}
} // OGF namespace
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/winged_edge/Curvature.h b/source/blender/freestyle/intern/winged_edge/Curvature.h
index 97072dec83a..204610f1f10 100644
--- a/source/blender/freestyle/intern/winged_edge/Curvature.h
+++ b/source/blender/freestyle/intern/winged_edge/Curvature.h
@@ -51,6 +51,8 @@
#include "../system/FreestyleConfig.h"
#include "../system/Precision.h"
+namespace Freestyle {
+
using namespace Geometry;
class WVertex;
@@ -137,4 +139,6 @@ void LIB_WINGED_EDGE_EXPORT compute_curvature_tensor_one_ring(WVertex *start, No
} // OGF namespace
+} /* namespace Freestyle */
+
#endif /* __FREESTYLE_CURVATURE_H__ */
diff --git a/source/blender/freestyle/intern/winged_edge/Nature.h b/source/blender/freestyle/intern/winged_edge/Nature.h
index ec98607bbb3..99a3f902cd0 100644
--- a/source/blender/freestyle/intern/winged_edge/Nature.h
+++ b/source/blender/freestyle/intern/winged_edge/Nature.h
@@ -28,6 +28,8 @@
* \date 01/07/2003
*/
+namespace Freestyle {
+
/*! Namespace gathering the different possible natures of 0D and 1D elements of the ViewMap */
namespace Nature {
@@ -69,4 +71,6 @@ static const EdgeNature EDGE_MARK = (1 << 7); // 128
} // end of namespace Nature
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_NATURE_H__
diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.cpp b/source/blender/freestyle/intern/winged_edge/WEdge.cpp
index 27332bf5569..03d3cf65142 100644
--- a/source/blender/freestyle/intern/winged_edge/WEdge.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WEdge.cpp
@@ -29,6 +29,8 @@
#include "WEdge.h"
+namespace Freestyle {
+
/*! Temporary structures */
class vertexdata
{
@@ -704,4 +706,6 @@ WFace *WShape::MakeFace(vector<WVertex *>& iVertexList, vector<bool>& iFaceEdgeM
AddFace(face);
return face;
-} \ No newline at end of file
+}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.h b/source/blender/freestyle/intern/winged_edge/WEdge.h
index c92e12004b2..6f105afa864 100644
--- a/source/blender/freestyle/intern/winged_edge/WEdge.h
+++ b/source/blender/freestyle/intern/winged_edge/WEdge.h
@@ -39,6 +39,9 @@
#include "../system/FreestyleConfig.h"
using namespace std;
+
+namespace Freestyle {
+
using namespace Geometry;
@@ -1334,4 +1337,6 @@ inline void WOEdge::setVecAndAngle()
}
}
-#endif // __FREESTYLE_W_EDGE_H__ \ No newline at end of file
+} /* namespace Freestyle */
+
+#endif // __FREESTYLE_W_EDGE_H__
diff --git a/source/blender/freestyle/intern/winged_edge/WFillGrid.cpp b/source/blender/freestyle/intern/winged_edge/WFillGrid.cpp
index 78b1d783703..707a9033f13 100644
--- a/source/blender/freestyle/intern/winged_edge/WFillGrid.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WFillGrid.cpp
@@ -29,6 +29,8 @@
#include "WEdge.h"
#include "WFillGrid.h"
+namespace Freestyle {
+
void WFillGrid::fillGrid()
{
if (!_winged_edge || !_grid)
@@ -58,4 +60,6 @@ void WFillGrid::fillGrid()
}
faces.clear();
}
-} \ No newline at end of file
+}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/winged_edge/WFillGrid.h b/source/blender/freestyle/intern/winged_edge/WFillGrid.h
index 8d3bbcb84d2..a1b4ef25249 100644
--- a/source/blender/freestyle/intern/winged_edge/WFillGrid.h
+++ b/source/blender/freestyle/intern/winged_edge/WFillGrid.h
@@ -34,6 +34,8 @@
#include "../geometry/Grid.h"
#include "../geometry/Polygon.h"
+namespace Freestyle {
+
class LIB_WINGED_EDGE_EXPORT WFillGrid
{
public:
@@ -78,4 +80,6 @@ private:
unsigned _polygon_id;
};
-#endif // __FREESTYLE_W_FILL_GRID_H__ \ No newline at end of file
+} /* namespace Freestyle */
+
+#endif // __FREESTYLE_W_FILL_GRID_H__
diff --git a/source/blender/freestyle/intern/winged_edge/WSFillGrid.cpp b/source/blender/freestyle/intern/winged_edge/WSFillGrid.cpp
index 439ce729574..352603758f6 100644
--- a/source/blender/freestyle/intern/winged_edge/WSFillGrid.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WSFillGrid.cpp
@@ -28,6 +28,8 @@
#include "WEdge.h"
#include "WSFillGrid.h"
+namespace Freestyle {
+
void WSFillGrid::fillGrid()
{
if (!_winged_edge || !_grid)
@@ -57,4 +59,6 @@ void WSFillGrid::fillGrid()
}
faces.clear();
}
-} \ No newline at end of file
+}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/winged_edge/WSFillGrid.h b/source/blender/freestyle/intern/winged_edge/WSFillGrid.h
index 2243f814b4b..ee693de9ba1 100644
--- a/source/blender/freestyle/intern/winged_edge/WSFillGrid.h
+++ b/source/blender/freestyle/intern/winged_edge/WSFillGrid.h
@@ -33,6 +33,8 @@
#include "../geometry/Grid.h"
#include "../geometry/Polygon.h"
+namespace Freestyle {
+
class LIB_WINGED_EDGE_EXPORT WSFillGrid
{
public:
@@ -77,4 +79,6 @@ private:
unsigned _polygon_id;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_WS_FILL_GRID_H__ \ No newline at end of file
diff --git a/source/blender/freestyle/intern/winged_edge/WXEdge.cpp b/source/blender/freestyle/intern/winged_edge/WXEdge.cpp
index cdcaa13ad6f..88da9cf9f80 100644
--- a/source/blender/freestyle/intern/winged_edge/WXEdge.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WXEdge.cpp
@@ -28,6 +28,8 @@
#include "WXEdge.h"
#include "BKE_global.h"
+namespace Freestyle {
+
/**********************************
* *
* *
@@ -291,4 +293,6 @@ WFace *WXShape::MakeFace(vector<WVertex *>& iVertexList, vector<Vec3r>& iNormals
#endif
return face;
-} \ No newline at end of file
+}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/winged_edge/WXEdge.h b/source/blender/freestyle/intern/winged_edge/WXEdge.h
index 4ccf5a83c94..1ed47b53b3d 100644
--- a/source/blender/freestyle/intern/winged_edge/WXEdge.h
+++ b/source/blender/freestyle/intern/winged_edge/WXEdge.h
@@ -32,6 +32,8 @@
#include "Nature.h"
#include "WEdge.h"
+namespace Freestyle {
+
typedef Nature::EdgeNature WXNature;
/**********************************
@@ -799,4 +801,6 @@ bool WXVertex::isFeature()
return false;
}
-#endif // __FREESTYLE_WX_EDGE_H__ \ No newline at end of file
+} /* namespace Freestyle */
+
+#endif // __FREESTYLE_WX_EDGE_H__
diff --git a/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.cpp b/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.cpp
index 9d3c2e3a33d..eab638840e5 100644
--- a/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.cpp
@@ -29,6 +29,8 @@
#include "WXEdge.h"
#include "WXEdgeBuilder.h"
+namespace Freestyle {
+
void WXEdgeBuilder::visitIndexedFaceSet(IndexedFaceSet& ifs)
{
if (_pRenderMonitor && _pRenderMonitor->testBreak())
@@ -48,4 +50,6 @@ void WXEdgeBuilder::buildWVertices(WShape& shape, const real *vertices, unsigned
vertex->setId(i / 3);
shape.AddVertex(vertex);
}
-} \ No newline at end of file
+}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.h b/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.h
index beb38429da5..0c3e97f7806 100644
--- a/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.h
+++ b/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.h
@@ -33,6 +33,8 @@
#include "../scene_graph/IndexedFaceSet.h"
+namespace Freestyle {
+
class LIB_WINGED_EDGE_EXPORT WXEdgeBuilder : public WingedEdgeBuilder
{
public:
@@ -44,4 +46,6 @@ protected:
virtual void buildWVertices(WShape& shape, const real *vertices, unsigned vsize);
};
-#endif // __FREESTYLE_WX_EDGE_BUILDER_H__ \ No newline at end of file
+} /* namespace Freestyle */
+
+#endif // __FREESTYLE_WX_EDGE_BUILDER_H__
diff --git a/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp b/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp
index d3e86e49a67..c83abe85318 100644
--- a/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp
@@ -36,6 +36,8 @@
using namespace std;
+namespace Freestyle {
+
void WingedEdgeBuilder::visitIndexedFaceSet(IndexedFaceSet& ifs)
{
if (_pRenderMonitor && _pRenderMonitor->testBreak())
@@ -363,4 +365,6 @@ void WingedEdgeBuilder::transformNormals(const real *normals, unsigned nsize, co
n += 3;
pn += 3;
}
-} \ No newline at end of file
+}
+
+} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.h b/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.h
index a022913c016..d8a045adfa3 100644
--- a/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.h
+++ b/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.h
@@ -38,6 +38,8 @@
#include "../system/FreestyleConfig.h"
#include "../system/RenderMonitor.h"
+namespace Freestyle {
+
class LIB_WINGED_EDGE_EXPORT WingedEdgeBuilder : public SceneVisitor
{
public:
@@ -147,4 +149,6 @@ private:
vector<Matrix44r *> _matrices_stack;
};
+} /* namespace Freestyle */
+
#endif // __FREESTYLE_WINGED_EDGE_BUILDER_H__ \ No newline at end of file