Blender  V3.3
BPy_Convert.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #pragma once
8 
9 extern "C" {
10 #include <Python.h>
11 }
12 
13 #include <typeinfo>
14 
15 #include "../geometry/Geom.h"
16 
17 // BBox
18 #include "../geometry/BBox.h"
19 
20 // FEdge, FEdgeSharp, FEdgeSmooth, SShape, SVertex, FEdgeInternal::SVertexIterator
21 #include "../view_map/Silhouette.h"
22 
23 // Id
24 #include "../system/Id.h"
25 
26 // Interface0D, Interface0DIteratorNested, Interface0DIterator
27 #include "../view_map/Interface0D.h"
28 
29 // Interface1D
30 #include "../view_map/Interface1D.h"
31 
32 // FrsMaterial
33 #include "../scene_graph/FrsMaterial.h"
34 
35 // Nature::VertexNature, Nature::EdgeNature
36 #include "../winged_edge/Nature.h"
37 
38 // Stroke, StrokeAttribute, StrokeVertex
39 #include "../stroke/Stroke.h"
40 
41 // NonTVertex, TVertex, ViewEdge, ViewMap, ViewShape, ViewVertex
42 #include "../view_map/ViewMap.h"
43 
44 // CurvePoint, Curve
45 #include "../stroke/Curve.h"
46 
47 // Chain
48 #include "../stroke/Chain.h"
49 
50 //====== ITERATORS
51 
52 // AdjacencyIterator, ChainingIterator, ChainSilhouetteIterator, ChainPredicateIterator
53 #include "../stroke/ChainingIterators.h"
54 
55 // ViewVertexInternal::orientedViewEdgeIterator
56 // ViewEdgeInternal::SVertexIterator
57 // ViewEdgeInternal::ViewEdgeIterator
58 #include "../view_map/ViewMapIterators.h"
59 
60 // StrokeInternal::StrokeVertexIterator
61 #include "../stroke/StrokeIterators.h"
62 
63 // CurveInternal::CurvePointIterator
64 #include "../stroke/CurveIterators.h"
65 
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69 
71 
73 #include "mathutils/mathutils.h"
74 
75 //==============================
76 // C++ => Python
77 //==============================
78 
79 PyObject *PyBool_from_bool(bool b);
83 
88 
95 PyObject *BPy_Id_from_Id(Freestyle::Id &id);
100 PyObject *BPy_Nature_from_Nature(unsigned short n);
113 
116  bool reversed);
132 
133 //==============================
134 // Python => C++
135 //==============================
136 
137 bool bool_from_PyBool(PyObject *b);
141 bool Vec2f_ptr_from_PyObject(PyObject *obj, Freestyle::Geometry::Vec2f &vec);
143 bool Vec3r_ptr_from_PyObject(PyObject *obj, Freestyle::Geometry::Vec3r &vec);
144 bool Vec2f_ptr_from_Vector(PyObject *obj, Freestyle::Geometry::Vec2f &vec);
146 bool Vec3r_ptr_from_Vector(PyObject *obj, Freestyle::Geometry::Vec3r &vec);
148 bool Vec3r_ptr_from_Color(PyObject *obj, Freestyle::Geometry::Vec3r &vec);
149 bool Vec2f_ptr_from_PyList(PyObject *obj, Freestyle::Geometry::Vec2f &vec);
151 bool Vec3r_ptr_from_PyList(PyObject *obj, Freestyle::Geometry::Vec3r &vec);
152 bool Vec2f_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec2f &vec);
154 bool Vec3r_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec3r &vec);
155 
156 bool float_array_from_PyObject(PyObject *obj, float *v, int n);
157 
158 int convert_v4(PyObject *obj, void *v);
159 int convert_v3(PyObject *obj, void *v);
160 int convert_v2(PyObject *obj, void *v);
161 
163 
164 #ifdef __cplusplus
165 }
166 #endif
PyObject * BPy_Interface0DIterator_from_Interface0DIterator(Freestyle::Interface0DIterator &if0D_it, bool reversed)
PyObject * BPy_FEdgeSmooth_from_FEdgeSmooth(Freestyle::FEdgeSmooth &fes)
PyObject * PyBool_from_bool(bool b)
Definition: BPy_Convert.cpp:59
PyObject * BPy_ViewShape_from_ViewShape(Freestyle::ViewShape &vs)
PyObject * BPy_MediumType_from_MediumType(Freestyle::Stroke::MediumType n)
PyObject * BPy_StrokeVertex_from_StrokeVertex(Freestyle::StrokeVertex &sv)
PyObject * BPy_Stroke_from_Stroke(Freestyle::Stroke &s)
bool bool_from_PyBool(PyObject *b)
PyObject * Any_BPy_Interface1D_from_Interface1D(Freestyle::Interface1D &if1D)
bool Vec3r_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec3r &vec)
PyObject * BPy_SVertexIterator_from_SVertexIterator(Freestyle::ViewEdgeInternal::SVertexIterator &sv_it)
Freestyle::Nature::EdgeNature EdgeNature_from_BPy_Nature(PyObject *obj)
Freestyle::Stroke::MediumType MediumType_from_BPy_MediumType(PyObject *obj)
PyObject * Any_BPy_ViewVertex_from_ViewVertex(Freestyle::ViewVertex &vv)
bool Vec3r_ptr_from_PyObject(PyObject *obj, Freestyle::Geometry::Vec3r &vec)
PyObject * BPy_CurvePoint_from_CurvePoint(Freestyle::CurvePoint &cp)
PyObject * BPy_ViewEdge_from_ViewEdge(Freestyle::ViewEdge &ve)
PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator(Freestyle::StrokeInternal::StrokeVertexIterator &sv_it, bool reversed)
PyObject * BPy_Interface1D_from_Interface1D(Freestyle::Interface1D &if1D)
PyObject * BPy_FEdgeSharp_from_FEdgeSharp(Freestyle::FEdgeSharp &fes)
bool Vec3f_ptr_from_Color(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
PyObject * BPy_AdjacencyIterator_from_AdjacencyIterator(Freestyle::AdjacencyIterator &a_it)
PyObject * BPy_IntegrationType_from_IntegrationType(Freestyle::IntegrationType i)
bool float_array_from_PyObject(PyObject *obj, float *v, int n)
PyObject * Vector_from_Vec3r(Freestyle::Geometry::Vec3r &v)
Definition: BPy_Convert.cpp:81
PyObject * BPy_BBox_from_BBox(const Freestyle::BBox< Freestyle::Geometry::Vec3r > &bb)
PyObject * BPy_ChainingIterator_from_ChainingIterator(Freestyle::ChainingIterator &c_it)
bool Vec3f_ptr_from_PyList(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
PyObject * BPy_StrokeAttribute_from_StrokeAttribute(Freestyle::StrokeAttribute &sa)
bool Vec3r_ptr_from_Color(PyObject *obj, Freestyle::Geometry::Vec3r &vec)
PyObject * BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator(Freestyle::ChainSilhouetteIterator &cs_it)
PyObject * BPy_directedViewEdge_from_directedViewEdge(Freestyle::ViewVertex::directedViewEdge &dve)
PyObject * BPy_SShape_from_SShape(Freestyle::SShape &ss)
bool Vec3f_ptr_from_PyObject(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
PyObject * BPy_NonTVertex_from_NonTVertex(Freestyle::NonTVertex &ntv)
PyObject * BPy_FEdge_from_FEdge(Freestyle::FEdge &fe)
PyObject * BPy_Chain_from_Chain(Freestyle::Chain &c)
bool Vec2f_ptr_from_PyObject(PyObject *obj, Freestyle::Geometry::Vec2f &vec)
bool Vec3f_ptr_from_Vector(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
PyObject * BPy_TVertex_from_TVertex(Freestyle::TVertex &tv)
bool Vec2f_ptr_from_Vector(PyObject *obj, Freestyle::Geometry::Vec2f &vec)
bool Vec3r_ptr_from_PyList(PyObject *obj, Freestyle::Geometry::Vec3r &vec)
bool Vec3r_ptr_from_Vector(PyObject *obj, Freestyle::Geometry::Vec3r &vec)
bool Vec2f_ptr_from_PyList(PyObject *obj, Freestyle::Geometry::Vec2f &vec)
PyObject * BPy_SVertex_from_SVertex(Freestyle::SVertex &sv)
int convert_v4(PyObject *obj, void *v)
PyObject * BPy_FrsMaterial_from_FrsMaterial(const Freestyle::FrsMaterial &m)
bool Vec2f_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec2f &vec)
PyObject * BPy_Nature_from_Nature(unsigned short n)
PyObject * BPy_ChainPredicateIterator_from_ChainPredicateIterator(Freestyle::ChainPredicateIterator &cp_it)
PyObject * BPy_Id_from_Id(Freestyle::Id &id)
Definition: BPy_Convert.cpp:90
PyObject * BPy_ViewVertex_from_ViewVertex(Freestyle::ViewVertex &vv)
PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator(Freestyle::ViewVertexInternal::orientedViewEdgeIterator &ove_it, bool reversed)
int convert_v3(PyObject *obj, void *v)
PyObject * Any_BPy_FEdge_from_FEdge(Freestyle::FEdge &fe)
PyObject * BPy_ViewEdgeIterator_from_ViewEdgeIterator(Freestyle::ViewEdgeInternal::ViewEdgeIterator &ve_it)
PyObject * BPy_Interface0D_from_Interface0D(Freestyle::Interface0D &if0D)
PyObject * Vector_from_Vec2f(Freestyle::Geometry::Vec2f &v)
Definition: BPy_Convert.cpp:64
Freestyle::IntegrationType IntegrationType_from_BPy_IntegrationType(PyObject *obj)
PyObject * BPy_CurvePointIterator_from_CurvePointIterator(Freestyle::CurveInternal::CurvePointIterator &cp_it)
PyObject * Any_BPy_Interface0D_from_Interface0D(Freestyle::Interface0D &if0D)
Definition: BPy_Convert.cpp:97
int convert_v2(PyObject *obj, void *v)
PyObject * Vector_from_Vec3f(Freestyle::Geometry::Vec3f &v)
bool Vec3f_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
ATTR_WARN_UNUSED_RESULT const BMVert * v
pair< ViewEdge *, bool > directedViewEdge
Definition: ViewMap.h:266
unsigned short EdgeNature
Definition: Nature.h:32
static unsigned c
Definition: RandGen.cpp:83
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
header-only utilities