23 #include "../BPy_Convert.h"
24 #include "../BPy_Id.h"
25 #include "../BPy_Nature.h"
26 #include "../Interface0D/BPy_SVertex.h"
27 #include "../Interface1D/BPy_ViewEdge.h"
40 "Class hierarchy: :class:`Interface1D` > :class:`FEdge`\n"
42 "Base Class for feature edges. This FEdge can represent a silhouette,\n"
43 "a crease, a ridge/valley, a border or a suggestive contour. For\n"
44 "silhouettes, the FEdge is oriented so that the visible face lies on\n"
45 "the left of the edge. For borders, the FEdge is oriented so that the\n"
46 "face lies on the left of the edge. An FEdge can represent an initial\n"
47 "edge of the mesh or runs across a face of the initial mesh depending\n"
48 "on the smoothness or sharpness of the mesh. This class is specialized\n"
49 "into a smooth and a sharp version since their properties slightly vary\n"
50 "from one to the other.\n"
52 ".. method:: FEdge()\n"
55 " Builds an :class:`FEdge` using the default constructor,\n"
56 " copy constructor, or between two :class:`SVertex` objects.\n"
58 " :arg brother: An FEdge object.\n"
59 " :type brother: :class:`FEdge`\n"
60 " :arg first_vertex: The first SVertex.\n"
61 " :type first_vertex: :class:`SVertex`\n"
62 " :arg second_vertex: The second SVertex.\n"
63 " :type second_vertex: :class:`SVertex`");
67 static const char *kwlist_1[] = {
"brother",
nullptr};
68 static const char *kwlist_2[] = {
"first_vertex",
"second_vertex",
nullptr};
69 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
71 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
FEdge_Type, &obj1)) {
73 self->fe =
new FEdge();
79 else if ((
void)PyErr_Clear(),
80 PyArg_ParseTupleAndKeywords(args,
91 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
94 self->py_if1D.if1D =
self->fe;
95 self->py_if1D.borrowed =
false;
111 if (
ELEM(keynum, 0, 1)) {
112 SVertex *
v =
self->fe->operator[](keynum);
118 PyErr_Format(PyExc_IndexError,
"FEdge[index]: index %d out of range", keynum);
138 "The first SVertex constituting this FEdge.\n"
140 ":type: :class:`SVertex`");
154 PyErr_SetString(PyExc_TypeError,
"value must be an SVertex");
162 "The second SVertex constituting this FEdge.\n"
164 ":type: :class:`SVertex`");
178 PyErr_SetString(PyExc_TypeError,
"value must be an SVertex");
186 "The FEdge following this one in the ViewEdge. The value is None if\n"
187 "this FEdge is the last of the ViewEdge.\n"
189 ":type: :class:`FEdge`");
203 PyErr_SetString(PyExc_TypeError,
"value must be an FEdge");
206 self->fe->setNextEdge(((
BPy_FEdge *)value)->fe);
211 "The FEdge preceding this one in the ViewEdge. The value is None if\n"
212 "this FEdge is the first one of the ViewEdge.\n"
214 ":type: :class:`FEdge`");
228 PyErr_SetString(PyExc_TypeError,
"value must be an FEdge");
231 self->fe->setPreviousEdge(((
BPy_FEdge *)value)->fe);
236 "The ViewEdge to which this FEdge belongs to.\n"
238 ":type: :class:`ViewEdge`");
242 ViewEdge *ve =
self->fe->viewedge();
252 PyErr_SetString(PyExc_TypeError,
"value must be an ViewEdge");
260 "True if this FEdge is a smooth FEdge.\n"
271 if (!PyBool_Check(value)) {
272 PyErr_SetString(PyExc_TypeError,
"value must be boolean");
280 "The Id of this FEdge.\n"
282 ":type: :class:`Id`");
293 PyErr_SetString(PyExc_TypeError,
"value must be an Id");
296 self->fe->setId(*(((
BPy_Id *)value)->
id));
301 "The nature of this FEdge.\n"
303 ":type: :class:`Nature`");
313 PyErr_SetString(PyExc_TypeError,
"value must be a Nature");
316 self->fe->setNature(PyLong_AsLong((PyObject *)&((
BPy_Nature *)value)->i));
324 FEdge_first_svertex_doc,
329 FEdge_second_svertex_doc,
334 FEdge_next_fedge_doc,
339 FEdge_previous_fedge_doc,
353 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
359 PyVarObject_HEAD_INIT(
nullptr, 0)
"FEdge",
377 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * BPy_SVertex_from_SVertex(SVertex &sv)
PyObject * PyBool_from_bool(bool b)
bool bool_from_PyBool(PyObject *b)
PyObject * BPy_ViewEdge_from_ViewEdge(ViewEdge &ve)
PyObject * Any_BPy_FEdge_from_FEdge(FEdge &fe)
PyObject * BPy_Id_from_Id(Id &id)
PyObject * BPy_Nature_from_Nature(unsigned short n)
static PyObject * FEdge_nature_get(BPy_FEdge *self, void *UNUSED(closure))
static int FEdge_first_svertex_set(BPy_FEdge *self, PyObject *value, void *UNUSED(closure))
static int FEdge_id_set(BPy_FEdge *self, PyObject *value, void *UNUSED(closure))
static PySequenceMethods BPy_FEdge_as_sequence
static int FEdge_second_svertex_set(BPy_FEdge *self, PyObject *value, void *UNUSED(closure))
static int FEdge_nature_set(BPy_FEdge *self, PyObject *value, void *UNUSED(closure))
static int FEdge_viewedge_set(BPy_FEdge *self, PyObject *value, void *UNUSED(closure))
static PyObject * FEdge_previous_fedge_get(BPy_FEdge *self, void *UNUSED(closure))
static PyObject * FEdge_second_svertex_get(BPy_FEdge *self, void *UNUSED(closure))
static PyObject * FEdge_is_smooth_get(BPy_FEdge *self, void *UNUSED(closure))
static Py_ssize_t FEdge_sq_length(BPy_FEdge *)
static int FEdge_is_smooth_set(BPy_FEdge *self, PyObject *value, void *UNUSED(closure))
static int FEdge_next_fedge_set(BPy_FEdge *self, PyObject *value, void *UNUSED(closure))
static PyObject * FEdge_next_fedge_get(BPy_FEdge *self, void *UNUSED(closure))
PyDoc_STRVAR(FEdge_doc, "Class hierarchy: :class:`Interface1D` > :class:`FEdge`\n" "\n" "Base Class for feature edges. This FEdge can represent a silhouette,\n" "a crease, a ridge/valley, a border or a suggestive contour. For\n" "silhouettes, the FEdge is oriented so that the visible face lies on\n" "the left of the edge. For borders, the FEdge is oriented so that the\n" "face lies on the left of the edge. An FEdge can represent an initial\n" "edge of the mesh or runs across a face of the initial mesh depending\n" "on the smoothness or sharpness of the mesh. This class is specialized\n" "into a smooth and a sharp version since their properties slightly vary\n" "from one to the other.\n" "\n" ".. method:: FEdge()\n" " FEdge(brother)\n" "\n" " Builds an :class:`FEdge` using the default constructor,\n" " copy constructor, or between two :class:`SVertex` objects.\n" "\n" " :arg brother: An FEdge object.\n" " :type brother: :class:`FEdge`\n" " :arg first_vertex: The first SVertex.\n" " :type first_vertex: :class:`SVertex`\n" " :arg second_vertex: The second SVertex.\n" " :type second_vertex: :class:`SVertex`")
static PyObject * FEdge_first_svertex_get(BPy_FEdge *self, void *UNUSED(closure))
static PyObject * FEdge_id_get(BPy_FEdge *self, void *UNUSED(closure))
static int FEdge_previous_fedge_set(BPy_FEdge *self, PyObject *value, void *UNUSED(closure))
static int FEdge_init(BPy_FEdge *self, PyObject *args, PyObject *kwds)
static PyGetSetDef BPy_FEdge_getseters[]
static PyObject * FEdge_sq_item(BPy_FEdge *self, int keynum)
static PyObject * FEdge_viewedge_get(BPy_FEdge *self, void *UNUSED(closure))
#define BPy_FEdge_Check(v)
PyTypeObject Interface1D_Type
#define BPy_Nature_Check(v)
PyTypeObject SVertex_Type
#define BPy_SVertex_Check(v)
#define BPy_ViewEdge_Check(v)
ATTR_WARN_UNUSED_RESULT const BMVert * v