2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* ***** END GPL LICENSE BLOCK *****
21
/** \file source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_DensityLowerThanUP1D.cpp
25
#include "BPy_DensityLowerThanUP1D.h"
27
#include "../../stroke/AdvancedPredicates1D.h"
33
///////////////////////////////////////////////////////////////////////////////////////////
35
//------------------------INSTANCE METHODS ----------------------------------
37
static char DensityLowerThanUP1D___doc__[] =
38
"Class hierarchy: :class:`UnaryPredicate1D` > :class:`DensityLowerThanUP1D`\n"
40
".. method:: __init__(threshold, sigma=2.0)\n"
42
" Builds a DensityLowerThanUP1D object.\n"
44
" :arg threshold: The value of the threshold density. Any Interface1D\n"
45
" having a density lower than this threshold will match.\n"
46
" :type threshold: float\n"
47
" :arg sigma: The sigma value defining the density evaluation window\n"
48
" size used in the :class:`DensityF0D` functor.\n"
49
" :type sigma: float\n"
51
".. method:: __call__(inter)\n"
53
" Returns true if the density evaluated for the Interface1D is less\n"
54
" than a user-defined density value.\n"
56
" :arg inter: An Interface1D object.\n"
57
" :type inter: :class:`Interface1D`\n"
58
" :return: True if the density is lower than a threshold.\n"
61
static int DensityLowerThanUP1D___init__(BPy_DensityLowerThanUP1D *self, PyObject *args, PyObject *kwds)
63
static const char *kwlist[] = {"threshold", "sigma", NULL};
66
if (!PyArg_ParseTupleAndKeywords(args, kwds, "d|d", (char **)kwlist, &d1, &d2))
68
self->py_up1D.up1D = new Predicates1D::DensityLowerThanUP1D(d1, d2);
72
/*-----------------------BPy_DensityLowerThanUP1D type definition ------------------------------*/
74
PyTypeObject DensityLowerThanUP1D_Type = {
75
PyVarObject_HEAD_INIT(NULL, 0)
76
"DensityLowerThanUP1D", /* tp_name */
77
sizeof(BPy_DensityLowerThanUP1D), /* tp_basicsize */
86
0, /* tp_as_sequence */
87
0, /* tp_as_mapping */
94
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
95
DensityLowerThanUP1D___doc__, /* tp_doc */
98
0, /* tp_richcompare */
99
0, /* tp_weaklistoffset */
105
&UnaryPredicate1D_Type, /* tp_base */
107
0, /* tp_descr_get */
108
0, /* tp_descr_set */
109
0, /* tp_dictoffset */
110
(initproc)DensityLowerThanUP1D___init__, /* tp_init */
115
///////////////////////////////////////////////////////////////////////////////////////////