44 #include "../stroke/StrokeRep.h"
61 return PyBool_FromLong(
b ? 1 : 0);
67 vec_data[0] = vec.
x();
68 vec_data[1] = vec.
y();
75 vec_data[0] = vec.x();
76 vec_data[1] = vec.y();
77 vec_data[2] = vec.z();
84 vec_data[0] = vec.
x();
85 vec_data[1] = vec.
y();
86 vec_data[2] = vec.
z();
93 ((
BPy_Id *)py_id)->id =
new Id(
id.getFirst(),
id.getSecond());
105 if (
typeid(if0D) ==
typeid(
SVertex)) {
114 if (
typeid(if0D) ==
typeid(
TVertex)) {
121 PyErr_SetString(PyExc_TypeError, msg.c_str());
127 if (
typeid(if1D) ==
typeid(
ViewEdge)) {
130 if (
typeid(if1D) ==
typeid(
Chain)) {
133 if (
typeid(if1D) ==
typeid(
Stroke)) {
142 if (
typeid(if1D) ==
typeid(
FEdge)) {
149 PyErr_SetString(PyExc_TypeError, msg.c_str());
161 if (
typeid(fe) ==
typeid(
FEdge)) {
165 PyErr_SetString(PyExc_TypeError, msg.c_str());
174 if (
typeid(vv) ==
typeid(
TVertex)) {
181 PyErr_SetString(PyExc_TypeError, msg.c_str());
235 ((
BPy_FEdge *)py_fe)->py_if1D.borrowed =
true;
241 PyObject *args = PyTuple_New(1);
242 PyTuple_SET_ITEM(args, 0, PyLong_FromLong(n));
253 ((
BPy_Stroke *)py_s)->py_if1D.borrowed =
true;
267 PyObject *args = PyTuple_New(1);
268 PyTuple_SET_ITEM(args, 0, PyLong_FromLong(n));
309 ((
BPy_TVertex *)py_tv)->py_vv.py_if0D.borrowed =
true;
335 ((
BPy_Chain *)py_c)->py_c.py_if1D.borrowed =
true;
365 PyObject *args = PyTuple_New(1);
366 PyTuple_SET_ITEM(args, 0, PyLong_FromLong(i));
388 PyObject *py_dve = PyTuple_New(2);
504 return PyObject_IsTrue(
b) != 0;
641 for (
int i = 0; i < n; i++) {
642 v[i] = PyFloat_AsDouble(PyList_GET_ITEM(obj, i));
643 if (
v[i] == -1.0f && PyErr_Occurred()) {
644 PyErr_SetString(PyExc_TypeError,
"list elements must be a number");
655 if (!PyList_Check(obj) || PyList_GET_SIZE(obj) != 2) {
670 if (!PyList_Check(obj) || PyList_GET_SIZE(obj) != 3) {
686 if (!PyList_Check(obj) || PyList_GET_SIZE(obj) != 3) {
700 for (
int i = 0; i < n; i++) {
701 v[i] = PyFloat_AsDouble(PyTuple_GET_ITEM(obj, i));
702 if (
v[i] == -1.0f && PyErr_Occurred()) {
703 PyErr_SetString(PyExc_TypeError,
"tuple elements must be a number");
714 if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 2) {
729 if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 3) {
745 if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 3) {
765 for (
int i = 0; i < n; i++) {
774 for (
int i = 0; i < n; i++) {
779 if (PyList_Check(obj) && PyList_GET_SIZE(obj) == n) {
782 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
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_num_min, int array_num_max, PyObject *value, const char *error_prefix)
#define BaseMath_ReadCallback(_self)
#define ColorObject_Check(v)
PyObject * Vector_CreatePyObject(const float *vec, const int vec_num, PyTypeObject *base_type)
#define VectorObject_Check(v)
unsigned short EdgeNature
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
#define PyTuple_SET_ITEMS(op_arg,...)