diff options
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double')
14 files changed, 538 insertions, 255 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp index c78aa624c61..da80aaa0b6e 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp @@ -10,9 +10,38 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for Curvature2DAngleF1D instance -----------*/ -static int Curvature2DAngleF1D___init__(BPy_Curvature2DAngleF1D* self, PyObject *args); +//------------------------INSTANCE METHODS ---------------------------------- + +static char Curvature2DAngleF1D___doc__[] = +".. method:: __init__(iType=IntegrationType.MEAN)\n" +"\n" +" Builds a Curvature2DAngleF1D object.\n" +"\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the 2D curvature as an angle for an Interface1D.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The 2D curvature as an angle.\n" +" :rtype: float\n"; +static int Curvature2DAngleF1D___init__( BPy_Curvature2DAngleF1D* self, PyObject *args) +{ + PyObject *obj = 0; + + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::Curvature2DAngleF1D(t); + return 0; + +} /*-----------------------BPy_Curvature2DAngleF1D type definition ------------------------------*/ PyTypeObject Curvature2DAngleF1D_Type = { @@ -36,7 +65,7 @@ PyTypeObject Curvature2DAngleF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "Curvature2DAngleF1D objects", /* tp_doc */ + Curvature2DAngleF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,20 +85,6 @@ PyTypeObject Curvature2DAngleF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int Curvature2DAngleF1D___init__( BPy_Curvature2DAngleF1D* self, PyObject *args) -{ - PyObject *obj = 0; - - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::Curvature2DAngleF1D(t); - return 0; - -} /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp index f30a1e1c236..7035375a3f6 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp @@ -10,8 +10,52 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for DensityF1D instance -----------*/ -static int DensityF1D___init__(BPy_DensityF1D* self, PyObject *args); +//------------------------INSTANCE METHODS ---------------------------------- + +static char DensityF1D___doc__[] = +".. method:: __init__(sigma=2.0, iType=IntegrationType.MEAN, sampling=2.0)\n" +"\n" +" Builds a DensityF1D object.\n" +"\n" +" :arg sigma: The sigma used in DensityF0D and determining the window size\n" +" used in each density query.\n" +" :type sigma: float\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +" :arg sampling: The resolution used to sample the chain: the\n" +" corresponding 0D function is evaluated at each sample point and\n" +" the result is obtained by combining the resulting values into a\n" +" single one, following the method specified by iType.\n" +" :type sampling: float\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the density evaluated for an Interface1D. The density is\n" +" evaluated for a set of points along the Interface1D (using the\n" +" :class:`DensityF0D` functor) with a user-defined sampling and then\n" +" integrated into a single value using a user-defined integration\n" +" method.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The density evaluated for an Interface1D.\n" +" :rtype: float\n"; + +static int DensityF1D___init__( BPy_DensityF1D* self, PyObject *args) +{ + PyObject *obj = 0; + double d = 2.0; + float f = 2.0; + + if( !PyArg_ParseTuple(args, "|dO!f", &d, &IntegrationType_Type, &obj, &f) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::DensityF1D(d,t,f); + return 0; + +} /*-----------------------BPy_DensityF1D type definition ------------------------------*/ @@ -36,7 +80,7 @@ PyTypeObject DensityF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "DensityF1D objects", /* tp_doc */ + DensityF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,23 +100,6 @@ PyTypeObject DensityF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int DensityF1D___init__( BPy_DensityF1D* self, PyObject *args) -{ - PyObject *obj = 0; - double d = 2.0; - float f = 2.0; - - if( !PyArg_ParseTuple(args, "|dO!f", &d, &IntegrationType_Type, &obj, &f) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::DensityF1D(d,t,f); - return 0; - -} - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp index e4525a42533..5343d9e3236 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp @@ -10,8 +10,53 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetCompleteViewMapDensityF1D instance -----------*/ -static int GetCompleteViewMapDensityF1D___init__(BPy_GetCompleteViewMapDensityF1D* self, PyObject *args); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetCompleteViewMapDensityF1D___doc__[] = +".. method:: __init__(level, iType=IntegrationType.MEAN, sampling=2.0)\n" +"\n" +" Builds a GetCompleteViewMapDensityF1D object.\n" +"\n" +" :arg level: The level of the pyramid from which the pixel must be\n" +" read.\n" +" :type level: int\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +" :arg sampling: The resolution used to sample the chain: the\n" +" corresponding 0D function is evaluated at each sample point and\n" +" the result is obtained by combining the resulting values into a\n" +" single one, following the method specified by iType.\n" +" :type sampling: float\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the density evaluated for an Interface1D in the complete\n" +" viewmap image. The density is evaluated for a set of points along\n" +" the Interface1D (using the :class:`ReadCompleteViewMapPixelF0D`\n" +" functor) and then integrated into a single value using a\n" +" user-defined integration method.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The density evaluated for the Interface1D in the complete\n" +" viewmap image.\n" +" :rtype: float\n"; + +static int GetCompleteViewMapDensityF1D___init__( BPy_GetCompleteViewMapDensityF1D* self, PyObject *args) +{ + PyObject *obj = 0; + unsigned i; + float f = 2.0; + + if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetCompleteViewMapDensityF1D(i,t,f); + return 0; + +} /*-----------------------BPy_GetCompleteViewMapDensityF1D type definition ------------------------------*/ @@ -36,7 +81,7 @@ PyTypeObject GetCompleteViewMapDensityF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetCompleteViewMapDensityF1D objects", /* tp_doc */ + GetCompleteViewMapDensityF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,23 +101,6 @@ PyTypeObject GetCompleteViewMapDensityF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetCompleteViewMapDensityF1D___init__( BPy_GetCompleteViewMapDensityF1D* self, PyObject *args) -{ - PyObject *obj = 0; - unsigned i; - float f = 2.0; - - if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetCompleteViewMapDensityF1D(i,t,f); - return 0; - -} - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp index 689ee289a1a..5f543c30027 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp @@ -10,8 +10,57 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetDirectionalViewMapDensityF1D instance -----------*/ -static int GetDirectionalViewMapDensityF1D___init__(BPy_GetDirectionalViewMapDensityF1D* self, PyObject *args); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetDirectionalViewMapDensityF1D___doc__[] = +".. method:: __init__(iOrientation, level, iType=IntegrationType.MEAN, sampling=2.0)\n" +"\n" +" Builds a GetDirectionalViewMapDensityF1D object.\n" +"\n" +" :arg iOrientation: The number of the directional map we must work\n" +" with.\n" +" :type iOrientation: int\n" +" :arg level: The level of the pyramid from which the pixel must be\n" +" read.\n" +" :type level: int\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +" :arg sampling: The resolution used to sample the chain: the\n" +" corresponding 0D function is evaluated at each sample point and\n" +" the result is obtained by combining the resulting values into a\n" +" single one, following the method specified by iType.\n" +" :type sampling: float\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the density evaluated for an Interface1D in of the\n" +" steerable viewmaps image. The direction telling which Directional\n" +" map to choose is explicitely specified by the user. The density is\n" +" evaluated for a set of points along the Interface1D (using the\n" +" :class:`ReadSteerableViewMapPixelF0D` functor) and then integrated\n" +" into a single value using a user-defined integration method.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: the density evaluated for an Interface1D in of the\n" +" steerable viewmaps image.\n" +" :rtype: float\n"; + +static int GetDirectionalViewMapDensityF1D___init__( BPy_GetDirectionalViewMapDensityF1D* self, PyObject *args) +{ + PyObject *obj = 0; + unsigned int u1, u2; + float f = 2.0; + + if( !PyArg_ParseTuple(args, "II|O!f", &u1, &u2, &IntegrationType_Type, &obj, &f) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetDirectionalViewMapDensityF1D(u1, u2, t, f); + return 0; + +} /*-----------------------BPy_GetDirectionalViewMapDensityF1D type definition ------------------------------*/ @@ -36,7 +85,7 @@ PyTypeObject GetDirectionalViewMapDensityF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetDirectionalViewMapDensityF1D objects", /* tp_doc */ + GetDirectionalViewMapDensityF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,23 +105,6 @@ PyTypeObject GetDirectionalViewMapDensityF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetDirectionalViewMapDensityF1D___init__( BPy_GetDirectionalViewMapDensityF1D* self, PyObject *args) -{ - PyObject *obj = 0; - unsigned int u1, u2; - float f = 2.0; - - if( !PyArg_ParseTuple(args, "II|O!f", &u1, &u2, &IntegrationType_Type, &obj, &f) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetDirectionalViewMapDensityF1D(u1, u2, t, f); - return 0; - -} - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp index 126832c487f..3c8fa2f1f0f 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp @@ -10,8 +10,38 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetProjectedXF1D instance -----------*/ -static int GetProjectedXF1D___init__(BPy_GetProjectedXF1D* self, PyObject *args ); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetProjectedXF1D___doc__[] = +".. method:: __init__(iType=IntegrationType.MEAN)\n" +"\n" +" Builds a GetProjectedXF1D object.\n" +"\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values. \n" +" :type iType: :class:`IntegrationType`\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the projected X 3D coordinate of an Interface1D.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The projected X 3D coordinate of an Interface1D.\n" +" :rtype: float\n"; + +static int GetProjectedXF1D___init__( BPy_GetProjectedXF1D* self, PyObject *args ) +{ + PyObject *obj = 0; + + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedXF1D(t); + return 0; +} + /*-----------------------BPy_GetProjectedXF1D type definition ------------------------------*/ @@ -36,7 +66,7 @@ PyTypeObject GetProjectedXF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetProjectedXF1D objects", /* tp_doc */ + GetProjectedXF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,21 +86,6 @@ PyTypeObject GetProjectedXF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetProjectedXF1D___init__( BPy_GetProjectedXF1D* self, PyObject *args ) -{ - PyObject *obj = 0; - - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedXF1D(t); - return 0; -} - - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp index 6e27c1cfe45..ce655172778 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp @@ -10,8 +10,37 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetProjectedYF1D instance -----------*/ - static int GetProjectedYF1D___init__(BPy_GetProjectedYF1D* self, PyObject *args ); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetProjectedYF1D___doc__[] = +".. method:: __init__(iType=IntegrationType.MEAN)\n" +"\n" +" Builds a GetProjectedYF1D object.\n" +"\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values. \n" +" :type iType: :class:`IntegrationType`\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the projected Y 3D coordinate of an Interface1D.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The projected Y 3D coordinate of an Interface1D.\n" +" :rtype: float\n"; + +static int GetProjectedYF1D___init__( BPy_GetProjectedYF1D* self, PyObject *args ) +{ + PyObject *obj = 0; + + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedYF1D(t); + return 0; +} /*-----------------------BPy_GetProjectedYF1D type definition ------------------------------*/ @@ -36,7 +65,7 @@ PyTypeObject GetProjectedYF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetProjectedYF1D objects", /* tp_doc */ + GetProjectedYF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,20 +85,6 @@ PyTypeObject GetProjectedYF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetProjectedYF1D___init__( BPy_GetProjectedYF1D* self, PyObject *args ) -{ - PyObject *obj = 0; - - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedYF1D(t); - return 0; -} - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp index 7d395e75ce4..df1cefeab4c 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp @@ -10,8 +10,37 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetProjectedZF1D instance -----------*/ -static int GetProjectedZF1D___init__(BPy_GetProjectedZF1D* self, PyObject *args ); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetProjectedZF1D___doc__[] = +".. method:: __init__(iType=IntegrationType.MEAN)\n" +"\n" +" Builds a GetProjectedZF1D object.\n" +"\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values. \n" +" :type iType: :class:`IntegrationType`\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the projected Z 3D coordinate of an Interface1D.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The projected Z 3D coordinate of an Interface1D.\n" +" :rtype: float\n"; + +static int GetProjectedZF1D___init__( BPy_GetProjectedZF1D* self, PyObject *args ) +{ + PyObject *obj = 0; + + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedZF1D(t); + return 0; +} /*-----------------------BPy_GetProjectedZF1D type definition ------------------------------*/ @@ -36,7 +65,7 @@ PyTypeObject GetProjectedZF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetProjectedZF1D objects", /* tp_doc */ + GetProjectedZF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,20 +85,6 @@ PyTypeObject GetProjectedZF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetProjectedZF1D___init__( BPy_GetProjectedZF1D* self, PyObject *args ) -{ - PyObject *obj = 0; - - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedZF1D(t); - return 0; -} - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp index dbc7ad5bbf0..7cd08a2da0b 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp @@ -10,8 +10,50 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetSteerableViewMapDensityF1D instance -----------*/ -static int GetSteerableViewMapDensityF1D___init__(BPy_GetSteerableViewMapDensityF1D* self, PyObject *args); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetSteerableViewMapDensityF1D___doc__[] = +".. method:: __init__(level, iType=IntegrationType.MEAN, sampling=2.0)\n" +"\n" +" Builds a GetSteerableViewMapDensityF1D object.\n" +"\n" +" :arg level: The level of the pyramid from which the pixel must be\n" +" read.\n" +" :type level: int\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +" :arg sampling: The resolution used to sample the chain: the\n" +" corresponding 0D function is evaluated at each sample point and\n" +" the result is obtained by combining the resulting values into a\n" +" single one, following the method specified by iType.\n" +" :type sampling: float\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the density of the ViewMap for a given Interface1D. The\n" +" density of each :class:`FEdge` is evaluated in the proper steerable\n" +" :class:`ViewMap` depending on its orientation.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The density of the ViewMap for a given Interface1D.\n" +" :rtype: float\n"; + +static int GetSteerableViewMapDensityF1D___init__( BPy_GetSteerableViewMapDensityF1D* self, PyObject *args) +{ + PyObject *obj = 0; + int i; + float f = 2.0; + + if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetSteerableViewMapDensityF1D(i,t,f); + return 0; + +} /*-----------------------BPy_GetSteerableViewMapDensityF1D type definition ------------------------------*/ @@ -36,7 +78,7 @@ PyTypeObject GetSteerableViewMapDensityF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetSteerableViewMapDensityF1D objects", /* tp_doc */ + GetSteerableViewMapDensityF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,23 +98,6 @@ PyTypeObject GetSteerableViewMapDensityF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetSteerableViewMapDensityF1D___init__( BPy_GetSteerableViewMapDensityF1D* self, PyObject *args) -{ - PyObject *obj = 0; - int i; - float f = 2.0; - - if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetSteerableViewMapDensityF1D(i,t,f); - return 0; - -} - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp index 2b9878d3fd2..b34d56b37d3 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp @@ -10,8 +10,50 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetViewMapGradientNormF1D instance -----------*/ -static int GetViewMapGradientNormF1D___init__(BPy_GetViewMapGradientNormF1D* self, PyObject *args); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetViewMapGradientNormF1D___doc__[] = +".. method:: __init__()\n" +"\n" +" Builds a GetViewMapGradientNormF1D object.\n" +"\n" +" :arg level: The level of the pyramid from which the pixel must be\n" +" read.\n" +" :type level: int\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +" :arg sampling: The resolution used to sample the chain: the\n" +" corresponding 0D function is evaluated at each sample point and\n" +" the result is obtained by combining the resulting values into a\n" +" single one, following the method specified by iType.\n" +" :type sampling: float\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the density of the ViewMap for a given Interface1D. The\n" +" density of each :class:`FEdge` is evaluated in the proper steerable\n" +" :class:`ViewMap` depending on its orientation.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The density of the ViewMap for a given Interface1D.\n" +" :rtype: float\n"; + +static int GetViewMapGradientNormF1D___init__( BPy_GetViewMapGradientNormF1D* self, PyObject *args) +{ + PyObject *obj = 0; + int i; + float f = 2.0; + + if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetViewMapGradientNormF1D(i,t,f); + return 0; + +} /*-----------------------BPy_GetViewMapGradientNormF1D type definition ------------------------------*/ @@ -36,7 +78,7 @@ PyTypeObject GetViewMapGradientNormF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetViewMapGradientNormF1D objects", /* tp_doc */ + GetViewMapGradientNormF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,23 +98,6 @@ PyTypeObject GetViewMapGradientNormF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetViewMapGradientNormF1D___init__( BPy_GetViewMapGradientNormF1D* self, PyObject *args) -{ - PyObject *obj = 0; - int i; - float f = 2.0; - - if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetViewMapGradientNormF1D(i,t,f); - return 0; - -} - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp index b40969e07cd..6bbf15c0af2 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp @@ -10,8 +10,38 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetXF1D instance -----------*/ -static int GetXF1D___init__(BPy_GetXF1D* self, PyObject *args ); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetXF1D___doc__[] = +".. method:: __init__(iType)\n" +"\n" +" Builds a GetXF1D object.\n" +"\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the X 3D coordinate of an Interface1D.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The X 3D coordinate of the Interface1D.\n" +" :rtype: float\n"; + +static int GetXF1D___init__( BPy_GetXF1D* self, PyObject *args ) +{ + PyObject *obj = 0; + + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetXF1D(t); + return 0; +} + /*-----------------------BPy_GetXF1D type definition ------------------------------*/ @@ -36,7 +66,7 @@ PyTypeObject GetXF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetXF1D objects", /* tp_doc */ + GetXF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,21 +86,6 @@ PyTypeObject GetXF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetXF1D___init__( BPy_GetXF1D* self, PyObject *args ) -{ - PyObject *obj = 0; - - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetXF1D(t); - return 0; -} - - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp index dd38caa626c..7275ea3dcf2 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp @@ -10,9 +10,37 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetYF1D instance -----------*/ -static int GetYF1D___init__(BPy_GetYF1D* self, PyObject *args ); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetYF1D___doc__[] = +".. method:: __init__(iType)\n" +"\n" +" Builds a GetYF1D object.\n" +"\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the Y 3D coordinate of an Interface1D.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The Y 3D coordinate of the Interface1D.\n" +" :rtype: float\n"; + +static int GetYF1D___init__( BPy_GetYF1D* self, PyObject *args ) +{ + PyObject *obj = 0; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetYF1D(t); + return 0; +} /*-----------------------BPy_GetYF1D type definition ------------------------------*/ PyTypeObject GetYF1D_Type = { @@ -36,7 +64,7 @@ PyTypeObject GetYF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetYF1D objects", /* tp_doc */ + GetYF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,19 +84,6 @@ PyTypeObject GetYF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetYF1D___init__( BPy_GetYF1D* self, PyObject *args ) -{ - PyObject *obj = 0; - - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetYF1D(t); - return 0; -} /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp index ae0ed09c390..68f4f5e4300 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp @@ -10,8 +10,37 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for GetZF1D instance -----------*/ -static int GetZF1D___init__(BPy_GetZF1D* self, PyObject *args ); +//------------------------INSTANCE METHODS ---------------------------------- + +static char GetZF1D___doc__[] = +".. method:: __init__(iType)\n" +"\n" +" Builds a GetZF1D object.\n" +"\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the Z 3D coordinate of an Interface1D.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The Z 3D coordinate of the Interface1D.\n" +" :rtype: float\n"; + +static int GetZF1D___init__( BPy_GetZF1D* self, PyObject *args ) +{ + PyObject *obj = 0; + + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::GetZF1D(t); + return 0; +} /*-----------------------BPy_GetZF1D type definition ------------------------------*/ @@ -36,7 +65,7 @@ PyTypeObject GetZF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "GetZF1D objects", /* tp_doc */ + GetZF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,20 +85,6 @@ PyTypeObject GetZF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int GetZF1D___init__( BPy_GetZF1D* self, PyObject *args ) -{ - PyObject *obj = 0; - - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::GetZF1D(t); - return 0; -} - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp index 23c8c9b9924..be262632466 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp @@ -10,9 +10,45 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for LocalAverageDepthF1D instance -----------*/ -static int LocalAverageDepthF1D___init__(BPy_LocalAverageDepthF1D* self, PyObject *args); +//------------------------INSTANCE METHODS ---------------------------------- + +static char LocalAverageDepthF1D___doc__[] = +".. method:: __init__(sigma, iType=IntegrationType.MEAN)\n" +"\n" +" Builds a LocalAverageDepthF1D object.\n" +"\n" +" :arg sigma: The sigma used in DensityF0D and determining the window\n" +" size used in each density query.\n" +" :type sigma: float\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns the average depth evaluated for an Interface1D. The\n" +" average depth is evaluated for a set of points along the\n" +" Interface1D (using the :class:`LocalAverageDepthF0D` functor) with\n" +" a user-defined sampling and then integrated into a single value\n" +" using a user-defined integration method.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The average depth evaluated for the Interface1D.\n" +" :rtype: float\n"; +static int LocalAverageDepthF1D___init__( BPy_LocalAverageDepthF1D* self, PyObject *args) +{ + PyObject *obj = 0; + double d; + + if( !PyArg_ParseTuple(args, "d|O!", &d, &IntegrationType_Type, &obj) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::LocalAverageDepthF1D(d,t); + return 0; +} /*-----------------------BPy_LocalAverageDepthF1D type definition ------------------------------*/ PyTypeObject LocalAverageDepthF1D_Type = { @@ -36,7 +72,7 @@ PyTypeObject LocalAverageDepthF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "LocalAverageDepthF1D objects", /* tp_doc */ + LocalAverageDepthF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,20 +92,6 @@ PyTypeObject LocalAverageDepthF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int LocalAverageDepthF1D___init__( BPy_LocalAverageDepthF1D* self, PyObject *args) -{ - PyObject *obj = 0; - double d; - - if( !PyArg_ParseTuple(args, "d|O!", &d, &IntegrationType_Type, &obj) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::LocalAverageDepthF1D(d,t); - return 0; -} /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp index 5a498794284..0640644ea1e 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp @@ -10,8 +10,42 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -/*--------------- Python API function prototypes for ZDiscontinuityF1D instance -----------*/ -static int ZDiscontinuityF1D___init__(BPy_ZDiscontinuityF1D* self, PyObject *args ); +//------------------------INSTANCE METHODS ---------------------------------- + +static char ZDiscontinuityF1D___doc__[] = +".. method:: __init__(iType=IntegrationType.MEAN)\n" +"\n" +" Builds a ZDiscontinuityF1D object.\n" +"\n" +" :arg iType: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type iType: :class:`IntegrationType`\n" +"\n" +".. method:: __call__(inter)\n" +"\n" +" Returns a real value giving the distance between an Interface1D\n" +" and the shape that lies behind (occludee). This distance is\n" +" evaluated in the camera space and normalized between 0 and 1.\n" +" Therefore, if no oject is occluded by the shape to which the\n" +" Interface1D belongs to, 1 is returned.\n" +"\n" +" :arg inter: An Interface1D object.\n" +" :type inter: :class:`Interface1D`\n" +" :return: The normalized distance between the Interface1D and the occludee.\n" +" :rtype: float\n"; + +static int ZDiscontinuityF1D___init__( BPy_ZDiscontinuityF1D* self, PyObject *args ) +{ + PyObject *obj = 0; + + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) + return -1; + + IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_uf1D_double.uf1D_double = new Functions1D::ZDiscontinuityF1D(t); + return 0; +} + /*-----------------------BPy_ZDiscontinuityF1D type definition ------------------------------*/ @@ -36,7 +70,7 @@ PyTypeObject ZDiscontinuityF1D_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "ZDiscontinuityF1D objects", /* tp_doc */ + ZDiscontinuityF1D___doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ @@ -56,21 +90,6 @@ PyTypeObject ZDiscontinuityF1D_Type = { 0, /* tp_new */ }; -//------------------------INSTANCE METHODS ---------------------------------- - -int ZDiscontinuityF1D___init__( BPy_ZDiscontinuityF1D* self, PyObject *args ) -{ - PyObject *obj = 0; - - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) - return -1; - - IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; - self->py_uf1D_double.uf1D_double = new Functions1D::ZDiscontinuityF1D(t); - return 0; -} - - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus |