Blender
V2.93
source
blender
freestyle
intern
python
StrokeShader
BPy_ConstrainedIncreasingThicknessShader.cpp
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*/
16
21
#include "
BPy_ConstrainedIncreasingThicknessShader.h
"
22
23
#include "../../stroke/BasicStrokeShaders.h"
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
29
using namespace
Freestyle
;
30
32
33
//------------------------INSTANCE METHODS ----------------------------------
34
35
static
char
ConstrainedIncreasingThicknessShader___doc__
[] =
36
"Class hierarchy: :class:`freestyle.types.StrokeShader` > "
37
":class:`ConstrainedIncreasingThicknessShader`\n"
38
"\n"
39
"[Thickness shader]\n"
40
"\n"
41
".. method:: __init__(thickness_min, thickness_max, ratio)\n"
42
"\n"
43
" Builds a ConstrainedIncreasingThicknessShader object.\n"
44
"\n"
45
" :arg thickness_min: The minimum thickness.\n"
46
" :type thickness_min: float\n"
47
" :arg thickness_max: The maximum thickness.\n"
48
" :type thickness_max: float\n"
49
" :arg ratio: The thickness/length ratio that we don't want to exceed. \n"
50
" :type ratio: float\n"
51
"\n"
52
".. method:: shade(stroke)\n"
53
"\n"
54
" Same as the :class:`IncreasingThicknessShader`, but here we allow\n"
55
" the user to control the thickness/length ratio so that we don't get\n"
56
" fat short lines.\n"
57
"\n"
58
" :arg stroke: A Stroke object.\n"
59
" :type stroke: :class:`freestyle.types.Stroke`\n"
;
60
61
static
int
ConstrainedIncreasingThicknessShader___init__
(
62
BPy_ConstrainedIncreasingThicknessShader
*
self
, PyObject *args, PyObject *kwds)
63
{
64
static
const
char
*kwlist[] = {
"thickness_min"
,
"thickness_max"
,
"ratio"
,
nullptr
};
65
float
f1, f2, f3;
66
67
if
(!PyArg_ParseTupleAndKeywords(args, kwds,
"fff"
, (
char
**)kwlist, &f1, &f2, &f3)) {
68
return
-1;
69
}
70
self
->py_ss.ss =
new
StrokeShaders::ConstrainedIncreasingThicknessShader
(f1, f2, f3);
71
return
0;
72
}
73
74
/*-----------------------BPy_ConstrainedIncreasingThicknessShader type definition ---------------*/
75
76
PyTypeObject
ConstrainedIncreasingThicknessShader_Type
= {
77
PyVarObject_HEAD_INIT(
nullptr
, 0)
"ConstrainedIncreasingThicknessShader"
,
/* tp_name */
78
sizeof
(
BPy_ConstrainedIncreasingThicknessShader
),
/* tp_basicsize */
79
0,
/* tp_itemsize */
80
nullptr
,
/* tp_dealloc */
81
0,
/* tp_vectorcall_offset */
82
nullptr
,
/* tp_getattr */
83
nullptr
,
/* tp_setattr */
84
nullptr
,
/* tp_reserved */
85
nullptr
,
/* tp_repr */
86
nullptr
,
/* tp_as_number */
87
nullptr
,
/* tp_as_sequence */
88
nullptr
,
/* tp_as_mapping */
89
nullptr
,
/* tp_hash */
90
nullptr
,
/* tp_call */
91
nullptr
,
/* tp_str */
92
nullptr
,
/* tp_getattro */
93
nullptr
,
/* tp_setattro */
94
nullptr
,
/* tp_as_buffer */
95
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
/* tp_flags */
96
ConstrainedIncreasingThicknessShader___doc__
,
/* tp_doc */
97
nullptr
,
/* tp_traverse */
98
nullptr
,
/* tp_clear */
99
nullptr
,
/* tp_richcompare */
100
0,
/* tp_weaklistoffset */
101
nullptr
,
/* tp_iter */
102
nullptr
,
/* tp_iternext */
103
nullptr
,
/* tp_methods */
104
nullptr
,
/* tp_members */
105
nullptr
,
/* tp_getset */
106
&
StrokeShader_Type
,
/* tp_base */
107
nullptr
,
/* tp_dict */
108
nullptr
,
/* tp_descr_get */
109
nullptr
,
/* tp_descr_set */
110
0,
/* tp_dictoffset */
111
(initproc)
ConstrainedIncreasingThicknessShader___init__
,
/* tp_init */
112
nullptr
,
/* tp_alloc */
113
nullptr
,
/* tp_new */
114
};
115
117
118
#ifdef __cplusplus
119
}
120
#endif
ConstrainedIncreasingThicknessShader___doc__
static char ConstrainedIncreasingThicknessShader___doc__[]
Definition:
BPy_ConstrainedIncreasingThicknessShader.cpp:35
ConstrainedIncreasingThicknessShader_Type
PyTypeObject ConstrainedIncreasingThicknessShader_Type
Definition:
BPy_ConstrainedIncreasingThicknessShader.cpp:76
ConstrainedIncreasingThicknessShader___init__
static int ConstrainedIncreasingThicknessShader___init__(BPy_ConstrainedIncreasingThicknessShader *self, PyObject *args, PyObject *kwds)
Definition:
BPy_ConstrainedIncreasingThicknessShader.cpp:61
BPy_ConstrainedIncreasingThicknessShader.h
StrokeShader_Type
PyTypeObject StrokeShader_Type
Definition:
BPy_StrokeShader.cpp:282
Freestyle::StrokeShaders::ConstrainedIncreasingThicknessShader
Definition:
BasicStrokeShaders.h:151
Freestyle
inherits from class Rep
Definition:
AppCanvas.cpp:32
BPy_ConstrainedIncreasingThicknessShader
Definition:
BPy_ConstrainedIncreasingThicknessShader.h:38
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1