[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28692] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/python: Removed partial implementations of the __copy__ method of some Python

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sun May 9 20:21:37 CEST 2010


Revision: 28692
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28692
Author:   kjym3
Date:     2010-05-09 20:21:36 +0200 (Sun, 09 May 2010)

Log Message:
-----------
Removed partial implementations of the __copy__ method of some Python
extension classes.  Copy constructors should be used to duplicate
objects.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp	2010-05-09 18:07:17 UTC (rev 28691)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp	2010-05-09 18:21:36 UTC (rev 28692)
@@ -100,18 +100,6 @@
 	return 0;
 }
 
-static PyObject * CurvePoint___copy__( BPy_CurvePoint *self ) {
-	BPy_CurvePoint *py_cp;
-	
-	py_cp = (BPy_CurvePoint *) CurvePoint_Type.tp_new( &CurvePoint_Type, 0, 0 );
-	
-	py_cp->cp = new CurvePoint( *(self->cp) );
-	py_cp->py_if0D.if0D = py_cp->cp;
-	py_cp->py_if0D.borrowed = 0;
-
-	return (PyObject *) py_cp;
-}
-
 static char CurvePoint_A___doc__[] =
 ".. method:: A()\n"
 "\n"
@@ -229,7 +217,6 @@
 
 /*----------------------CurvePoint instance definitions ----------------------------*/
 static PyMethodDef BPy_CurvePoint_methods[] = {	
-	{"__copy__", ( PyCFunction ) CurvePoint___copy__, METH_NOARGS, "() Cloning method."},
 	{"A", ( PyCFunction ) CurvePoint_A, METH_NOARGS, CurvePoint_A___doc__},
 	{"B", ( PyCFunction ) CurvePoint_B, METH_NOARGS, CurvePoint_B___doc__},
 	{"t2d", ( PyCFunction ) CurvePoint_t2d, METH_NOARGS, CurvePoint_t2d___doc__},

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp	2010-05-09 18:07:17 UTC (rev 28691)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp	2010-05-09 18:21:36 UTC (rev 28692)
@@ -70,18 +70,6 @@
 	return 0;
 }
 
-static PyObject * SVertex___copy__( BPy_SVertex *self ) {
-	BPy_SVertex *py_svertex;
-	
-	py_svertex = (BPy_SVertex *) SVertex_Type.tp_new( &SVertex_Type, 0, 0 );
-	
-	py_svertex->sv = self->sv->duplicate();
-	py_svertex->py_if0D.if0D = py_svertex->sv;
-	py_svertex->py_if0D.borrowed = 0;
-
-	return (PyObject *) py_svertex;
-}
-
 static char SVertex_normals___doc__[] =
 ".. method:: normals()\n"
 "\n"
@@ -252,7 +240,6 @@
 
 /*----------------------SVertex instance definitions ----------------------------*/
 static PyMethodDef BPy_SVertex_methods[] = {
-	{"__copy__", ( PyCFunction ) SVertex___copy__, METH_NOARGS, "() Cloning method."},
 	{"normals", ( PyCFunction ) SVertex_normals, METH_NOARGS, SVertex_normals___doc__},
 	{"normalsSize", ( PyCFunction ) SVertex_normalsSize, METH_NOARGS, SVertex_normalsSize___doc__},
 	{"viewvertex", ( PyCFunction ) SVertex_viewvertex, METH_NOARGS, SVertex_viewvertex___doc__},

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp	2010-05-09 18:07:17 UTC (rev 28691)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp	2010-05-09 18:21:36 UTC (rev 28692)
@@ -333,7 +333,6 @@
 
 /*----------------------StrokeVertex instance definitions ----------------------------*/
 static PyMethodDef BPy_StrokeVertex_methods[] = {	
-//	{"__copy__", ( PyCFunction ) StrokeVertex___copy__, METH_NOARGS, "() Cloning method."},
 	{"x", ( PyCFunction ) StrokeVertex_x, METH_NOARGS, StrokeVertex_x___doc__},
 	{"y", ( PyCFunction ) StrokeVertex_y, METH_NOARGS, StrokeVertex_y___doc__},
 	{"getPoint", ( PyCFunction ) StrokeVertex_getPoint, METH_NOARGS, StrokeVertex_getPoint___doc__},

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp	2010-05-09 18:07:17 UTC (rev 28691)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp	2010-05-09 18:21:36 UTC (rev 28692)
@@ -97,7 +97,6 @@
 
 /*----------------------NonTVertex instance definitions ----------------------------*/
 static PyMethodDef BPy_NonTVertex_methods[] = {	
-//	{"__copy__", ( PyCFunction ) NonTVertex___copy__, METH_NOARGS, "() Cloning method."},
 	{"svertex", ( PyCFunction ) NonTVertex_svertex, METH_NOARGS, NonTVertex_svertex___doc__},
 	{"setSVertex", ( PyCFunction ) NonTVertex_setSVertex, METH_VARARGS, NonTVertex_setSVertex___doc__},
 	{NULL, NULL, 0, NULL}

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp	2010-05-09 18:07:17 UTC (rev 28691)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp	2010-05-09 18:21:36 UTC (rev 28692)
@@ -188,7 +188,6 @@
 
 /*----------------------TVertex instance definitions ----------------------------*/
 static PyMethodDef BPy_TVertex_methods[] = {	
-//	{"__copy__", ( PyCFunction ) TVertex___copy__, METH_NOARGS, "() Cloning method."},
 	{"frontSVertex", ( PyCFunction ) TVertex_frontSVertex, METH_NOARGS, TVertex_frontSVertex___doc__},
 	{"backSVertex", ( PyCFunction ) TVertex_backSVertex, METH_NOARGS, TVertex_backSVertex___doc__},
 	{"setFrontSVertex", ( PyCFunction ) TVertex_setFrontSVertex, METH_VARARGS, TVertex_setFrontSVertex___doc__},

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp	2010-05-09 18:07:17 UTC (rev 28691)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp	2010-05-09 18:21:36 UTC (rev 28692)
@@ -72,19 +72,6 @@
 	return 0;
 }
 
-
-static PyObject * FEdge___copy__( BPy_FEdge *self ) {
-	BPy_FEdge *py_fe;
-	
-	py_fe = (BPy_FEdge *) FEdge_Type.tp_new( &FEdge_Type, 0, 0 );
-	
-	py_fe->fe = new FEdge( *(self->fe) );
-	py_fe->py_if1D.if1D = py_fe->fe;
-	py_fe->py_if1D.borrowed = 0;
-
-	return (PyObject *) py_fe;
-}
-
 static char FEdge_vertexA___doc__[] =
 ".. method:: vertexA()\n"
 "\n"
@@ -359,7 +346,6 @@
 /*----------------------FEdge instance definitions ----------------------------*/
 
 static PyMethodDef BPy_FEdge_methods[] = {	
-	{"__copy__", ( PyCFunction ) FEdge___copy__, METH_NOARGS, "() Cloning method."},
 	{"vertexA", ( PyCFunction ) FEdge_vertexA, METH_NOARGS, FEdge_vertexA___doc__},
 	{"vertexB", ( PyCFunction ) FEdge_vertexB, METH_NOARGS, FEdge_vertexB___doc__},
 	{"__getitem__", ( PyCFunction ) FEdge___getitem__, METH_VARARGS, "(int i) Returns the first SVertex if i=0, the seccond SVertex if i=1."},





More information about the Bf-blender-cvs mailing list