~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ***** BEGIN GPL LICENSE BLOCK *****
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 *
 
18
 * ***** END GPL LICENSE BLOCK *****
 
19
 */
 
20
 
 
21
/** \file source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp
 
22
 *  \ingroup freestyle
 
23
 */
 
24
 
 
25
#include "BPy_GetDirectionalViewMapDensityF1D.h"
 
26
 
 
27
#include "../../../stroke/AdvancedFunctions1D.h"
 
28
#include "../../BPy_Convert.h"
 
29
#include "../../BPy_IntegrationType.h"
 
30
 
 
31
#ifdef __cplusplus
 
32
extern "C" {
 
33
#endif
 
34
 
 
35
///////////////////////////////////////////////////////////////////////////////////////////
 
36
 
 
37
//------------------------INSTANCE METHODS ----------------------------------
 
38
 
 
39
static char GetDirectionalViewMapDensityF1D___doc__[] =
 
40
"Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DDouble` "
 
41
"> :class:`GetDirectionalViewMapDensityF1D`\n"
 
42
"\n"
 
43
".. method:: __init__(orientation, level, integration_type=IntegrationType.MEAN, sampling=2.0)\n"
 
44
"\n"
 
45
"   Builds a GetDirectionalViewMapDensityF1D object.\n"
 
46
"\n"
 
47
"   :arg orientation: The number of the directional map we must work\n"
 
48
"      with.\n"
 
49
"   :type orientation: int\n"
 
50
"   :arg level: The level of the pyramid from which the pixel must be\n"
 
51
"      read.\n"
 
52
"   :type level: int\n"
 
53
"   :arg integration_type: The integration method used to compute a single value\n"
 
54
"      from a set of values.\n"
 
55
"   :type integration_type: :class:`IntegrationType`\n"
 
56
"   :arg sampling: The resolution used to sample the chain: the\n"
 
57
"      corresponding 0D function is evaluated at each sample point and\n"
 
58
"      the result is obtained by combining the resulting values into a\n"
 
59
"      single one, following the method specified by integration_type.\n"
 
60
"   :type sampling: float\n"
 
61
"\n"
 
62
".. method:: __call__(inter)\n"
 
63
"\n"
 
64
"   Returns the density evaluated for an Interface1D in of the\n"
 
65
"   steerable viewmaps image.  The direction telling which Directional\n"
 
66
"   map to choose is explicitely specified by the user.  The density is\n"
 
67
"   evaluated for a set of points along the Interface1D (using the\n"
 
68
"   :class:`ReadSteerableViewMapPixelF0D` functor) and then integrated\n"
 
69
"   into a single value using a user-defined integration method.\n"
 
70
"\n"
 
71
"   :arg inter: An Interface1D object.\n"
 
72
"   :type inter: :class:`Interface1D`\n"
 
73
"   :return: the density evaluated for an Interface1D in of the\n"
 
74
"      steerable viewmaps image.\n"
 
75
"   :rtype: float\n";
 
76
 
 
77
static int GetDirectionalViewMapDensityF1D___init__(BPy_GetDirectionalViewMapDensityF1D *self,
 
78
                                                    PyObject *args, PyObject *kwds)
 
79
{
 
80
        static const char *kwlist[] = {"orientation", "level", "integration_type", "sampling", NULL};
 
81
        PyObject *obj = 0;
 
82
        unsigned int u1, u2;
 
83
        float f = 2.0;
 
84
 
 
85
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "II|O!f", (char **)kwlist, &u1, &u2, &IntegrationType_Type, &obj, &f))
 
86
                return -1;
 
87
        IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
 
88
        self->py_uf1D_double.uf1D_double = new Functions1D::GetDirectionalViewMapDensityF1D(u1, u2, t, f);
 
89
        return 0;
 
90
}
 
91
 
 
92
/*-----------------------BPy_GetDirectionalViewMapDensityF1D type definition ------------------------------*/
 
93
 
 
94
PyTypeObject GetDirectionalViewMapDensityF1D_Type = {
 
95
        PyVarObject_HEAD_INIT(NULL, 0)
 
96
        "GetDirectionalViewMapDensityF1D", /* tp_name */
 
97
        sizeof(BPy_GetDirectionalViewMapDensityF1D), /* tp_basicsize */
 
98
        0,                              /* tp_itemsize */
 
99
        0,                              /* tp_dealloc */
 
100
        0,                              /* tp_print */
 
101
        0,                              /* tp_getattr */
 
102
        0,                              /* tp_setattr */
 
103
        0,                              /* tp_reserved */
 
104
        0,                              /* tp_repr */
 
105
        0,                              /* tp_as_number */
 
106
        0,                              /* tp_as_sequence */
 
107
        0,                              /* tp_as_mapping */
 
108
        0,                              /* tp_hash  */
 
109
        0,                              /* tp_call */
 
110
        0,                              /* tp_str */
 
111
        0,                              /* tp_getattro */
 
112
        0,                              /* tp_setattro */
 
113
        0,                              /* tp_as_buffer */
 
114
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
 
115
        GetDirectionalViewMapDensityF1D___doc__, /* tp_doc */
 
116
        0,                              /* tp_traverse */
 
117
        0,                              /* tp_clear */
 
118
        0,                              /* tp_richcompare */
 
119
        0,                              /* tp_weaklistoffset */
 
120
        0,                              /* tp_iter */
 
121
        0,                              /* tp_iternext */
 
122
        0,                              /* tp_methods */
 
123
        0,                              /* tp_members */
 
124
        0,                              /* tp_getset */
 
125
        &UnaryFunction1DDouble_Type,    /* tp_base */
 
126
        0,                              /* tp_dict */
 
127
        0,                              /* tp_descr_get */
 
128
        0,                              /* tp_descr_set */
 
129
        0,                              /* tp_dictoffset */
 
130
        (initproc)GetDirectionalViewMapDensityF1D___init__, /* tp_init */
 
131
        0,                              /* tp_alloc */
 
132
        0,                              /* tp_new */
 
133
};
 
134
 
 
135
///////////////////////////////////////////////////////////////////////////////////////////
 
136
 
 
137
#ifdef __cplusplus
 
138
}
 
139
#endif