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:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-07-25 01:32:50 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-07-25 01:32:50 +0400
commitfc97e91a3efd7dec5f21ec0a8ba6b81a1db7b72d (patch)
tree66c07b30df1403da92b1fbf8f97147291c74e620 /source/blender/freestyle
parent2860bc5d5b1b2495c52a64eb7b30490e24ca4a41 (diff)
soc-2008-mxcurioni: found and fixed all potential issues iterating over internal view-map data. The internal namespaces (ViewEdgeInternal, ViewVertexInternal, CurveInternal, StrokeInternal...) should NOT be included to prevent redefintion errors.
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r--source/blender/freestyle/intern/python/BPy_Convert.cpp7
-rw-r--r--source/blender/freestyle/intern/python/BPy_Convert.h13
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp6
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.h3
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp15
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.h3
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp4
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.h3
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp4
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.h3
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp4
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.h3
12 files changed, 42 insertions, 26 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp
index 9bc937b15d9..bab9da8332e 100644
--- a/source/blender/freestyle/intern/python/BPy_Convert.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp
@@ -9,6 +9,7 @@
#include "Interface0D/BPy_ViewVertex.h"
#include "Interface1D/BPy_FEdge.h"
#include "Interface1D/BPy_ViewEdge.h"
+#include "Iterator/BPy_orientedViewEdgeIterator.h"
#include "BPy_SShape.h"
#include "BPy_Nature.h"
#include "BPy_MediumType.h"
@@ -149,6 +150,12 @@ PyObject * BPy_SShape_from_SShape( SShape& ss ) {
return py_ss;
}
+PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ViewVertexInternal::orientedViewEdgeIterator& ove_it ) {
+ PyObject *py_ove_it = orientedViewEdgeIterator_Type.tp_new( &orientedViewEdgeIterator_Type, 0, 0 );
+ ((BPy_orientedViewEdgeIterator *) py_ove_it)->ove_it = new ViewVertexInternal::orientedViewEdgeIterator( ove_it );
+
+ return py_ove_it;
+}
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.h b/source/blender/freestyle/intern/python/BPy_Convert.h
index db0b5e589d2..87d902f28a8 100644
--- a/source/blender/freestyle/intern/python/BPy_Convert.h
+++ b/source/blender/freestyle/intern/python/BPy_Convert.h
@@ -1,6 +1,7 @@
#ifndef FREESTYLE_PYTHON_CONVERT_H
#define FREESTYLE_PYTHON_CONVERT_H
+
#include "../geometry/Geom.h"
using namespace Geometry;
@@ -22,6 +23,17 @@ using namespace Geometry;
// NonTVertex, TVertex, ViewEdge, ViewMap, ViewShape, ViewVertex
#include "../view_map/ViewMap.h"
+// ViewVertexInternal::orientedViewEdgeIterator
+// ViewEdgeInternal::SVertexIterator
+// ViewEdgeInternal::ViewEdgeIterator
+#include "../view_map/ViewMapIterators.h"
+//##################### IMPORTANT #####################
+// Do not use the following namespaces within this file :
+// - ViewVertexInternal
+// - ViewEdgeInternal
+//##########################################################
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -45,6 +57,7 @@ PyObject * BPy_Id_from_Id( Id& id );
PyObject * BPy_Interface0D_from_Interface0D( Interface0D& if0D );
PyObject * BPy_Nature_from_Nature( unsigned short n );
PyObject * BPy_MediumType_from_MediumType( int n );
+PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ViewVertexInternal::orientedViewEdgeIterator& ove_it );
PyObject * BPy_SShape_from_SShape( SShape& ss );
PyObject * BPy_StrokeAttribute_from_StrokeAttribute( StrokeAttribute& sa );
PyObject * BPy_StrokeVertex_from_StrokeVertex( StrokeVertex& sv );
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
index 72273e73a65..1f830261739 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
@@ -121,13 +121,13 @@ int CurvePointIterator___init__(BPy_CurvePointIterator *self, PyObject *args )
return -1;
if( !obj ){
- self->cp_it = new CurvePointIterator();
+ self->cp_it = new CurveInternal::CurvePointIterator();
} else if( BPy_CurvePointIterator_Check(obj) ) {
- self->cp_it = new CurvePointIterator(*( ((BPy_CurvePointIterator *) obj)->cp_it ));
+ self->cp_it = new CurveInternal::CurvePointIterator(*( ((BPy_CurvePointIterator *) obj)->cp_it ));
} else if( PyFloat_Check(obj) ) {
- self->cp_it = new CurvePointIterator( PyFloat_AsDouble(obj) );
+ self->cp_it = new CurveInternal::CurvePointIterator( PyFloat_AsDouble(obj) );
} else {
return -1;
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.h b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.h
index 652f6fffb97..e8f082216de 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.h
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.h
@@ -2,7 +2,6 @@
#define FREESTYLE_PYTHON_CURVEPOINTITERATOR_H
#include "../../stroke/CurveIterators.h"
-using namespace CurveInternal;
#include "../BPy_Iterator.h"
@@ -21,7 +20,7 @@ extern PyTypeObject CurvePointIterator_Type;
/*---------------------------Python BPy_CurvePointIterator structure definition----------*/
typedef struct {
BPy_Iterator py_it;
- CurvePointIterator *cp_it;
+ CurveInternal::CurvePointIterator *cp_it;
} BPy_CurvePointIterator;
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp
index be1f946302f..649447f1db6 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp
@@ -121,21 +121,22 @@ int SVertexIterator___init__(BPy_SVertexIterator *self, PyObject *args )
return -1;
if( !obj1 ){
- self->sv_it = new SVertexIterator();
+ self->sv_it = new ViewEdgeInternal::SVertexIterator();
} else if( BPy_SVertexIterator_Check(obj1) ) {
- self->sv_it = new SVertexIterator(*( ((BPy_SVertexIterator *) obj1)->sv_it ));
+ self->sv_it = new ViewEdgeInternal::SVertexIterator(*( ((BPy_SVertexIterator *) obj1)->sv_it ));
} else if( obj1 && BPy_SVertex_Check(obj1) &&
obj2 && BPy_SVertex_Check(obj2) &&
obj3 && BPy_FEdge_Check(obj3) &&
obj4 && BPy_FEdge_Check(obj4) ) {
- self->sv_it = new SVertexIterator( ((BPy_SVertex *) obj1)->sv,
- ((BPy_SVertex *) obj2)->sv,
- ((BPy_FEdge *) obj3)->fe,
- ((BPy_FEdge *) obj4)->fe,
- f );
+ self->sv_it = new ViewEdgeInternal::SVertexIterator(
+ ((BPy_SVertex *) obj1)->sv,
+ ((BPy_SVertex *) obj2)->sv,
+ ((BPy_FEdge *) obj3)->fe,
+ ((BPy_FEdge *) obj4)->fe,
+ f );
} else {
return -1;
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.h b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.h
index 662685571eb..ba6fbf020d0 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.h
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.h
@@ -2,7 +2,6 @@
#define FREESTYLE_PYTHON_SVERTEXITERATOR_H
#include "../../view_map/ViewMapIterators.h"
-using namespace ViewEdgeInternal;
#include "../BPy_Iterator.h"
@@ -22,7 +21,7 @@ extern PyTypeObject SVertexIterator_Type;
/*---------------------------Python BPy_SVertexIterator structure definition----------*/
typedef struct {
BPy_Iterator py_it;
- SVertexIterator *sv_it;
+ ViewEdgeInternal::SVertexIterator *sv_it;
} BPy_SVertexIterator;
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
index 72e41a37301..1f04be635c5 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
@@ -120,10 +120,10 @@ int StrokeVertexIterator___init__(BPy_StrokeVertexIterator *self, PyObject *args
return -1;
if( !obj ){
- self->sv_it = new StrokeVertexIterator();
+ self->sv_it = new StrokeInternal::StrokeVertexIterator();
} else if( BPy_StrokeVertexIterator_Check(obj) ) {
- self->sv_it = new StrokeVertexIterator(*( ((BPy_StrokeVertexIterator *) obj)->sv_it ));
+ self->sv_it = new StrokeInternal::StrokeVertexIterator(*( ((BPy_StrokeVertexIterator *) obj)->sv_it ));
} else {
return -1;
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.h b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.h
index 8d9ffc56018..488a1efea3d 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.h
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.h
@@ -2,7 +2,6 @@
#define FREESTYLE_PYTHON_STROKEVERTEXITERATOR_H
#include "../../stroke/StrokeIterators.h"
-using namespace StrokeInternal;
#include "../BPy_Iterator.h"
@@ -21,7 +20,7 @@ extern PyTypeObject StrokeVertexIterator_Type;
/*---------------------------Python BPy_StrokeVertexIterator structure definition----------*/
typedef struct {
BPy_Iterator py_it;
- StrokeVertexIterator *sv_it;
+ StrokeInternal::StrokeVertexIterator *sv_it;
} BPy_StrokeVertexIterator;
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp
index e5de7769fbb..2256d374c0c 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp
@@ -115,13 +115,13 @@ int ViewEdgeIterator___init__(BPy_ViewEdgeIterator *self, PyObject *args )
return -1;
if( obj1 && BPy_ViewEdgeIterator_Check(obj1) ) {
- self->ve_it = new ViewEdgeIterator(*( ((BPy_ViewEdgeIterator *) obj1)->ve_it ));
+ self->ve_it = new ViewEdgeInternal::ViewEdgeIterator(*( ((BPy_ViewEdgeIterator *) obj1)->ve_it ));
} else {
ViewEdge *begin = ( obj1 && BPy_ViewEdge_Check(obj1) ) ? ((BPy_ViewEdge *) obj1)->ve : 0;
bool orientation = ( obj2 && PyBool_Check(obj2) ) ? bool_from_PyBool(obj2) : true;
- self->ve_it = new ViewEdgeIterator( begin, orientation);
+ self->ve_it = new ViewEdgeInternal::ViewEdgeIterator( begin, orientation);
}
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.h b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.h
index 35d2f3f255b..a86547c5937 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.h
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.h
@@ -3,7 +3,6 @@
#include "../../view_map/ViewMapIterators.h"
-using namespace ViewEdgeInternal;
#include "../BPy_Iterator.h"
@@ -22,7 +21,7 @@ extern PyTypeObject ViewEdgeIterator_Type;
/*---------------------------Python BPy_ViewEdgeIterator structure definition----------*/
typedef struct {
BPy_Iterator py_it;
- ViewEdgeIterator *ve_it;
+ ViewEdgeInternal::ViewEdgeIterator *ve_it;
} BPy_ViewEdgeIterator;
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp
index 0622481f412..ec6850c3b96 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp
@@ -112,9 +112,9 @@ int orientedViewEdgeIterator___init__(BPy_orientedViewEdgeIterator *self, PyObje
return -1;
if( !obj )
- self->ove_it = new orientedViewEdgeIterator();
+ self->ove_it = new ViewVertexInternal::orientedViewEdgeIterator();
else if( BPy_orientedViewEdgeIterator_Check(obj) )
- self->ove_it = new orientedViewEdgeIterator(*( ((BPy_orientedViewEdgeIterator *) obj)->ove_it ));
+ self->ove_it = new ViewVertexInternal::orientedViewEdgeIterator(*( ((BPy_orientedViewEdgeIterator *) obj)->ove_it ));
self->py_it.it = self->ove_it;
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.h b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.h
index 60754939220..1c8a25258b7 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.h
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.h
@@ -3,7 +3,6 @@
#include "../../stroke/Stroke.h"
#include "../../view_map/ViewMapIterators.h"
-using namespace ViewVertexInternal;
#include "../BPy_Iterator.h"
@@ -22,7 +21,7 @@ extern PyTypeObject orientedViewEdgeIterator_Type;
/*---------------------------Python BPy_orientedViewEdgeIterator structure definition----------*/
typedef struct {
BPy_Iterator py_it;
- orientedViewEdgeIterator *ove_it;
+ ViewVertexInternal::orientedViewEdgeIterator *ove_it;
} BPy_orientedViewEdgeIterator;
///////////////////////////////////////////////////////////////////////////////////////////