2013-02-23 18:32:28 +00:00
|
|
|
/*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup freestyle
|
2013-02-23 18:32:28 +00:00
|
|
|
*/
|
|
|
|
|
|
2008-07-27 13:40:33 +00:00
|
|
|
#include "BPy_BackboneStretcherShader.h"
|
|
|
|
|
|
|
|
|
|
#include "../../stroke/BasicStrokeShaders.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2010-04-17 23:47:47 +00:00
|
|
|
//------------------------INSTANCE METHODS ----------------------------------
|
|
|
|
|
|
|
|
|
|
static char BackboneStretcherShader___doc__[] =
|
2014-09-19 13:22:20 +09:00
|
|
|
"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`BackboneStretcherShader`\n"
|
2010-08-12 12:17:47 +00:00
|
|
|
"\n"
|
2010-04-17 23:47:47 +00:00
|
|
|
"[Geometry shader]\n"
|
|
|
|
|
"\n"
|
2013-02-23 01:12:23 +00:00
|
|
|
".. method:: __init__(amount=2.0)\n"
|
2010-04-17 23:47:47 +00:00
|
|
|
"\n"
|
|
|
|
|
" Builds a BackboneStretcherShader object.\n"
|
|
|
|
|
"\n"
|
2013-02-23 01:12:23 +00:00
|
|
|
" :arg amount: The stretching amount value.\n"
|
|
|
|
|
" :type amount: float\n"
|
2010-04-17 23:47:47 +00:00
|
|
|
"\n"
|
2013-02-23 01:12:23 +00:00
|
|
|
".. method:: shade(stroke)\n"
|
2010-04-17 23:47:47 +00:00
|
|
|
"\n"
|
|
|
|
|
" Stretches the stroke at its two extremities and following the\n"
|
|
|
|
|
" respective directions: v(1)v(0) and v(n-1)v(n).\n"
|
|
|
|
|
"\n"
|
2013-02-23 01:12:23 +00:00
|
|
|
" :arg stroke: A Stroke object.\n"
|
2014-09-19 13:22:20 +09:00
|
|
|
" :type stroke: :class:`freestyle.types.Stroke`\n";
|
2010-04-17 23:47:47 +00:00
|
|
|
|
2013-03-07 23:17:23 +00:00
|
|
|
static int BackboneStretcherShader___init__(BPy_BackboneStretcherShader *self,
|
|
|
|
|
PyObject *args,
|
|
|
|
|
PyObject *kwds)
|
2010-04-17 23:47:47 +00:00
|
|
|
{
|
2020-11-06 17:49:09 +01:00
|
|
|
static const char *kwlist[] = {"amount", nullptr};
|
2010-04-17 23:47:47 +00:00
|
|
|
float f = 2.0;
|
|
|
|
|
|
2019-05-31 22:51:19 +10:00
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|f", (char **)kwlist, &f)) {
|
2010-04-17 23:47:47 +00:00
|
|
|
return -1;
|
2019-05-31 22:51:19 +10:00
|
|
|
}
|
2010-04-17 23:47:47 +00:00
|
|
|
self->py_ss.ss = new StrokeShaders::BackboneStretcherShader(f);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2008-07-27 13:40:33 +00:00
|
|
|
|
2019-04-30 17:50:57 +10:00
|
|
|
/*-----------------------BPy_BackboneStretcherShader type definition ----------------------------*/
|
2008-07-27 13:40:33 +00:00
|
|
|
|
|
|
|
|
PyTypeObject BackboneStretcherShader_Type = {
|
2020-11-06 17:49:09 +01:00
|
|
|
PyVarObject_HEAD_INIT(nullptr, 0) "BackboneStretcherShader", /* tp_name */
|
2009-09-27 00:32:20 +00:00
|
|
|
sizeof(BPy_BackboneStretcherShader), /* tp_basicsize */
|
|
|
|
|
0, /* tp_itemsize */
|
2020-11-06 17:49:09 +01:00
|
|
|
nullptr, /* tp_dealloc */
|
2020-11-11 08:36:54 +11:00
|
|
|
#if PY_VERSION_HEX >= 0x03080000
|
|
|
|
|
0, /* tp_vectorcall_offset */
|
|
|
|
|
#else
|
|
|
|
|
nullptr, /* tp_print */
|
|
|
|
|
#endif
|
2020-11-06 17:49:09 +01:00
|
|
|
nullptr, /* tp_getattr */
|
|
|
|
|
nullptr, /* tp_setattr */
|
|
|
|
|
nullptr, /* tp_reserved */
|
|
|
|
|
nullptr, /* tp_repr */
|
|
|
|
|
nullptr, /* tp_as_number */
|
|
|
|
|
nullptr, /* tp_as_sequence */
|
|
|
|
|
nullptr, /* tp_as_mapping */
|
|
|
|
|
nullptr, /* tp_hash */
|
|
|
|
|
nullptr, /* tp_call */
|
|
|
|
|
nullptr, /* tp_str */
|
|
|
|
|
nullptr, /* tp_getattro */
|
|
|
|
|
nullptr, /* tp_setattro */
|
|
|
|
|
nullptr, /* tp_as_buffer */
|
2009-09-27 00:32:20 +00:00
|
|
|
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
2010-04-17 23:47:47 +00:00
|
|
|
BackboneStretcherShader___doc__, /* tp_doc */
|
2020-11-06 17:49:09 +01:00
|
|
|
nullptr, /* tp_traverse */
|
|
|
|
|
nullptr, /* tp_clear */
|
|
|
|
|
nullptr, /* tp_richcompare */
|
2009-09-27 00:32:20 +00:00
|
|
|
0, /* tp_weaklistoffset */
|
2020-11-06 17:49:09 +01:00
|
|
|
nullptr, /* tp_iter */
|
|
|
|
|
nullptr, /* tp_iternext */
|
|
|
|
|
nullptr, /* tp_methods */
|
|
|
|
|
nullptr, /* tp_members */
|
|
|
|
|
nullptr, /* tp_getset */
|
2009-09-27 00:32:20 +00:00
|
|
|
&StrokeShader_Type, /* tp_base */
|
2020-11-06 17:49:09 +01:00
|
|
|
nullptr, /* tp_dict */
|
|
|
|
|
nullptr, /* tp_descr_get */
|
|
|
|
|
nullptr, /* tp_descr_set */
|
2009-09-27 00:32:20 +00:00
|
|
|
0, /* tp_dictoffset */
|
|
|
|
|
(initproc)BackboneStretcherShader___init__, /* tp_init */
|
2020-11-06 17:49:09 +01:00
|
|
|
nullptr, /* tp_alloc */
|
|
|
|
|
nullptr, /* tp_new */
|
2008-07-27 13:40:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
2008-07-09 08:24:13 +00:00
|
|
|
|
2008-07-27 13:40:33 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|