Made the Freestyle Python API compatible with Python 3.
[blender.git] / source / blender / freestyle / intern / python / UnaryFunction1D / UnaryFunction1D_Nature_EdgeNature / BPy_CurveNatureF1D.cpp
1 #include "BPy_CurveNatureF1D.h"
2
3 #include "../../../view_map/Functions1D.h"
4 #include "../../BPy_Convert.h"
5 #include "../../BPy_IntegrationType.h"
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 ///////////////////////////////////////////////////////////////////////////////////////////
12
13 /*---------------  Python API function prototypes for CurveNatureF1D instance  -----------*/
14 static int CurveNatureF1D___init__( BPy_CurveNatureF1D* self, PyObject *args);
15
16 /*-----------------------BPy_CurveNatureF1D type definition ------------------------------*/
17
18 PyTypeObject CurveNatureF1D_Type = {
19         PyObject_HEAD_INIT(NULL)
20         "CurveNatureF1D",               /* tp_name */
21         sizeof(BPy_CurveNatureF1D),     /* tp_basicsize */
22         0,                              /* tp_itemsize */
23         0,                              /* tp_dealloc */
24         0,                              /* tp_print */
25         0,                              /* tp_getattr */
26         0,                              /* tp_setattr */
27         0,                              /* tp_reserved */
28         0,                              /* tp_repr */
29         0,                              /* tp_as_number */
30         0,                              /* tp_as_sequence */
31         0,                              /* tp_as_mapping */
32         0,                              /* tp_hash  */
33         0,                              /* tp_call */
34         0,                              /* tp_str */
35         0,                              /* tp_getattro */
36         0,                              /* tp_setattro */
37         0,                              /* tp_as_buffer */
38         Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
39         "CurveNatureF1D objects",       /* tp_doc */
40         0,                              /* tp_traverse */
41         0,                              /* tp_clear */
42         0,                              /* tp_richcompare */
43         0,                              /* tp_weaklistoffset */
44         0,                              /* tp_iter */
45         0,                              /* tp_iternext */
46         0,                              /* tp_methods */
47         0,                              /* tp_members */
48         0,                              /* tp_getset */
49         &UnaryFunction1DEdgeNature_Type, /* tp_base */
50         0,                              /* tp_dict */
51         0,                              /* tp_descr_get */
52         0,                              /* tp_descr_set */
53         0,                              /* tp_dictoffset */
54         (initproc)CurveNatureF1D___init__, /* tp_init */
55         0,                              /* tp_alloc */
56         0,                              /* tp_new */
57 };
58
59 //------------------------INSTANCE METHODS ----------------------------------
60
61 int CurveNatureF1D___init__( BPy_CurveNatureF1D* self, PyObject *args)
62 {
63         PyObject *obj = 0;
64
65         if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) )
66                 return -1;
67         
68         IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
69         self->py_uf1D_edgenature.uf1D_edgenature = new Functions1D::CurveNatureF1D(t);
70         return 0;
71 }
72
73 ///////////////////////////////////////////////////////////////////////////////////////////
74
75 #ifdef __cplusplus
76 }
77 #endif