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

« back to all changes in this revision

Viewing changes to source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.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/StrokeShader/BPy_SpatialNoiseShader.cpp
 
22
 *  \ingroup freestyle
 
23
 */
 
24
 
 
25
#include "BPy_SpatialNoiseShader.h"
 
26
 
 
27
#include "../../stroke/AdvancedStrokeShaders.h"
 
28
#include "../BPy_Convert.h"
 
29
 
 
30
#ifdef __cplusplus
 
31
extern "C" {
 
32
#endif
 
33
 
 
34
///////////////////////////////////////////////////////////////////////////////////////////
 
35
 
 
36
//------------------------INSTANCE METHODS ----------------------------------
 
37
 
 
38
static char SpatialNoiseShader___doc__[] =
 
39
"Class hierarchy: :class:`StrokeShader` > :class:`SpatialNoiseShader`\n"
 
40
"\n"
 
41
"[Geometry shader]\n"
 
42
"\n"
 
43
".. method:: __init__(amount, scale, num_octaves, smooth, pure_random)\n"
 
44
"\n"
 
45
"   Builds a SpatialNoiseShader object.\n"
 
46
"\n"
 
47
"   :arg amount: The amplitude of the noise.\n"
 
48
"   :type amount: float\n"
 
49
"   :arg scale: The noise frequency.\n"
 
50
"   :type scale: float\n"
 
51
"   :arg num_octaves: The number of octaves\n"
 
52
"   :type num_octaves: int\n"
 
53
"   :arg smooth: True if you want the noise to be smooth.\n"
 
54
"   :type smooth: bool\n"
 
55
"   :arg pure_random: True if you don't want any coherence.\n"
 
56
"   :type pure_random: bool\n"
 
57
"\n"
 
58
".. method:: shade(stroke)\n"
 
59
"\n"
 
60
"   Spatial Noise stroke shader.  Moves the vertices to make the stroke\n"
 
61
"   more noisy.\n"
 
62
"\n"
 
63
"   :arg stroke: A Stroke object.\n"
 
64
"   :type stroke: :class:`Stroke`\n";
 
65
 
 
66
static int SpatialNoiseShader___init__(BPy_SpatialNoiseShader *self, PyObject *args, PyObject *kwds)
 
67
{
 
68
        static const char *kwlist[] = {"amount", "scale", "num_octaves", "smooth", "pure_random", NULL};
 
69
        float f1, f2;
 
70
        int i3;
 
71
        PyObject *obj4 = 0, *obj5 = 0;
 
72
 
 
73
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "ffiO!O!", (char **)kwlist,
 
74
                                         &f1, &f2, &i3, &PyBool_Type, &obj4, &PyBool_Type, &obj5))
 
75
        {
 
76
                return -1;
 
77
        }
 
78
        self->py_ss.ss = new SpatialNoiseShader(f1, f2, i3, bool_from_PyBool(obj4), bool_from_PyBool(obj5));
 
79
        return 0;
 
80
}
 
81
 
 
82
/*-----------------------BPy_SpatialNoiseShader type definition ------------------------------*/
 
83
 
 
84
PyTypeObject SpatialNoiseShader_Type = {
 
85
        PyVarObject_HEAD_INIT(NULL, 0)
 
86
        "SpatialNoiseShader",          /* tp_name */
 
87
        sizeof(BPy_SpatialNoiseShader), /* tp_basicsize */
 
88
        0,                              /* tp_itemsize */
 
89
        0,                              /* tp_dealloc */
 
90
        0,                              /* tp_print */
 
91
        0,                              /* tp_getattr */
 
92
        0,                              /* tp_setattr */
 
93
        0,                              /* tp_reserved */
 
94
        0,                              /* tp_repr */
 
95
        0,                              /* tp_as_number */
 
96
        0,                              /* tp_as_sequence */
 
97
        0,                              /* tp_as_mapping */
 
98
        0,                              /* tp_hash  */
 
99
        0,                              /* tp_call */
 
100
        0,                              /* tp_str */
 
101
        0,                              /* tp_getattro */
 
102
        0,                              /* tp_setattro */
 
103
        0,                              /* tp_as_buffer */
 
104
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
 
105
        SpatialNoiseShader___doc__,     /* tp_doc */
 
106
        0,                              /* tp_traverse */
 
107
        0,                              /* tp_clear */
 
108
        0,                              /* tp_richcompare */
 
109
        0,                              /* tp_weaklistoffset */
 
110
        0,                              /* tp_iter */
 
111
        0,                              /* tp_iternext */
 
112
        0,                              /* tp_methods */
 
113
        0,                              /* tp_members */
 
114
        0,                              /* tp_getset */
 
115
        &StrokeShader_Type,             /* tp_base */
 
116
        0,                              /* tp_dict */
 
117
        0,                              /* tp_descr_get */
 
118
        0,                              /* tp_descr_set */
 
119
        0,                              /* tp_dictoffset */
 
120
        (initproc)SpatialNoiseShader___init__, /* tp_init */
 
121
        0,                              /* tp_alloc */
 
122
        0,                              /* tp_new */
 
123
};
 
124
 
 
125
///////////////////////////////////////////////////////////////////////////////////////////
 
126
 
 
127
#ifdef __cplusplus
 
128
}
 
129
#endif