Freestyle Python API improvements - part 6.

Fix for PyGetSetDef and proper handling of keyword arguments were done in
Function0D and Function1D classes.  Additional code clean-up was also made.
This commit is contained in:
2013-02-22 01:57:20 +00:00
parent 6cd036ab96
commit 33f34e1a7b
71 changed files with 961 additions and 1160 deletions

View File

@@ -15,13 +15,13 @@ extern "C" {
static char Curvature2DAngleF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`Curvature2DAngleF1D`\n"
"\n"
".. method:: __init__(iType=IntegrationType.MEAN)\n"
".. method:: __init__(integration_type=IntegrationType.MEAN)\n"
"\n"
" Builds a Curvature2DAngleF1D object.\n"
"\n"
" :arg iType: The integration method used to compute a single value\n"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :class:`IntegrationType`\n"
"\n"
".. method:: __call__(inter)\n"
"\n"
@@ -32,14 +32,14 @@ static char Curvature2DAngleF1D___doc__[] =
" :return: The 2D curvature as an angle.\n"
" :rtype: float\n";
static int Curvature2DAngleF1D___init__( BPy_Curvature2DAngleF1D* self, PyObject *args)
static int Curvature2DAngleF1D___init__(BPy_Curvature2DAngleF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"integration_type", NULL};
PyObject *obj = 0;
if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
self->py_uf1D_double.uf1D_double = new Functions1D::Curvature2DAngleF1D(t);
return 0;

View File

@@ -15,20 +15,20 @@ extern "C" {
static char DensityF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`DensityF1D`\n"
"\n"
".. method:: __init__(sigma=2.0, iType=IntegrationType.MEAN, sampling=2.0)\n"
".. method:: __init__(sigma=2.0, integration_type=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"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :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"
" single one, following the method specified by integration_type.\n"
" :type sampling: float\n"
"\n"
".. method:: __call__(inter)\n"
@@ -44,16 +44,16 @@ static char DensityF1D___doc__[] =
" :return: The density evaluated for an Interface1D.\n"
" :rtype: float\n";
static int DensityF1D___init__( BPy_DensityF1D* self, PyObject *args)
static int DensityF1D___init__(BPy_DensityF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"sigma", "integration_type", "sampling", NULL};
PyObject *obj = 0;
double d = 2.0;
float f = 2.0;
if( !PyArg_ParseTuple(args, "|dO!f", &d, &IntegrationType_Type, &obj, &f) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|dO!f", (char **)kwlist, &d, &IntegrationType_Type, &obj, &f))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
self->py_uf1D_double.uf1D_double = new Functions1D::DensityF1D(d,t,f);
return 0;

View File

@@ -15,20 +15,20 @@ extern "C" {
static char GetCompleteViewMapDensityF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetCompleteViewMapDensityF1D`\n"
"\n"
".. method:: __init__(level, iType=IntegrationType.MEAN, sampling=2.0)\n"
".. method:: __init__(level, integration_type=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"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :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"
" single one, following the method specified by integration_type.\n"
" :type sampling: float\n"
"\n"
".. method:: __call__(inter)\n"
@@ -45,19 +45,18 @@ static char GetCompleteViewMapDensityF1D___doc__[] =
" viewmap image.\n"
" :rtype: float\n";
static int GetCompleteViewMapDensityF1D___init__( BPy_GetCompleteViewMapDensityF1D* self, PyObject *args)
static int GetCompleteViewMapDensityF1D___init__(BPy_GetCompleteViewMapDensityF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"level", "integration_type", "sampling", NULL};
PyObject *obj = 0;
unsigned i;
int i;
float f = 2.0;
if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
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 ------------------------------*/

View File

@@ -15,23 +15,23 @@ extern "C" {
static char GetDirectionalViewMapDensityF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetDirectionalViewMapDensityF1D`\n"
"\n"
".. method:: __init__(iOrientation, level, iType=IntegrationType.MEAN, sampling=2.0)\n"
".. method:: __init__(orientation, level, integration_type=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"
" :arg orientation: The number of the directional map we must work\n"
" with.\n"
" :type iOrientation: int\n"
" :type orientation: 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"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :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"
" single one, following the method specified by integration_type.\n"
" :type sampling: float\n"
"\n"
".. method:: __call__(inter)\n"
@@ -49,19 +49,18 @@ static char GetDirectionalViewMapDensityF1D___doc__[] =
" steerable viewmaps image.\n"
" :rtype: float\n";
static int GetDirectionalViewMapDensityF1D___init__( BPy_GetDirectionalViewMapDensityF1D* self, PyObject *args)
static int GetDirectionalViewMapDensityF1D___init__(BPy_GetDirectionalViewMapDensityF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"orientation", "level", "integration_type", "sampling", NULL};
PyObject *obj = 0;
unsigned int u1, u2;
float f = 2.0;
if( !PyArg_ParseTuple(args, "II|O!f", &u1, &u2, &IntegrationType_Type, &obj, &f) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "II|O!f", (char **)kwlist, &u1, &u2, &IntegrationType_Type, &obj, &f))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
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 ------------------------------*/

View File

@@ -15,13 +15,13 @@ extern "C" {
static char GetProjectedXF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetProjectedXF1D`\n"
"\n"
".. method:: __init__(iType=IntegrationType.MEAN)\n"
".. method:: __init__(integration_type=IntegrationType.MEAN)\n"
"\n"
" Builds a GetProjectedXF1D object.\n"
"\n"
" :arg iType: The integration method used to compute a single value\n"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values. \n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :class:`IntegrationType`\n"
"\n"
".. method:: __call__(inter)\n"
"\n"
@@ -32,14 +32,14 @@ static char GetProjectedXF1D___doc__[] =
" :return: The projected X 3D coordinate of an Interface1D.\n"
" :rtype: float\n";
static int GetProjectedXF1D___init__( BPy_GetProjectedXF1D* self, PyObject *args )
static int GetProjectedXF1D___init__(BPy_GetProjectedXF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"integration_type", NULL};
PyObject *obj = 0;
if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedXF1D(t);
return 0;
}

View File

@@ -15,13 +15,13 @@ extern "C" {
static char GetProjectedYF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetProjectedYF1D`\n"
"\n"
".. method:: __init__(iType=IntegrationType.MEAN)\n"
".. method:: __init__(integration_type=IntegrationType.MEAN)\n"
"\n"
" Builds a GetProjectedYF1D object.\n"
"\n"
" :arg iType: The integration method used to compute a single value\n"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values. \n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :class:`IntegrationType`\n"
"\n"
".. method:: __call__(inter)\n"
"\n"
@@ -32,14 +32,14 @@ static char GetProjectedYF1D___doc__[] =
" :return: The projected Y 3D coordinate of an Interface1D.\n"
" :rtype: float\n";
static int GetProjectedYF1D___init__( BPy_GetProjectedYF1D* self, PyObject *args )
static int GetProjectedYF1D___init__(BPy_GetProjectedYF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"integration_type", NULL};
PyObject *obj = 0;
if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedYF1D(t);
return 0;
}

View File

@@ -15,13 +15,13 @@ extern "C" {
static char GetProjectedZF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetProjectedZF1D`\n"
"\n"
".. method:: __init__(iType=IntegrationType.MEAN)\n"
".. method:: __init__(integration_type=IntegrationType.MEAN)\n"
"\n"
" Builds a GetProjectedZF1D object.\n"
"\n"
" :arg iType: The integration method used to compute a single value\n"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values. \n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :class:`IntegrationType`\n"
"\n"
".. method:: __call__(inter)\n"
"\n"
@@ -32,14 +32,14 @@ static char GetProjectedZF1D___doc__[] =
" :return: The projected Z 3D coordinate of an Interface1D.\n"
" :rtype: float\n";
static int GetProjectedZF1D___init__( BPy_GetProjectedZF1D* self, PyObject *args )
static int GetProjectedZF1D___init__(BPy_GetProjectedZF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"integration_type", NULL};
PyObject *obj = 0;
if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedZF1D(t);
return 0;
}

View File

@@ -15,20 +15,20 @@ extern "C" {
static char GetSteerableViewMapDensityF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetSteerableViewMapDensityF1D`\n"
"\n"
".. method:: __init__(level, iType=IntegrationType.MEAN, sampling=2.0)\n"
".. method:: __init__(level, integration_type=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"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :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"
" single one, following the method specified by integration_type.\n"
" :type sampling: float\n"
"\n"
".. method:: __call__(inter)\n"
@@ -42,19 +42,18 @@ static char GetSteerableViewMapDensityF1D___doc__[] =
" :return: The density of the ViewMap for a given Interface1D.\n"
" :rtype: float\n";
static int GetSteerableViewMapDensityF1D___init__( BPy_GetSteerableViewMapDensityF1D* self, PyObject *args)
static int GetSteerableViewMapDensityF1D___init__(BPy_GetSteerableViewMapDensityF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"level", "integration_type", "sampling", NULL};
PyObject *obj = 0;
int i;
float f = 2.0;
if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
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 ------------------------------*/

View File

@@ -15,20 +15,20 @@ extern "C" {
static char GetViewMapGradientNormF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetViewMapGradientNormF1D`\n"
"\n"
".. method:: __init__()\n"
".. method:: __init__(level, integration_type=IntegrationType.MEAN, sampling=2.0)\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"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :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"
" single one, following the method specified by integration_type.\n"
" :type sampling: float\n"
"\n"
".. method:: __call__(inter)\n"
@@ -42,19 +42,18 @@ static char GetViewMapGradientNormF1D___doc__[] =
" :return: The density of the ViewMap for a given Interface1D.\n"
" :rtype: float\n";
static int GetViewMapGradientNormF1D___init__( BPy_GetViewMapGradientNormF1D* self, PyObject *args)
static int GetViewMapGradientNormF1D___init__(BPy_GetViewMapGradientNormF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"level", "integration_type", "sampling", NULL};
PyObject *obj = 0;
int i;
float f = 2.0;
if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
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 ------------------------------*/

View File

@@ -15,13 +15,13 @@ extern "C" {
static char GetXF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetXF1D`\n"
"\n"
".. method:: __init__(iType)\n"
".. method:: __init__(integration_type=IntegrationType.MEAN)\n"
"\n"
" Builds a GetXF1D object.\n"
"\n"
" :arg iType: The integration method used to compute a single value\n"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :class:`IntegrationType`\n"
"\n"
".. method:: __call__(inter)\n"
"\n"
@@ -32,14 +32,14 @@ static char GetXF1D___doc__[] =
" :return: The X 3D coordinate of the Interface1D.\n"
" :rtype: float\n";
static int GetXF1D___init__( BPy_GetXF1D* self, PyObject *args )
static int GetXF1D___init__(BPy_GetXF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"integration_type", NULL};
PyObject *obj = 0;
if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
self->py_uf1D_double.uf1D_double = new Functions1D::GetXF1D(t);
return 0;
}

View File

@@ -15,13 +15,13 @@ extern "C" {
static char GetYF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetYF1D`\n"
"\n"
".. method:: __init__(iType)\n"
".. method:: __init__(integration_type=IntegrationType.MEAN)\n"
"\n"
" Builds a GetYF1D object.\n"
"\n"
" :arg iType: The integration method used to compute a single value\n"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :class:`IntegrationType`\n"
"\n"
".. method:: __call__(inter)\n"
"\n"
@@ -32,14 +32,14 @@ static char GetYF1D___doc__[] =
" :return: The Y 3D coordinate of the Interface1D.\n"
" :rtype: float\n";
static int GetYF1D___init__( BPy_GetYF1D* self, PyObject *args )
static int GetYF1D___init__(BPy_GetYF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"integration_type", NULL};
PyObject *obj = 0;
if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
self->py_uf1D_double.uf1D_double = new Functions1D::GetYF1D(t);
return 0;
}

View File

@@ -15,13 +15,13 @@ extern "C" {
static char GetZF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`GetZF1D`\n"
"\n"
".. method:: __init__(iType)\n"
".. method:: __init__(integration_type=IntegrationType.MEAN)\n"
"\n"
" Builds a GetZF1D object.\n"
"\n"
" :arg iType: The integration method used to compute a single value\n"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :class:`IntegrationType`\n"
"\n"
".. method:: __call__(inter)\n"
"\n"
@@ -32,14 +32,14 @@ static char GetZF1D___doc__[] =
" :return: The Z 3D coordinate of the Interface1D.\n"
" :rtype: float\n";
static int GetZF1D___init__( BPy_GetZF1D* self, PyObject *args )
static int GetZF1D___init__(BPy_GetZF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"integration_type", NULL};
PyObject *obj = 0;
if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
self->py_uf1D_double.uf1D_double = new Functions1D::GetZF1D(t);
return 0;
}

View File

@@ -15,16 +15,16 @@ extern "C" {
static char LocalAverageDepthF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`LocalAverageDepthF1D`\n"
"\n"
".. method:: __init__(sigma, iType=IntegrationType.MEAN)\n"
".. method:: __init__(sigma, integration_type=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"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :class:`IntegrationType`\n"
"\n"
".. method:: __call__(inter)\n"
"\n"
@@ -39,18 +39,19 @@ static char LocalAverageDepthF1D___doc__[] =
" :return: The average depth evaluated for the Interface1D.\n"
" :rtype: float\n";
static int LocalAverageDepthF1D___init__( BPy_LocalAverageDepthF1D* self, PyObject *args)
static int LocalAverageDepthF1D___init__(BPy_LocalAverageDepthF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"sigma", "integration_type", NULL};
PyObject *obj = 0;
double d;
if( !PyArg_ParseTuple(args, "d|O!", &d, &IntegrationType_Type, &obj) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "d|O!", (char **)kwlist, &d, &IntegrationType_Type, &obj))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
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 = {

View File

@@ -15,13 +15,13 @@ extern "C" {
static char ZDiscontinuityF1D___doc__[] =
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` > :class:`ZDiscontinuityF1D`\n"
"\n"
".. method:: __init__(iType=IntegrationType.MEAN)\n"
".. method:: __init__(integration_type=IntegrationType.MEAN)\n"
"\n"
" Builds a ZDiscontinuityF1D object.\n"
"\n"
" :arg iType: The integration method used to compute a single value\n"
" :arg integration_type: The integration method used to compute a single value\n"
" from a set of values.\n"
" :type iType: :class:`IntegrationType`\n"
" :type integration_type: :class:`IntegrationType`\n"
"\n"
".. method:: __call__(inter)\n"
"\n"
@@ -36,14 +36,14 @@ static char ZDiscontinuityF1D___doc__[] =
" :return: The normalized distance between the Interface1D and the occludee.\n"
" :rtype: float\n";
static int ZDiscontinuityF1D___init__( BPy_ZDiscontinuityF1D* self, PyObject *args )
static int ZDiscontinuityF1D___init__(BPy_ZDiscontinuityF1D* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"integration_type", NULL};
PyObject *obj = 0;
if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) )
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj))
return -1;
IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
self->py_uf1D_double.uf1D_double = new Functions1D::ZDiscontinuityF1D(t);
return 0;
}