OLD | NEW |
(Empty) | |
| 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 * The Original Code is Copyright (C) 2010 Blender Foundation. |
| 19 * All rights reserved. |
| 20 * |
| 21 * The Original Code is: all of this file. |
| 22 * |
| 23 * Contributor(s): none yet. |
| 24 * |
| 25 * ***** END GPL LICENSE BLOCK ***** |
| 26 */ |
| 27 |
| 28 /** \file source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesSh
ader.cpp |
| 29 * \ingroup freestyle |
| 30 */ |
| 31 |
| 32 #include "BPy_GuidingLinesShader.h" |
| 33 |
| 34 #include "../../stroke/BasicStrokeShaders.h" |
| 35 |
| 36 #ifdef __cplusplus |
| 37 extern "C" { |
| 38 #endif |
| 39 |
| 40 ////////////////////////////////////////////////////////////////////////////////
/////////// |
| 41 |
| 42 //------------------------INSTANCE METHODS ---------------------------------- |
| 43 |
| 44 static char GuidingLinesShader___doc__[] = |
| 45 "Class hierarchy: :class:`StrokeShader` > :class:`GuidingLinesShader`\n" |
| 46 "\n" |
| 47 "[Geometry shader]\n" |
| 48 "\n" |
| 49 ".. method:: __init__(offset)\n" |
| 50 "\n" |
| 51 " Builds a GuidingLinesShader object.\n" |
| 52 "\n" |
| 53 " :arg offset: The line that replaces the stroke is initially in the\n" |
| 54 " middle of the initial stroke bounding box. offset is the value\n" |
| 55 " of the displacement which is applied to this line along its\n" |
| 56 " normal.\n" |
| 57 " :type offset: float\n" |
| 58 "\n" |
| 59 ".. method:: shade(stroke)\n" |
| 60 "\n" |
| 61 " Shader to modify the Stroke geometry so that it corresponds to its\n" |
| 62 " main direction line. This shader must be used together with the\n" |
| 63 " splitting operator using the curvature criterion. Indeed, the\n" |
| 64 " precision of the approximation will depend on the size of the\n" |
| 65 " stroke's pieces. The bigger the pieces are, the rougher the\n" |
| 66 " approximation is.\n" |
| 67 "\n" |
| 68 " :arg stroke: A Stroke object.\n" |
| 69 " :type stroke: :class:`Stroke`\n"; |
| 70 |
| 71 static int GuidingLinesShader___init__(BPy_GuidingLinesShader* self, PyObject *a
rgs, PyObject *kwds) |
| 72 { |
| 73 static const char *kwlist[] = {"offset", NULL}; |
| 74 float f; |
| 75 |
| 76 if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) |
| 77 return -1; |
| 78 self->py_ss.ss = new StrokeShaders::GuidingLinesShader(f); |
| 79 return 0; |
| 80 } |
| 81 |
| 82 /*-----------------------BPy_GuidingLinesShader type definition ----------------
--------------*/ |
| 83 |
| 84 PyTypeObject GuidingLinesShader_Type = { |
| 85 PyVarObject_HEAD_INIT(NULL, 0) |
| 86 "GuidingLinesShader", /* tp_name */ |
| 87 sizeof(BPy_GuidingLinesShader), /* 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 GuidingLinesShader___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)GuidingLinesShader___init__, /* tp_init */ |
| 121 0, /* tp_alloc */ |
| 122 0, /* tp_new */ |
| 123 }; |
| 124 |
| 125 ////////////////////////////////////////////////////////////////////////////////
/////////// |
| 126 |
| 127 #ifdef __cplusplus |
| 128 } |
| 129 #endif |
OLD | NEW |