Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-04-09 04:46:49 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-04-09 04:46:49 +0400
commit800f86c8454ced85c29d1dcb04dcb163689a89d3 (patch)
tree4598a2ea78a1d1cf6a4c0a9e7030de4c826a006d /source/blender/freestyle/intern/winged_edge
parente6bd510dde6289efcead80e3d21cb21876282a56 (diff)
Attempt to fix a potential name conflict between Freestyle and the compositor.
A crash in the Freestyle renderer was reported by Ton on IRC with a stack trace below. Note that #2 is in Freestyle, whereas #1 is in the compositor. The problem was observed in a debug build on OS X 10.7 (gcc 4.2, openmp disabled, no llvm). ---------------------------------------------------------------------- Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 [Switching to process 72386 thread 0xf303] 0x0000000100c129f3 in NodeBase::~NodeBase (this=0x10e501c80) at COM_NodeBase.cpp:43 43 delete (this->m_outputsockets.back()); Current language: auto; currently c++ (gdb) where #0 0x0000000100c129f3 in NodeBase::~NodeBase (this=0x10e501c80) at COM_NodeBase.cpp:43 #1 0x0000000100c29066 in Node::~Node (this=0x10e501c80) at COM_Node.h:49 #2 0x000000010089c273 in NodeShape::~NodeShape (this=0x10e501c80) at NodeShape.cpp:43 #3 0x000000010089910b in NodeGroup::destroy (this=0x10e501da0) at NodeGroup.cpp:61 #4 0x00000001008990cd in NodeGroup::destroy (this=0x10e5014b0) at NodeGroup.cpp:59 #5 0x00000001008990cd in NodeGroup::destroy (this=0x114e18da0) at NodeGroup.cpp:59 #6 0x00000001007e6602 in Controller::ClearRootNode (this=0x114e19640) at Controller.cpp:329 #7 0x00000001007ea52e in Controller::LoadMesh (this=0x114e19640, re=0x10aba4638, srl=0x1140f5258) at Controller.cpp:302 #8 0x00000001008030ad in prepare (re=0x10aba4638, srl=0x1140f5258) at FRS_freestyle.cpp:302 #9 0x000000010080457a in FRS_do_stroke_rendering (re=0x10aba4638, srl=0x1140f5258) at FRS_freestyle.cpp:600 #10 0x00000001006aeb9d in add_freestyle (re=0x10aba4638) at pipeline.c:1584 #11 0x00000001006aceb7 in do_render_3d (re=0x10aba4638) at pipeline.c:1094 #12 0x00000001006ae061 in do_render_fields_blur_3d (re=0x10aba4638) at pipeline.c:1367 #13 0x00000001006afa16 in do_render_composite_fields_blur_3d (re=0x10aba4638) at pipeline.c:1815 #14 0x00000001006b04e4 in do_render_all_options (re=0x10aba4638) at pipeline.c:2021 ---------------------------------------------------------------------- Apparently a name conflict between the two Blender modules is taking place. The present commit hence intends to address it by putting all the Freestyle C++ classes in the namespace 'Freestyle'. This revision will also prevent potential name conflicts with other Blender modules in the future. Special thanks to Lukas Toenne for the help with C++ namespace.
Diffstat (limited to 'source/blender/freestyle/intern/winged_edge')
-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
15 files changed, 71 insertions, 10 deletions
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