Blender V4.3
BPy_Convert.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11extern "C" {
12#include <Python.h>
13}
14
15#include <typeinfo>
16
17#include "../geometry/Geom.h"
18
19// BBox
20#include "../geometry/BBox.h"
21
22// FEdge, FEdgeSharp, FEdgeSmooth, SShape, SVertex, FEdgeInternal::SVertexIterator
24
25// Id
26#include "../system/Id.h"
27
28// Interface0D, Interface0DIteratorNested, Interface0DIterator
30
31// Interface1D
33
34// FrsMaterial
36
37// Nature::VertexNature, Nature::EdgeNature
39
40// Stroke, StrokeAttribute, StrokeVertex
41#include "../stroke/Stroke.h"
42
43// NonTVertex, TVertex, ViewEdge, ViewMap, ViewShape, ViewVertex
44#include "../view_map/ViewMap.h"
45
46// CurvePoint, Curve
47#include "../stroke/Curve.h"
48
49// Chain
50#include "../stroke/Chain.h"
51
52//====== ITERATORS
53
54// AdjacencyIterator, ChainingIterator, ChainSilhouetteIterator, ChainPredicateIterator
56
57// ViewVertexInternal::orientedViewEdgeIterator
58// ViewEdgeInternal::SVertexIterator
59// ViewEdgeInternal::ViewEdgeIterator
61
62// StrokeInternal::StrokeVertexIterator
64
65// CurveInternal::CurvePointIterator
67
69
72
73//==============================
74// C++ => Python
75//==============================
76
77PyObject *PyLong_subtype_new(PyTypeObject *ty, long value);
78void PyLong_subtype_add_to_dict(PyObject *dict, PyTypeObject *ty, const char *attr, long value);
79
80PyObject *PyBool_from_bool(bool b);
84
89
96PyObject *BPy_Id_from_Id(Freestyle::Id &id);
101PyObject *BPy_Nature_from_Nature(ushort n);
114
117 bool reversed);
133
134//==============================
135// Python => C++
136//==============================
137
138bool bool_from_PyBool(PyObject *b);
145bool Vec2f_ptr_from_Vector(PyObject *obj, Freestyle::Geometry::Vec2f &vec);
147bool Vec3r_ptr_from_Vector(PyObject *obj, Freestyle::Geometry::Vec3r &vec);
149bool Vec3r_ptr_from_Color(PyObject *obj, Freestyle::Geometry::Vec3r &vec);
150bool Vec2f_ptr_from_PyList(PyObject *obj, Freestyle::Geometry::Vec2f &vec);
152bool Vec3r_ptr_from_PyList(PyObject *obj, Freestyle::Geometry::Vec3r &vec);
153bool Vec2f_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec2f &vec);
155bool Vec3r_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec3r &vec);
156
157bool float_array_from_PyObject(PyObject *obj, float *v, int n);
158
159int convert_v4(PyObject *obj, void *v);
160int convert_v3(PyObject *obj, void *v);
161int convert_v2(PyObject *obj, void *v);
162
A class to hold a bounding box.
unsigned short ushort
PyObject * BPy_CurvePointIterator_from_CurvePointIterator(Freestyle::CurveInternal::CurvePointIterator &cp_it)
PyObject * BPy_FrsMaterial_from_FrsMaterial(const Freestyle::FrsMaterial &m)
PyObject * BPy_Stroke_from_Stroke(Freestyle::Stroke &s)
PyObject * Any_BPy_Interface1D_from_Interface1D(Freestyle::Interface1D &if1D)
PyObject * BPy_NonTVertex_from_NonTVertex(Freestyle::NonTVertex &ntv)
bool bool_from_PyBool(PyObject *b)
PyObject * Vector_from_Vec3r(Freestyle::Geometry::Vec3r &v)
void PyLong_subtype_add_to_dict(PyObject *dict, PyTypeObject *ty, const char *attr, long value)
bool Vec3r_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec3r &vec)
PyObject * BPy_ChainingIterator_from_ChainingIterator(Freestyle::ChainingIterator &c_it)
PyObject * BPy_Interface0D_from_Interface0D(Freestyle::Interface0D &if0D)
Freestyle::Nature::EdgeNature EdgeNature_from_BPy_Nature(PyObject *obj)
Freestyle::Stroke::MediumType MediumType_from_BPy_MediumType(PyObject *obj)
bool Vec3r_ptr_from_PyObject(PyObject *obj, Freestyle::Geometry::Vec3r &vec)
PyObject * PyLong_subtype_new(PyTypeObject *ty, long value)
PyObject * BPy_TVertex_from_TVertex(Freestyle::TVertex &tv)
PyObject * BPy_StrokeVertex_from_StrokeVertex(Freestyle::StrokeVertex &sv)
PyObject * BPy_SVertexIterator_from_SVertexIterator(Freestyle::ViewEdgeInternal::SVertexIterator &sv_it)
PyObject * BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator(Freestyle::ChainSilhouetteIterator &cs_it)
bool Vec3f_ptr_from_Color(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
PyObject * BPy_Interface1D_from_Interface1D(Freestyle::Interface1D &if1D)
bool float_array_from_PyObject(PyObject *obj, float *v, int n)
PyObject * BPy_FEdgeSharp_from_FEdgeSharp(Freestyle::FEdgeSharp &fes)
PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator(Freestyle::StrokeInternal::StrokeVertexIterator &sv_it, bool reversed)
bool Vec3f_ptr_from_PyList(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
bool Vec3r_ptr_from_Color(PyObject *obj, Freestyle::Geometry::Vec3r &vec)
PyObject * BPy_ViewEdge_from_ViewEdge(Freestyle::ViewEdge &ve)
PyObject * BPy_Chain_from_Chain(Freestyle::Chain &c)
bool Vec3f_ptr_from_PyObject(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
PyObject * BPy_FEdge_from_FEdge(Freestyle::FEdge &fe)
PyObject * BPy_FEdgeSmooth_from_FEdgeSmooth(Freestyle::FEdgeSmooth &fes)
PyObject * Any_BPy_Interface0D_from_Interface0D(Freestyle::Interface0D &if0D)
PyObject * BPy_BBox_from_BBox(const Freestyle::BBox< Freestyle::Geometry::Vec3r > &bb)
bool Vec2f_ptr_from_PyObject(PyObject *obj, Freestyle::Geometry::Vec2f &vec)
bool Vec3f_ptr_from_Vector(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
PyObject * BPy_directedViewEdge_from_directedViewEdge(Freestyle::ViewVertex::directedViewEdge &dve)
PyObject * BPy_ChainPredicateIterator_from_ChainPredicateIterator(Freestyle::ChainPredicateIterator &cp_it)
PyObject * BPy_Nature_from_Nature(ushort n)
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)
PyObject * Any_BPy_ViewVertex_from_ViewVertex(Freestyle::ViewVertex &vv)
bool Vec2f_ptr_from_PyList(PyObject *obj, Freestyle::Geometry::Vec2f &vec)
PyObject * BPy_CurvePoint_from_CurvePoint(Freestyle::CurvePoint &cp)
PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator(Freestyle::ViewVertexInternal::orientedViewEdgeIterator &ove_it, bool reversed)
PyObject * BPy_Id_from_Id(Freestyle::Id &id)
PyObject * BPy_AdjacencyIterator_from_AdjacencyIterator(Freestyle::AdjacencyIterator &a_it)
int convert_v4(PyObject *obj, void *v)
PyObject * BPy_MediumType_from_MediumType(Freestyle::Stroke::MediumType n)
PyObject * BPy_ViewEdgeIterator_from_ViewEdgeIterator(Freestyle::ViewEdgeInternal::ViewEdgeIterator &ve_it)
PyObject * Vector_from_Vec2f(Freestyle::Geometry::Vec2f &v)
bool Vec2f_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec2f &vec)
PyObject * BPy_Interface0DIterator_from_Interface0DIterator(Freestyle::Interface0DIterator &if0D_it, bool reversed)
PyObject * BPy_StrokeAttribute_from_StrokeAttribute(Freestyle::StrokeAttribute &sa)
PyObject * Any_BPy_FEdge_from_FEdge(Freestyle::FEdge &fe)
int convert_v3(PyObject *obj, void *v)
PyObject * BPy_SShape_from_SShape(Freestyle::SShape &ss)
PyObject * BPy_SVertex_from_SVertex(Freestyle::SVertex &sv)
PyObject * PyBool_from_bool(bool b)
PyObject * BPy_ViewShape_from_ViewShape(Freestyle::ViewShape &vs)
PyObject * BPy_ViewVertex_from_ViewVertex(Freestyle::ViewVertex &vv)
PyObject * BPy_IntegrationType_from_IntegrationType(Freestyle::IntegrationType i)
Freestyle::IntegrationType IntegrationType_from_BPy_IntegrationType(PyObject *obj)
PyObject * Vector_from_Vec3f(Freestyle::Geometry::Vec3f &v)
int convert_v2(PyObject *obj, void *v)
bool Vec3f_ptr_from_PyTuple(PyObject *obj, Freestyle::Geometry::Vec3f &vec)
Class to define a chain of view-edges.
Chaining iterators.
Iterators used to iterate over the elements of the Curve.
Class to define a container for curves.
Class used to handle materials.
Vectors and Matrices (useful type definitions)
Identification system.
Interface to 0D elements.
Interface 1D and related tools definitions.
Different natures for both vertices and edges.
Classes to define a silhouette structure.
Iterators used to iterate over the elements of the Stroke.
Classes to define a stroke.
Iterators used to iterate over the various elements of the ViewMap.
Classes to define a View Map (ViewVertex, ViewEdge, etc.)
ATTR_WARN_UNUSED_RESULT const BMVert * v
pair< ViewEdge *, bool > directedViewEdge
Definition ViewMap.h:267
local_group_size(16, 16) .push_constant(Type b
ushort EdgeNature
Definition Nature.h:36
header-only utilities