Blender
V4.5
source
blender
freestyle
intern
python
StrokeShader
BPy_ConstrainedIncreasingThicknessShader.cpp
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2004-2022 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#include "
BPy_ConstrainedIncreasingThicknessShader.h
"
10
11
#include "
../../stroke/BasicStrokeShaders.h
"
12
13
using namespace
Freestyle
;
14
16
17
//------------------------INSTANCE METHODS ----------------------------------
18
19
PyDoc_STRVAR
(
20
/* Wrap. */
21
ConstrainedIncreasingThicknessShader___doc__,
22
"Class hierarchy: :class:`freestyle.types.StrokeShader` > "
23
":class:`ConstrainedIncreasingThicknessShader`\n"
24
"\n"
25
"[Thickness shader]\n"
26
"\n"
27
".. method:: __init__(thickness_min, thickness_max, ratio)\n"
28
"\n"
29
" Builds a ConstrainedIncreasingThicknessShader object.\n"
30
"\n"
31
" :arg thickness_min: The minimum thickness.\n"
32
" :type thickness_min: float\n"
33
" :arg thickness_max: The maximum thickness.\n"
34
" :type thickness_max: float\n"
35
" :arg ratio: The thickness/length ratio that we don't want to exceed. \n"
36
" :type ratio: float\n"
37
"\n"
38
".. method:: shade(stroke)\n"
39
"\n"
40
" Same as the :class:`IncreasingThicknessShader`, but here we allow\n"
41
" the user to control the thickness/length ratio so that we don't get\n"
42
" fat short lines.\n"
43
"\n"
44
" :arg stroke: A Stroke object.\n"
45
" :type stroke: :class:`freestyle.types.Stroke`\n"
);
46
47
static
int
ConstrainedIncreasingThicknessShader___init__
(
48
BPy_ConstrainedIncreasingThicknessShader
*self, PyObject *args, PyObject *kwds)
49
{
50
static
const
char
*kwlist[] = {
"thickness_min"
,
"thickness_max"
,
"ratio"
,
nullptr
};
51
float
f1, f2, f3;
52
53
if
(!PyArg_ParseTupleAndKeywords(args, kwds,
"fff"
, (
char
**)kwlist, &f1, &f2, &f3)) {
54
return
-1;
55
}
56
self->
py_ss
.
ss
=
new
StrokeShaders::ConstrainedIncreasingThicknessShader
(f1, f2, f3);
57
return
0;
58
}
59
60
/*-----------------------BPy_ConstrainedIncreasingThicknessShader type definition ---------------*/
61
62
PyTypeObject
ConstrainedIncreasingThicknessShader_Type
= {
63
/*ob_base*/
PyVarObject_HEAD_INIT(
nullptr
, 0)
64
/*tp_name*/
"ConstrainedIncreasingThicknessShader"
,
65
/*tp_basicsize*/
sizeof
(
BPy_ConstrainedIncreasingThicknessShader
),
66
/*tp_itemsize*/
0,
67
/*tp_dealloc*/
nullptr
,
68
/*tp_vectorcall_offset*/
0,
69
/*tp_getattr*/
nullptr
,
70
/*tp_setattr*/
nullptr
,
71
/*tp_as_async*/
nullptr
,
72
/*tp_repr*/
nullptr
,
73
/*tp_as_number*/
nullptr
,
74
/*tp_as_sequence*/
nullptr
,
75
/*tp_as_mapping*/
nullptr
,
76
/*tp_hash*/
nullptr
,
77
/*tp_call*/
nullptr
,
78
/*tp_str*/
nullptr
,
79
/*tp_getattro*/
nullptr
,
80
/*tp_setattro*/
nullptr
,
81
/*tp_as_buffer*/
nullptr
,
82
/*tp_flags*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
83
/*tp_doc*/
ConstrainedIncreasingThicknessShader___doc__,
84
/*tp_traverse*/
nullptr
,
85
/*tp_clear*/
nullptr
,
86
/*tp_richcompare*/
nullptr
,
87
/*tp_weaklistoffset*/
0,
88
/*tp_iter*/
nullptr
,
89
/*tp_iternext*/
nullptr
,
90
/*tp_methods*/
nullptr
,
91
/*tp_members*/
nullptr
,
92
/*tp_getset*/
nullptr
,
93
/*tp_base*/
&
StrokeShader_Type
,
94
/*tp_dict*/
nullptr
,
95
/*tp_descr_get*/
nullptr
,
96
/*tp_descr_set*/
nullptr
,
97
/*tp_dictoffset*/
0,
98
/*tp_init*/
(initproc)
ConstrainedIncreasingThicknessShader___init__
,
99
/*tp_alloc*/
nullptr
,
100
/*tp_new*/
nullptr
,
101
};
102
ConstrainedIncreasingThicknessShader_Type
PyTypeObject ConstrainedIncreasingThicknessShader_Type
Definition
BPy_ConstrainedIncreasingThicknessShader.cpp:62
ConstrainedIncreasingThicknessShader___init__
static int ConstrainedIncreasingThicknessShader___init__(BPy_ConstrainedIncreasingThicknessShader *self, PyObject *args, PyObject *kwds)
Definition
BPy_ConstrainedIncreasingThicknessShader.cpp:47
BPy_ConstrainedIncreasingThicknessShader.h
PyDoc_STRVAR
PyDoc_STRVAR(FalseBP1D___doc__, "Class hierarchy: :class:`freestyle.types.BinaryPredicate1D` > :class:`FalseBP1D`\n" "\n" ".. method:: __call__(inter1, inter2)\n" "\n" " Always returns false.\n" "\n" " :arg inter1: The first Interface1D object.\n" " :type inter1: :class:`freestyle.types.Interface1D`\n" " :arg inter2: The second Interface1D object.\n" " :type inter2: :class:`freestyle.types.Interface1D`\n" " :return: False.\n" " :rtype: bool\n")
StrokeShader_Type
PyTypeObject StrokeShader_Type
Definition
BPy_StrokeShader.cpp:275
BasicStrokeShaders.h
Class gathering basic stroke shaders.
Freestyle::StrokeShaders::ConstrainedIncreasingThicknessShader
Definition
BasicStrokeShaders.h:133
Freestyle
inherits from class Rep
Definition
AppCanvas.cpp:20
BPy_ConstrainedIncreasingThicknessShader
Definition
BPy_ConstrainedIncreasingThicknessShader.h:22
BPy_ConstrainedIncreasingThicknessShader::py_ss
BPy_StrokeShader py_ss
Definition
BPy_ConstrainedIncreasingThicknessShader.h:23
BPy_StrokeShader::ss
PyObject_HEAD Freestyle::StrokeShader * ss
Definition
BPy_StrokeShader.h:29
Generated on
for Blender by
doxygen
1.18.0