diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-23 05:12:23 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-23 05:12:23 +0400 |
commit | 68b0a8e39026ea2b391751406dc4bdb0a4ed958c (patch) | |
tree | cdf8a143a6cf2b832f49a31c2d3b7003f92eaa43 /source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp | |
parent | 0fb83d78faa99a8ea3fd396887b2b31a6a36a8cd (diff) |
Freestyle Python API improvements - part 7.
Fix for PyGetSetDef and proper handling of keyword arguments were done in
UnaryPredicate0D, UnaryPredicate1D, BinaryPredicate1D, and StrokeShader classes.
Style modules were updated accordingly. Additional code clean-up was also made.
Diffstat (limited to 'source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp index f5ba9d58d72..06e01dea826 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp @@ -16,6 +16,22 @@ extern "C" { static char ViewMapGradientNormBP1D___doc__[] = "Class hierarchy: :class:`BinaryPredicate1D` > :class:`ViewMapGradientNormBP1D`\n" "\n" +".. method:: __init__(level, integration_type=IntegrationType.MEAN, sampling=2.0)\n" +"\n" +" Builds a ViewMapGradientNormBP1D object.\n" +"\n" +" :arg level: The level of the pyramid from which the pixel must be\n" +" read.\n" +" :type level: int\n" +" :arg integration_type: The integration method used to compute a single value\n" +" from a set of values.\n" +" :type integration_type: :class:`IntegrationType`\n" +" :arg sampling: The resolution used to sample the chain:\n" +" GetViewMapGradientNormF0D 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 integration_type.\n" +" :type sampling: float\n" +"\n" ".. method:: __call__(inter1, inter2)\n" "\n" " Returns true if the evaluation of the Gradient norm Function is\n" @@ -28,17 +44,17 @@ static char ViewMapGradientNormBP1D___doc__[] = " :return: True or false.\n" " :rtype: bool\n"; -static int ViewMapGradientNormBP1D___init__( BPy_ViewMapGradientNormBP1D* self, PyObject *args ) +static int ViewMapGradientNormBP1D___init__(BPy_ViewMapGradientNormBP1D* self, PyObject *args, PyObject *kwds) { + static const char *kwlist[] = {"level", "integration_type", "sampling", NULL}; + PyObject *obj = 0; int i; - PyObject *obj; 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; - self->py_bp1D.bp1D = new Predicates1D::ViewMapGradientNormBP1D(i,t,f); + IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; + self->py_bp1D.bp1D = new Predicates1D::ViewMapGradientNormBP1D(i, t, f); return 0; } |