Removed partial implementations of the __copy__ method of some Python
extension classes. Copy constructors should be used to duplicate objects.
This commit is contained in:
@@ -100,18 +100,6 @@ static int CurvePoint___init__(BPy_CurvePoint *self, PyObject *args, PyObject *k
|
||||
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 @@ static PyObject *CurvePoint_curvatureFredo( BPy_CurvePoint *self , PyObject *arg
|
||||
|
||||
/*----------------------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__},
|
||||
|
||||
@@ -70,18 +70,6 @@ static int SVertex___init__(BPy_SVertex *self, PyObject *args, PyObject *kwds)
|
||||
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 @@ static PyObject *SVertex_AddFEdge( BPy_SVertex *self , PyObject *args) {
|
||||
|
||||
/*----------------------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__},
|
||||
|
||||
@@ -333,7 +333,6 @@ static PyObject *StrokeVertex_setStrokeLength( BPy_StrokeVertex *self , PyObject
|
||||
|
||||
/*----------------------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__},
|
||||
|
||||
@@ -97,7 +97,6 @@ static PyObject * NonTVertex_setSVertex( BPy_NonTVertex *self, PyObject *args) {
|
||||
|
||||
/*----------------------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}
|
||||
|
||||
@@ -188,7 +188,6 @@ static PyObject * TVertex_mate( BPy_TVertex *self, PyObject *args) {
|
||||
|
||||
/*----------------------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__},
|
||||
|
||||
@@ -72,19 +72,6 @@ static int FEdge___init__(BPy_FEdge *self, PyObject *args, PyObject *kwds)
|
||||
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 @@ static PyObject *FEdge_setSmooth( BPy_FEdge *self , PyObject *args) {
|
||||
/*----------------------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."},
|
||||
|
||||
Reference in New Issue
Block a user