58 #include "../stroke/StrokeRep.h"
75 return PyBool_FromLong(b ? 1 : 0);
81 vec_data[0] = vec.
x();
82 vec_data[1] = vec.
y();
89 vec_data[0] = vec.x();
90 vec_data[1] = vec.y();
91 vec_data[2] = vec.z();
98 vec_data[0] = vec.
x();
99 vec_data[1] = vec.
y();
100 vec_data[2] = vec.
z();
107 ((
BPy_Id *)py_id)->id =
new Id(
id.getFirst(),
id.getSecond());
119 if (
typeid(if0D) ==
typeid(
SVertex)) {
128 if (
typeid(if0D) ==
typeid(
TVertex)) {
135 PyErr_SetString(PyExc_TypeError, msg.c_str());
141 if (
typeid(if1D) ==
typeid(
ViewEdge)) {
144 if (
typeid(if1D) ==
typeid(
Chain)) {
147 if (
typeid(if1D) ==
typeid(
Stroke)) {
156 if (
typeid(if1D) ==
typeid(
FEdge)) {
163 PyErr_SetString(PyExc_TypeError, msg.c_str());
175 if (
typeid(fe) ==
typeid(
FEdge)) {
179 PyErr_SetString(PyExc_TypeError, msg.c_str());
188 if (
typeid(vv) ==
typeid(
TVertex)) {
195 PyErr_SetString(PyExc_TypeError, msg.c_str());
249 ((
BPy_FEdge *)py_fe)->py_if1D.borrowed =
true;
255 PyObject *args = PyTuple_New(1);
256 PyTuple_SET_ITEM(args, 0, PyLong_FromLong(n));
267 ((
BPy_Stroke *)py_s)->py_if1D.borrowed =
true;
281 PyObject *args = PyTuple_New(1);
282 PyTuple_SET_ITEM(args, 0, PyLong_FromLong(n));
323 ((
BPy_TVertex *)py_tv)->py_vv.py_if0D.borrowed =
true;
349 ((
BPy_Chain *)py_c)->py_c.py_if1D.borrowed =
true;
379 PyObject *args = PyTuple_New(1);
380 PyTuple_SET_ITEM(args, 0, PyLong_FromLong(i));
402 PyObject *py_dve = PyTuple_New(2);
518 return PyObject_IsTrue(b) != 0;
655 for (
int i = 0; i < n; i++) {
656 v[i] = PyFloat_AsDouble(PyList_GET_ITEM(obj, i));
657 if (
v[i] == -1.0f && PyErr_Occurred()) {
658 PyErr_SetString(PyExc_TypeError,
"list elements must be a number");
669 if (!PyList_Check(obj) || PyList_GET_SIZE(obj) != 2) {
684 if (!PyList_Check(obj) || PyList_GET_SIZE(obj) != 3) {
700 if (!PyList_Check(obj) || PyList_GET_SIZE(obj) != 3) {
714 for (
int i = 0; i < n; i++) {
715 v[i] = PyFloat_AsDouble(PyTuple_GET_ITEM(obj, i));
716 if (
v[i] == -1.0f && PyErr_Occurred()) {
717 PyErr_SetString(PyExc_TypeError,
"tuple elements must be a number");
728 if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 2) {
743 if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 3) {
759 if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 3) {
779 for (
int i = 0; i < n; i++) {
788 for (
int i = 0; i < n; i++) {
793 if (PyList_Check(obj) && PyList_GET_SIZE(obj) == n) {
796 if (PyTuple_Check(obj) && PyTuple_GET_SIZE(obj) == n) {
PyTypeObject AdjacencyIterator_Type
PyTypeObject ChainPredicateIterator_Type
PyTypeObject ChainSilhouetteIterator_Type
PyTypeObject ChainingIterator_Type
bool Vec3r_ptr_from_Vector(PyObject *obj, Vec3r &vec)
PyObject * BPy_SVertex_from_SVertex(SVertex &sv)
bool Vec3r_ptr_from_Color(PyObject *obj, Vec3r &vec)
bool Vec2f_ptr_from_Vector(PyObject *obj, Vec2f &vec)
PyObject * BPy_MediumType_from_MediumType(Stroke::MediumType n)
PyObject * Vector_from_Vec3f(Vec3f &vec)
PyObject * PyBool_from_bool(bool b)
bool Vec3r_ptr_from_PyList(PyObject *obj, Vec3r &vec)
bool Vec3r_ptr_from_PyTuple(PyObject *obj, Vec3r &vec)
PyObject * BPy_Chain_from_Chain(Chain &c)
PyObject * BPy_Interface0DIterator_from_Interface0DIterator(Interface0DIterator &if0D_it, bool reversed)
bool bool_from_PyBool(PyObject *b)
PyObject * BPy_SShape_from_SShape(SShape &ss)
bool Vec2f_ptr_from_PyTuple(PyObject *obj, Vec2f &vec)
PyObject * BPy_TVertex_from_TVertex(TVertex &tv)
PyObject * BPy_Stroke_from_Stroke(Stroke &s)
bool Vec3f_ptr_from_PyObject(PyObject *obj, Vec3f &vec)
PyObject * BPy_ChainingIterator_from_ChainingIterator(ChainingIterator &c_it)
bool Vec3f_ptr_from_Color(PyObject *obj, Vec3f &vec)
PyObject * BPy_ViewVertex_from_ViewVertex(ViewVertex &vv)
PyObject * BPy_Interface1D_from_Interface1D(Interface1D &if1D)
PyObject * BPy_ViewShape_from_ViewShape(ViewShape &vs)
bool Vec2f_ptr_from_PyObject(PyObject *obj, Vec2f &vec)
bool float_array_from_PyObject(PyObject *obj, float *v, int n)
bool Vec3f_ptr_from_PyTuple(PyObject *obj, Vec3f &vec)
PyObject * BPy_directedViewEdge_from_directedViewEdge(ViewVertex::directedViewEdge &dve)
PyObject * BPy_IntegrationType_from_IntegrationType(IntegrationType i)
PyObject * BPy_SVertexIterator_from_SVertexIterator(ViewEdgeInternal::SVertexIterator &sv_it)
PyObject * Any_BPy_Interface1D_from_Interface1D(Interface1D &if1D)
Nature::EdgeNature EdgeNature_from_BPy_Nature(PyObject *obj)
PyObject * BPy_FEdge_from_FEdge(FEdge &fe)
PyObject * BPy_CurvePointIterator_from_CurvePointIterator(CurveInternal::CurvePointIterator &cp_it)
PyObject * Vector_from_Vec2f(Vec2f &vec)
bool Vec3f_ptr_from_PyList(PyObject *obj, Vec3f &vec)
PyObject * BPy_StrokeAttribute_from_StrokeAttribute(StrokeAttribute &sa)
PyObject * Any_BPy_Interface0D_from_Interface0D(Interface0D &if0D)
PyObject * BPy_FEdgeSmooth_from_FEdgeSmooth(FEdgeSmooth &fes)
PyObject * BPy_ViewEdge_from_ViewEdge(ViewEdge &ve)
PyObject * BPy_ChainPredicateIterator_from_ChainPredicateIterator(ChainPredicateIterator &cp_it)
PyObject * BPy_Interface0D_from_Interface0D(Interface0D &if0D)
PyObject * BPy_StrokeVertex_from_StrokeVertex(StrokeVertex &sv)
PyObject * Any_BPy_FEdge_from_FEdge(FEdge &fe)
PyObject * BPy_Id_from_Id(Id &id)
int convert_v4(PyObject *obj, void *v)
IntegrationType IntegrationType_from_BPy_IntegrationType(PyObject *obj)
PyObject * BPy_FEdgeSharp_from_FEdgeSharp(FEdgeSharp &fes)
Stroke::MediumType MediumType_from_BPy_MediumType(PyObject *obj)
PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator(ViewVertexInternal::orientedViewEdgeIterator &ove_it, bool reversed)
PyObject * BPy_AdjacencyIterator_from_AdjacencyIterator(AdjacencyIterator &a_it)
static bool float_array_from_PyList(PyObject *obj, float *v, int n)
PyObject * BPy_Nature_from_Nature(unsigned short n)
PyObject * BPy_CurvePoint_from_CurvePoint(CurvePoint &cp)
PyObject * BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator(ChainSilhouetteIterator &cs_it)
PyObject * BPy_FrsMaterial_from_FrsMaterial(const FrsMaterial &m)
int convert_v3(PyObject *obj, void *v)
PyObject * BPy_BBox_from_BBox(const BBox< Vec3r > &bb)
bool Vec2f_ptr_from_PyList(PyObject *obj, Vec2f &vec)
bool Vec3f_ptr_from_Vector(PyObject *obj, Vec3f &vec)
bool Vec3r_ptr_from_PyObject(PyObject *obj, Vec3r &vec)
static bool float_array_from_PyTuple(PyObject *obj, float *v, int n)
PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator(StrokeInternal::StrokeVertexIterator &sv_it, bool reversed)
PyObject * Any_BPy_ViewVertex_from_ViewVertex(ViewVertex &vv)
PyObject * BPy_NonTVertex_from_NonTVertex(NonTVertex &ntv)
PyObject * Vector_from_Vec3r(Vec3r &vec)
PyObject * BPy_ViewEdgeIterator_from_ViewEdgeIterator(ViewEdgeInternal::ViewEdgeIterator &ve_it)
int convert_v2(PyObject *obj, void *v)
PyTypeObject CurvePointIterator_Type
PyTypeObject CurvePoint_Type
PyTypeObject FEdgeSharp_Type
PyTypeObject FEdgeSmooth_Type
PyTypeObject FrsMaterial_Type
PyTypeObject IntegrationType_Type
PyTypeObject Interface0DIterator_Type
PyTypeObject Interface0D_Type
PyTypeObject Interface1D_Type
PyTypeObject MediumType_Type
PyTypeObject NonTVertex_Type
PyTypeObject SVertexIterator_Type
PyTypeObject SVertex_Type
PyTypeObject StrokeAttribute_Type
PyTypeObject StrokeVertexIterator_Type
PyTypeObject StrokeVertex_Type
PyTypeObject TVertex_Type
PyTypeObject ViewEdgeIterator_Type
PyTypeObject ViewEdge_Type
PyTypeObject ViewShape_Type
PyTypeObject ViewVertex_Type
PyTypeObject orientedViewEdgeIterator_Type
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
virtual string getExactTypeName() const
virtual string getExactTypeName() const
virtual string getExactTypeName() const
pair< ViewEdge *, bool > directedViewEdge
virtual string getExactTypeName() const
int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *value, const char *error_prefix)
#define BaseMath_ReadCallback(_self)
#define ColorObject_Check(v)
PyObject * Vector_CreatePyObject(const float *vec, const int size, PyTypeObject *base_type)
#define VectorObject_Check(v)
unsigned short EdgeNature
#define PyTuple_SET_ITEMS(op_arg,...)