20 if (module ==
nullptr) {
24 if (PyType_Ready(&
Id_Type) < 0) {
28 PyModule_AddObjectRef(module,
"Id", (PyObject *)&
Id_Type);
37 "Class for representing an object Id.\n"
39 ".. method:: __init__(*args, **kwargs)\n"
41 " Accepted call signatures:\n"
43 " - ``__init__(brother)``\n"
44 " - ``__init__(first=0, second=0)``\n"
46 " Build the Id from two numbers or another :class:`Id` using the copy constructor.\n"
48 " :param brother: An Id object.\n"
49 " :type brother: :class:`Id`\n"
50 " :param first: The first number.\n"
52 " :param second: The second number.\n"
53 " :type second: int\n");
56 static const char *kwlist_1[] = {
"brother",
nullptr};
57 static const char *kwlist_2[] = {
"first",
"second",
nullptr};
59 int first = 0, second = 0;
61 if (PyArg_ParseTupleAndKeywords(args,
71 else if ((
void)PyErr_Clear(),
72 PyArg_ParseTupleAndKeywords(args,
82 self->
id =
new Id(first, second);
85 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
94 Py_TYPE(self)->tp_free((PyObject *)self);
99 return PyUnicode_FromFormat(
127 "The first number constituting the Id.\n"
138 if ((scalar = PyLong_AsLong(value)) == -1 && PyErr_Occurred()) {
139 PyErr_SetString(PyExc_TypeError,
"value must be an integer");
149 "The second number constituting the Id.\n"
160 if ((scalar = PyLong_AsLong(value)) == -1 && PyErr_Occurred()) {
161 PyErr_SetString(PyExc_TypeError,
"value must be an integer");
171 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
177 PyVarObject_HEAD_INIT(
nullptr, 0)
196 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * PyBool_from_bool(bool b)
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" " :param inter1: The first Interface1D object.\n" " :type inter1: :class:`freestyle.types.Interface1D`\n" " :param inter2: The second Interface1D object.\n" " :type inter2: :class:`freestyle.types.Interface1D`\n" " :return: False.\n" " :rtype: bool\n")
static int Id_second_set(BPy_Id *self, PyObject *value, void *)
static int Id_first_set(BPy_Id *self, PyObject *value, void *)
static void Id_dealloc(BPy_Id *self)
static int Id_init(BPy_Id *self, PyObject *args, PyObject *kwds)
static PyObject * Id_repr(BPy_Id *self)
static PyGetSetDef BPy_Id_getseters[]
static PyObject * Id_second_get(BPy_Id *self, void *)
static PyObject * Id_first_get(BPy_Id *self, void *)
int Id_Init(PyObject *module)
static PyObject * Id_RichCompare(BPy_Id *o1, BPy_Id *o2, int opid)
void setFirst(id_type first)
id_type getSecond() const
void setSecond(id_type second)
PyObject_HEAD Freestyle::Id * id