From 362e4f763f7c4c6d61ee75fec0db567f5bbe2a22 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Sun, 27 Jul 2008 13:40:33 +0000 Subject: soc-2008-mxcurioni: implemented and integrated all 21 original stroke shaders. --- source/blender/freestyle/SConscript | 21 ++++ .../freestyle/intern/python/BPy_Convert.cpp | 3 + .../blender/freestyle/intern/python/BPy_Convert.h | 1 + .../freestyle/intern/python/BPy_StrokeShader.cpp | 129 ++++++++++++++++++++- .../StrokeShader/BPy_BackboneStretcherShader.cpp | 117 ++++++++++++++++++- .../StrokeShader/BPy_BackboneStretcherShader.h | 31 +++++ .../python/StrokeShader/BPy_BezierCurveShader.cpp | 118 ++++++++++++++++++- .../python/StrokeShader/BPy_BezierCurveShader.h | 31 +++++ .../python/StrokeShader/BPy_CalligraphicShader.cpp | 122 ++++++++++++++++++- .../python/StrokeShader/BPy_CalligraphicShader.h | 31 +++++ .../python/StrokeShader/BPy_ColorNoiseShader.cpp | 117 ++++++++++++++++++- .../python/StrokeShader/BPy_ColorNoiseShader.h | 31 +++++ .../BPy_ColorVariationPatternShader.cpp | 121 ++++++++++++++++++- .../StrokeShader/BPy_ColorVariationPatternShader.h | 31 +++++ .../StrokeShader/BPy_ConstantColorShader.cpp | 118 ++++++++++++++++++- .../python/StrokeShader/BPy_ConstantColorShader.h | 31 +++++ .../StrokeShader/BPy_ConstantThicknessShader.cpp | 117 ++++++++++++++++++- .../StrokeShader/BPy_ConstantThicknessShader.h | 31 +++++ .../BPy_ConstrainedIncreasingThicknessShader.cpp | 118 ++++++++++++++++++- .../BPy_ConstrainedIncreasingThicknessShader.h | 31 +++++ .../python/StrokeShader/BPy_GuidingLinesShader.cpp | 118 ++++++++++++++++++- .../python/StrokeShader/BPy_GuidingLinesShader.h | 31 +++++ .../StrokeShader/BPy_IncreasingColorShader.cpp | 117 ++++++++++++++++++- .../StrokeShader/BPy_IncreasingColorShader.h | 31 +++++ .../StrokeShader/BPy_IncreasingThicknessShader.cpp | 117 ++++++++++++++++++- .../StrokeShader/BPy_IncreasingThicknessShader.h | 31 +++++ .../StrokeShader/BPy_PolygonalizationShader.cpp | 117 ++++++++++++++++++- .../StrokeShader/BPy_PolygonalizationShader.h | 31 +++++ .../python/StrokeShader/BPy_SamplingShader.cpp | 117 ++++++++++++++++++- .../python/StrokeShader/BPy_SamplingShader.h | 31 +++++ .../python/StrokeShader/BPy_SpatialNoiseShader.cpp | 122 ++++++++++++++++++- .../python/StrokeShader/BPy_SpatialNoiseShader.h | 31 +++++ .../StrokeShader/BPy_StrokeTextureShader.cpp | 123 +++++++++++++++++++- .../python/StrokeShader/BPy_StrokeTextureShader.h | 31 +++++ .../StrokeShader/BPy_TextureAssignerShader.cpp | 117 ++++++++++++++++++- .../StrokeShader/BPy_TextureAssignerShader.h | 31 +++++ .../StrokeShader/BPy_ThicknessNoiseShader.cpp | 117 ++++++++++++++++++- .../python/StrokeShader/BPy_ThicknessNoiseShader.h | 31 +++++ .../BPy_ThicknessVariationPatternShader.cpp | 121 ++++++++++++++++++- .../BPy_ThicknessVariationPatternShader.h | 31 +++++ .../python/StrokeShader/BPy_TipRemoverShader.cpp | 117 ++++++++++++++++++- .../python/StrokeShader/BPy_TipRemoverShader.h | 31 +++++ .../python/StrokeShader/BPy_fstreamShader.cpp | 116 +++++++++++++++++- .../intern/python/StrokeShader/BPy_fstreamShader.h | 31 +++++ .../python/StrokeShader/BPy_streamShader.cpp | 110 +++++++++++++++++- .../intern/python/StrokeShader/BPy_streamShader.h | 31 +++++ .../freestyle/intern/swig/ModuleWrapper.cpp | 52 ++++----- source/blender/freestyle/python/Freestyle.py | 8 +- 48 files changed, 3257 insertions(+), 85 deletions(-) create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.h create mode 100644 source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.h (limited to 'source/blender') diff --git a/source/blender/freestyle/SConscript b/source/blender/freestyle/SConscript index 3abce0d3ec1..6423cce6593 100644 --- a/source/blender/freestyle/SConscript +++ b/source/blender/freestyle/SConscript @@ -100,6 +100,27 @@ python_sources = [ prefix + '/BPy_SShape.cpp', prefix + '/BPy_StrokeAttribute.cpp', prefix + '/BPy_StrokeShader.cpp', + prefix + '/StrokeShader/BPy_BackboneStretcherShader.cpp', + prefix + '/StrokeShader/BPy_BezierCurveShader.cpp', + prefix + '/StrokeShader/BPy_CalligraphicShader.cpp', + prefix + '/StrokeShader/BPy_ColorNoiseShader.cpp', + prefix + '/StrokeShader/BPy_ColorVariationPatternShader.cpp', + prefix + '/StrokeShader/BPy_ConstantColorShader.cpp', + prefix + '/StrokeShader/BPy_ConstantThicknessShader.cpp', + prefix + '/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp', + prefix + '/StrokeShader/BPy_fstreamShader.cpp', + prefix + '/StrokeShader/BPy_GuidingLinesShader.cpp', + prefix + '/StrokeShader/BPy_IncreasingColorShader.cpp', + prefix + '/StrokeShader/BPy_IncreasingThicknessShader.cpp', + prefix + '/StrokeShader/BPy_PolygonalizationShader.cpp', + prefix + '/StrokeShader/BPy_SamplingShader.cpp', + prefix + '/StrokeShader/BPy_SpatialNoiseShader.cpp', + prefix + '/StrokeShader/BPy_streamShader.cpp', + prefix + '/StrokeShader/BPy_StrokeTextureShader.cpp', + prefix + '/StrokeShader/BPy_TextureAssignerShader.cpp', + prefix + '/StrokeShader/BPy_ThicknessNoiseShader.cpp', + prefix + '/StrokeShader/BPy_ThicknessVariationPatternShader.cpp', + prefix + '/StrokeShader/BPy_TipRemoverShader.cpp', prefix + '/BPy_UnaryFunction0D.cpp', prefix + '/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp', prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_Curvature2DAngleF0D.cpp', diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp index d7b8bfa6cce..042d4b7bef0 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.cpp +++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp @@ -204,6 +204,9 @@ IntegrationType IntegrationType_from_BPy_IntegrationType( PyObject* obj ) { return static_cast( PyInt_AsLong(obj) ); } +Stroke::MediumType MediumType_from_BPy_MediumType( PyObject* obj ) { + return static_cast( PyInt_AsLong(obj) ); +} /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_Convert.h b/source/blender/freestyle/intern/python/BPy_Convert.h index 4d318fcbc1d..b43f7bab291 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.h +++ b/source/blender/freestyle/intern/python/BPy_Convert.h @@ -59,6 +59,7 @@ PyObject * Vector_from_Vec3f( Vec3f& v ); PyObject * Vector_from_Vec3r( Vec3r& v ); IntegrationType IntegrationType_from_BPy_IntegrationType( PyObject* obj ); +Stroke::MediumType MediumType_from_BPy_MediumType( PyObject* obj ); PyObject * BPy_BBox_from_BBox( BBox< Vec3r > &bb ); PyObject * BPy_FEdge_from_FEdge( FEdge& fe ); diff --git a/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp b/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp index cdca779dafb..a6d2ae1e512 100644 --- a/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp +++ b/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp @@ -3,6 +3,28 @@ #include "BPy_Convert.h" #include "Interface1D/BPy_Stroke.h" +#include "StrokeShader/BPy_BackboneStretcherShader.h" +#include "StrokeShader/BPy_BezierCurveShader.h" +#include "StrokeShader/BPy_CalligraphicShader.h" +#include "StrokeShader/BPy_ColorNoiseShader.h" +#include "StrokeShader/BPy_ColorVariationPatternShader.h" +#include "StrokeShader/BPy_ConstantColorShader.h" +#include "StrokeShader/BPy_ConstantThicknessShader.h" +#include "StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h" +#include "StrokeShader/BPy_fstreamShader.h" +#include "StrokeShader/BPy_GuidingLinesShader.h" +#include "StrokeShader/BPy_IncreasingColorShader.h" +#include "StrokeShader/BPy_IncreasingThicknessShader.h" +#include "StrokeShader/BPy_PolygonalizationShader.h" +#include "StrokeShader/BPy_SamplingShader.h" +#include "StrokeShader/BPy_SpatialNoiseShader.h" +#include "StrokeShader/BPy_streamShader.h" +#include "StrokeShader/BPy_StrokeTextureShader.h" +#include "StrokeShader/BPy_TextureAssignerShader.h" +#include "StrokeShader/BPy_ThicknessNoiseShader.h" +#include "StrokeShader/BPy_ThicknessVariationPatternShader.h" +#include "StrokeShader/BPy_TipRemoverShader.h" + #ifdef __cplusplus extern "C" { #endif @@ -117,9 +139,114 @@ PyMODINIT_FUNC StrokeShader_Init( PyObject *module ) if( PyType_Ready( &StrokeShader_Type ) < 0 ) return; - Py_INCREF( &StrokeShader_Type ); PyModule_AddObject(module, "StrokeShader", (PyObject *)&StrokeShader_Type); + + if( PyType_Ready( &BackboneStretcherShader_Type ) < 0 ) + return; + Py_INCREF( &BackboneStretcherShader_Type ); + PyModule_AddObject(module, "BackboneStretcherShader", (PyObject *)&BackboneStretcherShader_Type); + + if( PyType_Ready( &BezierCurveShader_Type ) < 0 ) + return; + Py_INCREF( &BezierCurveShader_Type ); + PyModule_AddObject(module, "BezierCurveShader", (PyObject *)&BezierCurveShader_Type); + + if( PyType_Ready( &CalligraphicShader_Type ) < 0 ) + return; + Py_INCREF( &CalligraphicShader_Type ); + PyModule_AddObject(module, "CalligraphicShader", (PyObject *)&CalligraphicShader_Type); + + if( PyType_Ready( &ColorNoiseShader_Type ) < 0 ) + return; + Py_INCREF( &ColorNoiseShader_Type ); + PyModule_AddObject(module, "ColorNoiseShader", (PyObject *)&ColorNoiseShader_Type); + + if( PyType_Ready( &ColorVariationPatternShader_Type ) < 0 ) + return; + Py_INCREF( &ColorVariationPatternShader_Type ); + PyModule_AddObject(module, "ColorVariationPatternShader", (PyObject *)&ColorVariationPatternShader_Type); + + if( PyType_Ready( &ConstantColorShader_Type ) < 0 ) + return; + Py_INCREF( &ConstantColorShader_Type ); + PyModule_AddObject(module, "ConstantColorShader", (PyObject *)&ConstantColorShader_Type); + + if( PyType_Ready( &ConstantThicknessShader_Type ) < 0 ) + return; + Py_INCREF( &ConstantThicknessShader_Type ); + PyModule_AddObject(module, "ConstantThicknessShader", (PyObject *)&ConstantThicknessShader_Type); + + if( PyType_Ready( &ConstrainedIncreasingThicknessShader_Type ) < 0 ) + return; + Py_INCREF( &ConstrainedIncreasingThicknessShader_Type ); + PyModule_AddObject(module, "ConstrainedIncreasingThicknessShader", (PyObject *)&ConstrainedIncreasingThicknessShader_Type); + + if( PyType_Ready( &fstreamShader_Type ) < 0 ) + return; + Py_INCREF( &fstreamShader_Type ); + PyModule_AddObject(module, "fstreamShader", (PyObject *)&fstreamShader_Type); + + if( PyType_Ready( &GuidingLinesShader_Type ) < 0 ) + return; + Py_INCREF( &GuidingLinesShader_Type ); + PyModule_AddObject(module, "GuidingLinesShader", (PyObject *)&GuidingLinesShader_Type); + + if( PyType_Ready( &IncreasingColorShader_Type ) < 0 ) + return; + Py_INCREF( &IncreasingColorShader_Type ); + PyModule_AddObject(module, "IncreasingColorShader", (PyObject *)&IncreasingColorShader_Type); + + if( PyType_Ready( &IncreasingThicknessShader_Type ) < 0 ) + return; + Py_INCREF( &IncreasingThicknessShader_Type ); + PyModule_AddObject(module, "IncreasingThicknessShader", (PyObject *)&IncreasingThicknessShader_Type); + + if( PyType_Ready( &PolygonalizationShader_Type ) < 0 ) + return; + Py_INCREF( &PolygonalizationShader_Type ); + PyModule_AddObject(module, "PolygonalizationShader", (PyObject *)&PolygonalizationShader_Type); + + if( PyType_Ready( &SamplingShader_Type ) < 0 ) + return; + Py_INCREF( &SamplingShader_Type ); + PyModule_AddObject(module, "SamplingShader", (PyObject *)&SamplingShader_Type); + + if( PyType_Ready( &SpatialNoiseShader_Type ) < 0 ) + return; + Py_INCREF( &SpatialNoiseShader_Type ); + PyModule_AddObject(module, "SpatialNoiseShader", (PyObject *)&SpatialNoiseShader_Type); + + if( PyType_Ready( &streamShader_Type ) < 0 ) + return; + Py_INCREF( &streamShader_Type ); + PyModule_AddObject(module, "streamShader", (PyObject *)&streamShader_Type); + + if( PyType_Ready( &StrokeTextureShader_Type ) < 0 ) + return; + Py_INCREF( &StrokeTextureShader_Type ); + PyModule_AddObject(module, "StrokeTextureShader", (PyObject *)&StrokeTextureShader_Type); + + if( PyType_Ready( &TextureAssignerShader_Type ) < 0 ) + return; + Py_INCREF( &TextureAssignerShader_Type ); + PyModule_AddObject(module, "TextureAssignerShader", (PyObject *)&TextureAssignerShader_Type); + + if( PyType_Ready( &ThicknessNoiseShader_Type ) < 0 ) + return; + Py_INCREF( &ThicknessNoiseShader_Type ); + PyModule_AddObject(module, "ThicknessNoiseShader", (PyObject *)&ThicknessNoiseShader_Type); + + if( PyType_Ready( &ThicknessVariationPatternShader_Type ) < 0 ) + return; + Py_INCREF( &ThicknessVariationPatternShader_Type ); + PyModule_AddObject(module, "ThicknessVariationPatternShader", (PyObject *)&ThicknessVariationPatternShader_Type); + + if( PyType_Ready( &TipRemoverShader_Type ) < 0 ) + return; + Py_INCREF( &TipRemoverShader_Type ); + PyModule_AddObject(module, "TipRemoverShader", (PyObject *)&TipRemoverShader_Type); + } //------------------------INSTANCE METHODS ---------------------------------- diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp index 96fd31e982e..6b5fe67f345 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp @@ -1,8 +1,119 @@ - PyObject *_wrap_BackboneStretcherShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_BackboneStretcherShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for BackboneStretcherShader instance -----------*/ + static int BackboneStretcherShader___init__( BPy_BackboneStretcherShader* self, PyObject *args); + +/*-----------------------BPy_BackboneStretcherShader type definition ------------------------------*/ + +PyTypeObject BackboneStretcherShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "BackboneStretcherShader", /* tp_name */ + sizeof( BPy_BackboneStretcherShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)BackboneStretcherShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int BackboneStretcherShader___init__( BPy_BackboneStretcherShader* self, PyObject *args) +{ + float f = 2.0; + + if(!( PyArg_ParseTuple(args, "|f", &f) )) { + cout << "ERROR: BackboneStretcherShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::BackboneStretcherShader(f); + return 0; - PyObject *_wrap_delete_BackboneStretcherShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.h new file mode 100644 index 00000000000..161bdb5db40 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_BACKBONESTRETCHERSHADER_H +#define FREESTYLE_PYTHON_BACKBONESTRETCHERSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject BackboneStretcherShader_Type; + +#define BPy_BackboneStretcherShader_Check(v) (( (PyObject *) v)->ob_type == &BackboneStretcherShader_Type) + +/*---------------------------Python BPy_BackboneStretcherShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_BackboneStretcherShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_BACKBONESTRETCHERSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp index a4d476bb2d6..3ddda4256be 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp @@ -1,8 +1,118 @@ - PyObject *_wrap_BezierCurveShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_BezierCurveShader.h" +#include "../../stroke/BasicStrokeShaders.h" - PyObject *_wrap_delete_BezierCurveShader(PyObject *self , PyObject *args) { -} +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for BezierCurveShader instance -----------*/ + static int BezierCurveShader___init__( BPy_BezierCurveShader* self, PyObject *args); + +/*-----------------------BPy_BezierCurveShader type definition ------------------------------*/ + +PyTypeObject BezierCurveShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "BezierCurveShader", /* tp_name */ + sizeof( BPy_BezierCurveShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)BezierCurveShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int BezierCurveShader___init__( BPy_BezierCurveShader* self, PyObject *args) +{ + float f = 4.0; + + if(!( PyArg_ParseTuple(args, "|f", &f) )) { + cout << "ERROR: BezierCurveShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::BezierCurveShader(f); + return 0; + +} +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.h new file mode 100644 index 00000000000..56443ca26ad --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_BEZIERCURVESHADER_H +#define FREESTYLE_PYTHON_BEZIERCURVESHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject BezierCurveShader_Type; + +#define BPy_BezierCurveShader_Check(v) (( (PyObject *) v)->ob_type == &BezierCurveShader_Type) + +/*---------------------------Python BPy_BezierCurveShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_BezierCurveShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_BEZIERCURVESHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp index 2f7a422d311..d20fbeab1ec 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp @@ -1,4 +1,124 @@ - PyObject *_wrap_CalligraphicShader_shade(PyObject *self , PyObject *args) { +#include "BPy_CalligraphicShader.h" + +#include "../../stroke/AdvancedStrokeShaders.h" +#include "../BPy_Convert.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for CalligraphicShader instance -----------*/ + static int CalligraphicShader___init__( BPy_CalligraphicShader* self, PyObject *args); + +/*-----------------------BPy_CalligraphicShader type definition ------------------------------*/ + +PyTypeObject CalligraphicShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "CalligraphicShader", /* tp_name */ + sizeof( BPy_CalligraphicShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)CalligraphicShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int CalligraphicShader___init__( BPy_CalligraphicShader* self, PyObject *args) +{ + double d1, d2; + PyObject *obj3 = 0, *obj4 = 0; + + + if(!( PyArg_ParseTuple(args, "ddOO", &d1, &d2, &obj3, &obj4) + && PyList_Check(obj3) && PyList_Size(obj3) > 1 && PyBool_Check(obj4) )) { + cout << "ERROR: CalligraphicShader___init__" << endl; + return -1; + } + + Vec2f v( PyFloat_AsDouble(PyList_GetItem(obj3,0)), PyFloat_AsDouble(PyList_GetItem(obj3,1)) ); + self->py_ss.ss = new CalligraphicShader(d1, d2, v, bool_from_PyBool(obj4) ); + return 0; + } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.h new file mode 100644 index 00000000000..d3a4782c794 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_CALLIGRAPHICSHADER_H +#define FREESTYLE_PYTHON_CALLIGRAPHICSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject CalligraphicShader_Type; + +#define BPy_CalligraphicShader_Check(v) (( (PyObject *) v)->ob_type == &CalligraphicShader_Type) + +/*---------------------------Python BPy_CalligraphicShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_CalligraphicShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_CALLIGRAPHICSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp index 1b52e33fd8f..df0389a5226 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp @@ -1,8 +1,119 @@ - PyObject *_wrap_ColorNoiseShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_ColorNoiseShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for ColorNoiseShader instance -----------*/ + static int ColorNoiseShader___init__( BPy_ColorNoiseShader* self, PyObject *args); + +/*-----------------------BPy_ColorNoiseShader type definition ------------------------------*/ + +PyTypeObject ColorNoiseShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "ColorNoiseShader", /* tp_name */ + sizeof( BPy_ColorNoiseShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)ColorNoiseShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int ColorNoiseShader___init__( BPy_ColorNoiseShader* self, PyObject *args) +{ + float f1, f2; + + if(!( PyArg_ParseTuple(args, "ff", &f1, &f2) )) { + cout << "ERROR: ColorNoiseShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::ColorNoiseShader(f1, f2); + return 0; - PyObject *_wrap_delete_ColorNoiseShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.h new file mode 100644 index 00000000000..e4ad2c0e1af --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_COLORNOISESHADER_H +#define FREESTYLE_PYTHON_COLORNOISESHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject ColorNoiseShader_Type; + +#define BPy_ColorNoiseShader_Check(v) (( (PyObject *) v)->ob_type == &ColorNoiseShader_Type) + +/*---------------------------Python BPy_ColorNoiseShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_ColorNoiseShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_COLORNOISESHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp index 7529c869939..380c760d0c0 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp @@ -1,4 +1,123 @@ - PyObject *_wrap_ColorVariationPatternShader_shade(PyObject *self , PyObject *args) { +#include "BPy_ColorVariationPatternShader.h" + +#include "../../stroke/BasicStrokeShaders.h" +#include "../BPy_Convert.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for ColorVariationPatternShader instance -----------*/ + static int ColorVariationPatternShader___init__( BPy_ColorVariationPatternShader* self, PyObject *args); + +/*-----------------------BPy_ColorVariationPatternShader type definition ------------------------------*/ + +PyTypeObject ColorVariationPatternShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "ColorVariationPatternShader", /* tp_name */ + sizeof( BPy_ColorVariationPatternShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)ColorVariationPatternShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int ColorVariationPatternShader___init__( BPy_ColorVariationPatternShader* self, PyObject *args) +{ + const char *s; + PyObject *obj = 0; + + + if(!( PyArg_ParseTuple(args, "s|O", &s, &obj) )) { + cout << "ERROR: ColorVariationPatternShader___init__" << endl; + return -1; + } + + bool b = (obj && PyBool_Check(obj)) ? bool_from_PyBool(obj) : true; + self->py_ss.ss = new StrokeShaders::ColorVariationPatternShader(s,b); + return 0; + } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.h new file mode 100644 index 00000000000..12f7bbca151 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_COLORVARIATIONPATTERNSHADER_H +#define FREESTYLE_PYTHON_COLORVARIATIONPATTERNSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject ColorVariationPatternShader_Type; + +#define BPy_ColorVariationPatternShader_Check(v) (( (PyObject *) v)->ob_type == &ColorVariationPatternShader_Type) + +/*---------------------------Python BPy_ColorVariationPatternShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_ColorVariationPatternShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_COLORVARIATIONPATTERNSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp index e636331c57c..a9430fa8000 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp @@ -1,12 +1,120 @@ - PyObject *_wrap_ConstantColorShader_getName(PyObject *self , PyObject *args) { -} +#include "BPy_ConstantColorShader.h" +#include "../../stroke/BasicStrokeShaders.h" - PyObject *_wrap_ConstantColorShader_shade(PyObject *self , PyObject *args) { -} +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for ConstantColorShader instance -----------*/ + static int ConstantColorShader___init__( BPy_ConstantColorShader* self, PyObject *args); + +/*-----------------------BPy_ConstantColorShader type definition ------------------------------*/ + +PyTypeObject ConstantColorShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "ConstantColorShader", /* tp_name */ + sizeof( BPy_ConstantColorShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)ConstantColorShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int ConstantColorShader___init__( BPy_ConstantColorShader* self, PyObject *args) +{ + float f1, f2, f3, f4 = 1.0; + + + if(!( PyArg_ParseTuple(args, "fff|f", &f1, &f2, &f3, &f4) )) { + cout << "ERROR: ConstantColorShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::ConstantColorShader(f1, f2, f3, f4); + return 0; - PyObject *_wrap_delete_ConstantColorShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.h new file mode 100644 index 00000000000..0f3ae177d15 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_CONSTANTCOLORSHADER_H +#define FREESTYLE_PYTHON_CONSTANTCOLORSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject ConstantColorShader_Type; + +#define BPy_ConstantColorShader_Check(v) (( (PyObject *) v)->ob_type == &ConstantColorShader_Type) + +/*---------------------------Python BPy_ConstantColorShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_ConstantColorShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_CONSTANTCOLORSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp index 1840ef71f6d..a3440295767 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp @@ -1,8 +1,119 @@ - PyObject *_wrap_ConstantThicknessShader_getName(PyObject *self , PyObject *args) { -} +#include "BPy_ConstantThicknessShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for ConstantThicknessShader instance -----------*/ + static int ConstantThicknessShader___init__( BPy_ConstantThicknessShader* self, PyObject *args); + +/*-----------------------BPy_ConstantThicknessShader type definition ------------------------------*/ + +PyTypeObject ConstantThicknessShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "ConstantThicknessShader", /* tp_name */ + sizeof( BPy_ConstantThicknessShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)ConstantThicknessShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int ConstantThicknessShader___init__( BPy_ConstantThicknessShader* self, PyObject *args) +{ + float f; + + if(!( PyArg_ParseTuple(args, "|f", &f) )) { + cout << "ERROR: ConstantThicknessShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::ConstantThicknessShader(f); + return 0; - PyObject *_wrap_ConstantThicknessShader_shade(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.h new file mode 100644 index 00000000000..d8cb7239fd9 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_CONSTANTTHICKNESSSHADER_H +#define FREESTYLE_PYTHON_CONSTANTTHICKNESSSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject ConstantThicknessShader_Type; + +#define BPy_ConstantThicknessShader_Check(v) (( (PyObject *) v)->ob_type == &ConstantThicknessShader_Type) + +/*---------------------------Python BPy_ConstantThicknessShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_ConstantThicknessShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_CONSTANTTHICKNESSSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp index 41eb1c94d17..aed3911648d 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp @@ -1,4 +1,120 @@ - PyObject *_wrap_ConstrainedIncreasingThicknessShader_shade(PyObject *self , PyObject *args) { +#include "BPy_ConstrainedIncreasingThicknessShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for ConstrainedIncreasingThicknessShader instance -----------*/ + static int ConstrainedIncreasingThicknessShader___init__( BPy_ConstrainedIncreasingThicknessShader* self, PyObject *args); + +/*-----------------------BPy_ConstrainedIncreasingThicknessShader type definition ------------------------------*/ + +PyTypeObject ConstrainedIncreasingThicknessShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "ConstrainedIncreasingThicknessShader", /* tp_name */ + sizeof( BPy_ConstrainedIncreasingThicknessShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)ConstrainedIncreasingThicknessShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int ConstrainedIncreasingThicknessShader___init__( BPy_ConstrainedIncreasingThicknessShader* self, PyObject *args) +{ + float f1, f2, f3; + + + if(!( PyArg_ParseTuple(args, "fff", &f1, &f2, &f3) )) { + cout << "ERROR: ConstrainedIncreasingThicknessShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::ConstrainedIncreasingThicknessShader(f1, f2, f3); + return 0; + } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h new file mode 100644 index 00000000000..f712706d2ee --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_CONSTRAINEDINCREASINGTHICKNESSSHADER_H +#define FREESTYLE_PYTHON_CONSTRAINEDINCREASINGTHICKNESSSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject ConstrainedIncreasingThicknessShader_Type; + +#define BPy_ConstrainedIncreasingThicknessShader_Check(v) (( (PyObject *) v)->ob_type == &ConstrainedIncreasingThicknessShader_Type) + +/*---------------------------Python BPy_ConstrainedIncreasingThicknessShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_ConstrainedIncreasingThicknessShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_CONSTRAINEDINCREASINGTHICKNESSSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp index 633523af330..585c03e988a 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp @@ -1,8 +1,120 @@ - PyObject *_wrap_GuidingLinesShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_GuidingLinesShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for GuidingLinesShader instance -----------*/ + static int GuidingLinesShader___init__( BPy_GuidingLinesShader* self, PyObject *args); + +/*-----------------------BPy_GuidingLinesShader type definition ------------------------------*/ + +PyTypeObject GuidingLinesShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "GuidingLinesShader", /* tp_name */ + sizeof( BPy_GuidingLinesShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)GuidingLinesShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int GuidingLinesShader___init__( BPy_GuidingLinesShader* self, PyObject *args) +{ + float f; + + if(!( PyArg_ParseTuple(args, "f", &f) )) { + cout << "ERROR: GuidingLinesShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::GuidingLinesShader(f); + return 0; - PyObject *_wrap_delete_GuidingLinesShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif + \ No newline at end of file diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.h new file mode 100644 index 00000000000..2cf032e24ae --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_GUIDINGLINESSHADER_H +#define FREESTYLE_PYTHON_GUIDINGLINESSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject GuidingLinesShader_Type; + +#define BPy_GuidingLinesShader_Check(v) (( (PyObject *) v)->ob_type == &GuidingLinesShader_Type) + +/*---------------------------Python BPy_GuidingLinesShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_GuidingLinesShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_GUIDINGLINESSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp index 2fbb74f3768..b6cb615368e 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp @@ -1,8 +1,119 @@ - PyObject *_wrap_IncreasingColorShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_IncreasingColorShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for IncreasingColorShader instance -----------*/ + static int IncreasingColorShader___init__( BPy_IncreasingColorShader* self, PyObject *args); + +/*-----------------------BPy_IncreasingColorShader type definition ------------------------------*/ + +PyTypeObject IncreasingColorShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "IncreasingColorShader", /* tp_name */ + sizeof( BPy_IncreasingColorShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)IncreasingColorShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int IncreasingColorShader___init__( BPy_IncreasingColorShader* self, PyObject *args) +{ + float f1, f2, f3, f4, f5, f6, f7, f8; + + if(!( PyArg_ParseTuple(args, "ffffffff", &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8) )) { + cout << "ERROR: IncreasingColorShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::IncreasingColorShader(f1, f2, f3, f4, f5, f6, f7, f8); + return 0; - PyObject *_wrap_delete_IncreasingColorShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.h new file mode 100644 index 00000000000..4ef7f3f239d --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_INCREASINGCOLORSHADER_H +#define FREESTYLE_PYTHON_INCREASINGCOLORSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject IncreasingColorShader_Type; + +#define BPy_IncreasingColorShader_Check(v) (( (PyObject *) v)->ob_type == &IncreasingColorShader_Type) + +/*---------------------------Python BPy_IncreasingColorShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_IncreasingColorShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_INCREASINGCOLORSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp index 4d97f43841d..0dc3fedde11 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp @@ -1,4 +1,119 @@ - PyObject *_wrap_IncreasingThicknessShader_shade(PyObject *self , PyObject *args) { +#include "BPy_IncreasingThicknessShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for IncreasingThicknessShader instance -----------*/ + static int IncreasingThicknessShader___init__( BPy_IncreasingThicknessShader* self, PyObject *args); + +/*-----------------------BPy_IncreasingThicknessShader type definition ------------------------------*/ + +PyTypeObject IncreasingThicknessShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "IncreasingThicknessShader", /* tp_name */ + sizeof( BPy_IncreasingThicknessShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)IncreasingThicknessShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int IncreasingThicknessShader___init__( BPy_IncreasingThicknessShader* self, PyObject *args) +{ + float f1, f2; + + if(!( PyArg_ParseTuple(args, "ff", &f1, &f2) )) { + cout << "ERROR: IncreasingThicknessShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::IncreasingThicknessShader(f1, f2); + return 0; + } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.h new file mode 100644 index 00000000000..ae4f37835cc --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_INCREASINGTHICKNESSSHADER_H +#define FREESTYLE_PYTHON_INCREASINGTHICKNESSSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject IncreasingThicknessShader_Type; + +#define BPy_IncreasingThicknessShader_Check(v) (( (PyObject *) v)->ob_type == &IncreasingThicknessShader_Type) + +/*---------------------------Python BPy_IncreasingThicknessShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_IncreasingThicknessShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_INCREASINGTHICKNESSSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp index 098330d37bd..5f4ff5f8d04 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp @@ -1,8 +1,119 @@ - PyObject *_wrap_PolygonalizationShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_PolygonalizationShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for PolygonalizationShader instance -----------*/ + static int PolygonalizationShader___init__( BPy_PolygonalizationShader* self, PyObject *args); + +/*-----------------------BPy_PolygonalizationShader type definition ------------------------------*/ + +PyTypeObject PolygonalizationShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "PolygonalizationShader", /* tp_name */ + sizeof( BPy_PolygonalizationShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)PolygonalizationShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int PolygonalizationShader___init__( BPy_PolygonalizationShader* self, PyObject *args) +{ + float f; + + if(!( PyArg_ParseTuple(args, "f", &f) )) { + cout << "ERROR: PolygonalizationShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::PolygonalizationShader(f); + return 0; - PyObject *_wrap_delete_PolygonalizationShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.h new file mode 100644 index 00000000000..7cc2e94e2cc --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_POLYGONALIZATIONSHADER_H +#define FREESTYLE_PYTHON_POLYGONALIZATIONSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject PolygonalizationShader_Type; + +#define BPy_PolygonalizationShader_Check(v) (( (PyObject *) v)->ob_type == &PolygonalizationShader_Type) + +/*---------------------------Python BPy_PolygonalizationShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_PolygonalizationShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_POLYGONALIZATIONSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp index 3a42bda3b08..a87de11f095 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp @@ -1,8 +1,119 @@ - PyObject *_wrap_SamplingShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_SamplingShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for SamplingShader instance -----------*/ + static int SamplingShader___init__( BPy_SamplingShader* self, PyObject *args); + +/*-----------------------BPy_SamplingShader type definition ------------------------------*/ + +PyTypeObject SamplingShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "SamplingShader", /* tp_name */ + sizeof( BPy_SamplingShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)SamplingShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int SamplingShader___init__( BPy_SamplingShader* self, PyObject *args) +{ + float f; + + if(!( PyArg_ParseTuple(args, "f", &f) )) { + cout << "ERROR: SamplingShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::SamplingShader(f); + return 0; - PyObject *_wrap_delete_SamplingShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.h new file mode 100644 index 00000000000..763bee23168 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_SAMPLINGSHADER_H +#define FREESTYLE_PYTHON_SAMPLINGSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject SamplingShader_Type; + +#define BPy_SamplingShader_Check(v) (( (PyObject *) v)->ob_type == &SamplingShader_Type) + +/*---------------------------Python BPy_SamplingShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_SamplingShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_SAMPLINGSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp index ff90e7f973c..272884e1645 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp @@ -1,4 +1,124 @@ - PyObject *_wrap_SpatialNoiseShader_shade(PyObject *self , PyObject *args) { +#include "BPy_SpatialNoiseShader.h" + +#include "../../stroke/AdvancedStrokeShaders.h" +#include "../BPy_Convert.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for SpatialNoiseShader instance -----------*/ + static int SpatialNoiseShader___init__( BPy_SpatialNoiseShader* self, PyObject *args); + +/*-----------------------BPy_SpatialNoiseShader type definition ------------------------------*/ + +PyTypeObject SpatialNoiseShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "SpatialNoiseShader", /* tp_name */ + sizeof( BPy_SpatialNoiseShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)SpatialNoiseShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int SpatialNoiseShader___init__( BPy_SpatialNoiseShader* self, PyObject *args) +{ + float f1, f2; + int i3; + PyObject *obj4 = 0, *obj5 = 0; + + + if(!( PyArg_ParseTuple(args, "ffiOO", &f1, &f2, &i3, &obj4, &obj5) + && PyList_Check(obj4) && PyBool_Check(obj5) )) { + cout << "ERROR: SpatialNoiseShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new SpatialNoiseShader(f1, f2, i3, bool_from_PyBool(obj4), bool_from_PyBool(obj5) ); + return 0; + } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.h new file mode 100644 index 00000000000..ac232502881 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_SPATIALNOISESHADER_H +#define FREESTYLE_PYTHON_SPATIALNOISESHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject SpatialNoiseShader_Type; + +#define BPy_SpatialNoiseShader_Check(v) (( (PyObject *) v)->ob_type == &SpatialNoiseShader_Type) + +/*---------------------------Python BPy_SpatialNoiseShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_SpatialNoiseShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_SPATIALNOISESHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.cpp index 90636eb5aee..4d5a56db24b 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.cpp @@ -1,8 +1,125 @@ - PyObject *_wrap_StrokeTextureShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_StrokeTextureShader.h" + +#include "../../stroke/BasicStrokeShaders.h" +#include "../BPy_Convert.h" +#include "../BPy_MediumType.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for StrokeTextureShader instance -----------*/ + static int StrokeTextureShader___init__( BPy_StrokeTextureShader* self, PyObject *args); + +/*-----------------------BPy_StrokeTextureShader type definition ------------------------------*/ + +PyTypeObject StrokeTextureShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "StrokeTextureShader", /* tp_name */ + sizeof( BPy_StrokeTextureShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)StrokeTextureShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int StrokeTextureShader___init__( BPy_StrokeTextureShader* self, PyObject *args) +{ + const char *s1; + PyObject *obj2 = 0, *obj3 = 0; + + if(!( PyArg_ParseTuple(args, "s|00", &s1, &obj2, &obj3) )) { + cout << "ERROR: StrokeTextureShader___init__" << endl; + return -1; + } + + Stroke::MediumType mt = (obj2 && BPy_MediumType_Check(obj2)) ? MediumType_from_BPy_MediumType(obj2) : Stroke::OPAQUE_MEDIUM; + bool b = (obj3 && PyBool_Check(obj3)) ? bool_from_PyBool(obj3) : true; + + self->py_ss.ss = new StrokeShaders::StrokeTextureShader(s1,mt,b); + return 0; - PyObject *_wrap_delete_StrokeTextureShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.h new file mode 100644 index 00000000000..d60ba3080ab --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_STROKETEXTURESHADER_H +#define FREESTYLE_PYTHON_STROKETEXTURESHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject StrokeTextureShader_Type; + +#define BPy_StrokeTextureShader_Check(v) (( (PyObject *) v)->ob_type == &StrokeTextureShader_Type) + +/*---------------------------Python BPy_StrokeTextureShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_StrokeTextureShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_STROKETEXTURESHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp index 9a308d60ac3..1d19be78d03 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp @@ -1,8 +1,119 @@ - PyObject *_wrap_TextureAssignerShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_TextureAssignerShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for TextureAssignerShader instance -----------*/ + static int TextureAssignerShader___init__( BPy_TextureAssignerShader* self, PyObject *args); + +/*-----------------------BPy_TextureAssignerShader type definition ------------------------------*/ + +PyTypeObject TextureAssignerShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "TextureAssignerShader", /* tp_name */ + sizeof( BPy_TextureAssignerShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)TextureAssignerShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int TextureAssignerShader___init__( BPy_TextureAssignerShader* self, PyObject *args) +{ + int i; + + if(!( PyArg_ParseTuple(args, "i", &i) )) { + cout << "ERROR: TextureAssignerShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::TextureAssignerShader(i); + return 0; - PyObject *_wrap_delete_TextureAssignerShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.h new file mode 100644 index 00000000000..658f3f4ec8d --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_TEXTUREASSIGNERSHADER_H +#define FREESTYLE_PYTHON_TEXTUREASSIGNERSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject TextureAssignerShader_Type; + +#define BPy_TextureAssignerShader_Check(v) (( (PyObject *) v)->ob_type == &TextureAssignerShader_Type) + +/*---------------------------Python BPy_TextureAssignerShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_TextureAssignerShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_TEXTUREASSIGNERSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp index 0c69aa5cfc1..57810bb9cac 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp @@ -1,8 +1,119 @@ - PyObject *_wrap_ThicknessNoiseShader_shade(PyObject *self , PyObject *args) { -} +#include "BPy_ThicknessNoiseShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for ThicknessNoiseShader instance -----------*/ + static int ThicknessNoiseShader___init__( BPy_ThicknessNoiseShader* self, PyObject *args); + +/*-----------------------BPy_ThicknessNoiseShader type definition ------------------------------*/ + +PyTypeObject ThicknessNoiseShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "ThicknessNoiseShader", /* tp_name */ + sizeof( BPy_ThicknessNoiseShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)ThicknessNoiseShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int ThicknessNoiseShader___init__( BPy_ThicknessNoiseShader* self, PyObject *args) +{ + float f1, f2; + + if(!( PyArg_ParseTuple(args, "ff", &f1, &f2) )) { + cout << "ERROR: ThicknessNoiseShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::ThicknessNoiseShader(f1, f2); + return 0; - PyObject *_wrap_delete_ThicknessNoiseShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.h new file mode 100644 index 00000000000..8a0437715f4 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_THICKNESSNOISESHADER_H +#define FREESTYLE_PYTHON_THICKNESSNOISESHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject ThicknessNoiseShader_Type; + +#define BPy_ThicknessNoiseShader_Check(v) (( (PyObject *) v)->ob_type == &ThicknessNoiseShader_Type) + +/*---------------------------Python BPy_ThicknessNoiseShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_ThicknessNoiseShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_THICKNESSNOISESHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.cpp index 02326259be8..d7f49b60fa5 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.cpp @@ -1,4 +1,123 @@ - PyObject *_wrap_ThicknessVariationPatternShader_shade(PyObject *self , PyObject *args) { +#include "BPy_ThicknessVariationPatternShader.h" + +#include "../../stroke/BasicStrokeShaders.h" +#include "../BPy_Convert.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for ThicknessVariationPatternShader instance -----------*/ + static int ThicknessVariationPatternShader___init__( BPy_ThicknessVariationPatternShader* self, PyObject *args); + +/*-----------------------BPy_ThicknessVariationPatternShader type definition ------------------------------*/ + +PyTypeObject ThicknessVariationPatternShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "ThicknessVariationPatternShader", /* tp_name */ + sizeof( BPy_ThicknessVariationPatternShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)ThicknessVariationPatternShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int ThicknessVariationPatternShader___init__( BPy_ThicknessVariationPatternShader* self, PyObject *args) +{ + const char *s1; + float f2 = 1.0, f3 = 5.0; + PyObject *obj4 = 0; + + if(!( PyArg_ParseTuple(args, "s|ffO", &s1, &f2, &f3, &obj4) )) { + cout << "ERROR: ThicknessVariationPatternShader___init__" << endl; + return -1; + } + + bool b = (obj4 && PyBool_Check(obj4)) ? bool_from_PyBool(obj4) : true; + self->py_ss.ss = new StrokeShaders::ThicknessVariationPatternShader(s1, f2, f3, b); + return 0; + } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.h new file mode 100644 index 00000000000..4c850bdb50f --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_THICKNESSVARIATIONPATTERNSHADER_H +#define FREESTYLE_PYTHON_THICKNESSVARIATIONPATTERNSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject ThicknessVariationPatternShader_Type; + +#define BPy_ThicknessVariationPatternShader_Check(v) (( (PyObject *) v)->ob_type == &ThicknessVariationPatternShader_Type) + +/*---------------------------Python BPy_ThicknessVariationPatternShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_ThicknessVariationPatternShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_THICKNESSVARIATIONPATTERNSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp index 4a202ddd6ee..1151b33789d 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp @@ -1,4 +1,119 @@ - PyObject *_wrap_TipRemoverShader_shade(PyObject *self , PyObject *args) { +#include "BPy_TipRemoverShader.h" + +#include "../../stroke/BasicStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for TipRemoverShader instance -----------*/ + static int TipRemoverShader___init__( BPy_TipRemoverShader* self, PyObject *args); + +/*-----------------------BPy_TipRemoverShader type definition ------------------------------*/ + +PyTypeObject TipRemoverShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "TipRemoverShader", /* tp_name */ + sizeof( BPy_TipRemoverShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)TipRemoverShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int TipRemoverShader___init__( BPy_TipRemoverShader* self, PyObject *args) +{ + double d; + + if(!( PyArg_ParseTuple(args, "d", &d) )) { + cout << "ERROR: TipRemoverShader___init__" << endl; + return -1; + } + + self->py_ss.ss = new StrokeShaders::TipRemoverShader(d); + return 0; + } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.h new file mode 100644 index 00000000000..1ca4594d8d5 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_TIPREMOVERSHADER_H +#define FREESTYLE_PYTHON_TIPREMOVERSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject TipRemoverShader_Type; + +#define BPy_TipRemoverShader_Check(v) (( (PyObject *) v)->ob_type == &TipRemoverShader_Type) + +/*---------------------------Python BPy_TipRemoverShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_TipRemoverShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_TIPREMOVERSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.cpp index dc19cde3871..71d3df5c3d8 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.cpp @@ -1,8 +1,118 @@ - PyObject *_wrap_fstreamShader_getName(PyObject *self , PyObject *args) { -} +#include "BPy_fstreamShader.h" + +#include "../../stroke/AdvancedStrokeShaders.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for fstreamShader instance -----------*/ + static int fstreamShader___init__( BPy_fstreamShader* self, PyObject *args); + +/*-----------------------BPy_fstreamShader type definition ------------------------------*/ + +PyTypeObject fstreamShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "fstreamShader", /* tp_name */ + sizeof( BPy_fstreamShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)fstreamShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int fstreamShader___init__( BPy_fstreamShader* self, PyObject *args) +{ + const char *s; + + if(!( PyArg_ParseTuple(args, "s", &s) )) { + cout << "ERROR: fstreamShader___init__" << endl; + return -1; + } + self->py_ss.ss = new StrokeShaders::fstreamShader(s); + return 0; - PyObject *_wrap_fstreamShader_shade(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.h new file mode 100644 index 00000000000..02cf0daff18 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_FSTREAMSHADER_H +#define FREESTYLE_PYTHON_FSTREAMSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject fstreamShader_Type; + +#define BPy_fstreamShader_Check(v) (( (PyObject *) v)->ob_type == &fstreamShader_Type) + +/*---------------------------Python BPy_fstreamShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_fstreamShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_FSTREAMSHADER_H */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.cpp index aa3250f858c..f756654aceb 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.cpp @@ -1,12 +1,112 @@ - PyObject *_wrap_streamShader_getName(PyObject *self , PyObject *args) { -} +#include "BPy_streamShader.h" +#include "../../stroke/BasicStrokeShaders.h" - PyObject *_wrap_streamShader_shade(PyObject *self , PyObject *args) { -} +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +/*--------------- Python API function prototypes for streamShader instance -----------*/ + static int streamShader___init__( BPy_streamShader* self); + +/*-----------------------BPy_streamShader type definition ------------------------------*/ + +PyTypeObject streamShader_Type = { + PyObject_HEAD_INIT( NULL ) + 0, /* ob_size */ + "streamShader", /* tp_name */ + sizeof( BPy_streamShader ), /* tp_basicsize */ + 0, /* tp_itemsize */ + + /* methods */ + NULL, /* tp_dealloc */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* tp_compare */ + NULL, /* tp_repr */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + &StrokeShader_Type, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + (initproc)streamShader___init__, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + +//------------------------INSTANCE METHODS ---------------------------------- + +int streamShader___init__( BPy_streamShader* self) +{ + self->py_ss.ss = new StrokeShaders::streamShader(); + return 0; - PyObject *_wrap_new_streamShader(PyObject *self , PyObject *args) { } +/////////////////////////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +} +#endif diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.h new file mode 100644 index 00000000000..ae34cb44798 --- /dev/null +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.h @@ -0,0 +1,31 @@ +#ifndef FREESTYLE_PYTHON_STREAMSHADER_H +#define FREESTYLE_PYTHON_STREAMSHADER_H + +#include "../BPy_StrokeShader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////////////////// + +#include + +extern PyTypeObject streamShader_Type; + +#define BPy_streamShader_Check(v) (( (PyObject *) v)->ob_type == &streamShader_Type) + +/*---------------------------Python BPy_streamShader structure definition----------*/ +typedef struct { + BPy_StrokeShader py_ss; +} BPy_streamShader; + + +/////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +} +#endif + + +#endif /* FREESTYLE_PYTHON_STREAMSHADER_H */ diff --git a/source/blender/freestyle/intern/swig/ModuleWrapper.cpp b/source/blender/freestyle/intern/swig/ModuleWrapper.cpp index 67672d3a2ac..829705350a7 100755 --- a/source/blender/freestyle/intern/swig/ModuleWrapper.cpp +++ b/source/blender/freestyle/intern/swig/ModuleWrapper.cpp @@ -47350,7 +47350,7 @@ fail: } -SWIGINTERN PyObject *_wrap_ViewMap_GetClosestViewEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ViewMap_getClosestViewEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; ViewMap *arg1 = (ViewMap *) 0 ; real arg2 ; @@ -47366,25 +47366,25 @@ SWIGINTERN PyObject *_wrap_ViewMap_GetClosestViewEdge(PyObject *SWIGUNUSEDPARM(s PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:ViewMap_GetClosestViewEdge",&obj0,&obj1,&obj2)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOO:ViewMap_getClosestViewEdge",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ViewMap, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewMap_GetClosestViewEdge" "', argument " "1"" of type '" "ViewMap const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewMap_getClosestViewEdge" "', argument " "1"" of type '" "ViewMap const *""'"); } arg1 = reinterpret_cast< ViewMap * >(argp1); ecode2 = SWIG_AsVal_double(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ViewMap_GetClosestViewEdge" "', argument " "2"" of type '" "real""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ViewMap_getClosestViewEdge" "', argument " "2"" of type '" "real""'"); } arg2 = static_cast< real >(val2); ecode3 = SWIG_AsVal_double(obj2, &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ViewMap_GetClosestViewEdge" "', argument " "3"" of type '" "real""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ViewMap_getClosestViewEdge" "', argument " "3"" of type '" "real""'"); } arg3 = static_cast< real >(val3); { try { - result = (ViewEdge *)((ViewMap const *)arg1)->GetClosestViewEdge(arg2,arg3); + result = (ViewEdge *)((ViewMap const *)arg1)->getClosestViewEdge(arg2,arg3); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -47400,7 +47400,7 @@ fail: } -SWIGINTERN PyObject *_wrap_ViewMap_GetClosestFEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ViewMap_getClosestFEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; ViewMap *arg1 = (ViewMap *) 0 ; real arg2 ; @@ -47416,25 +47416,25 @@ SWIGINTERN PyObject *_wrap_ViewMap_GetClosestFEdge(PyObject *SWIGUNUSEDPARM(self PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:ViewMap_GetClosestFEdge",&obj0,&obj1,&obj2)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOO:ViewMap_getClosestFEdge",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ViewMap, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewMap_GetClosestFEdge" "', argument " "1"" of type '" "ViewMap const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewMap_getClosestFEdge" "', argument " "1"" of type '" "ViewMap const *""'"); } arg1 = reinterpret_cast< ViewMap * >(argp1); ecode2 = SWIG_AsVal_double(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ViewMap_GetClosestFEdge" "', argument " "2"" of type '" "real""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ViewMap_getClosestFEdge" "', argument " "2"" of type '" "real""'"); } arg2 = static_cast< real >(val2); ecode3 = SWIG_AsVal_double(obj2, &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ViewMap_GetClosestFEdge" "', argument " "3"" of type '" "real""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ViewMap_getClosestFEdge" "', argument " "3"" of type '" "real""'"); } arg3 = static_cast< real >(val3); { try { - result = (FEdge *)((ViewMap const *)arg1)->GetClosestFEdge(arg2,arg3); + result = (FEdge *)((ViewMap const *)arg1)->getClosestFEdge(arg2,arg3); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -49638,7 +49638,7 @@ fail: } -SWIGINTERN PyObject *_wrap_TVertex_setFrontVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_TVertex_setFrontSVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; TVertex *arg1 = (TVertex *) 0 ; SVertex *arg2 = (SVertex *) 0 ; @@ -49649,20 +49649,20 @@ SWIGINTERN PyObject *_wrap_TVertex_setFrontVertex(PyObject *SWIGUNUSEDPARM(self) PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:TVertex_setFrontVertex",&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:TVertex_setFrontSVertex",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_TVertex, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TVertex_setFrontVertex" "', argument " "1"" of type '" "TVertex *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TVertex_setFrontSVertex" "', argument " "1"" of type '" "TVertex *""'"); } arg1 = reinterpret_cast< TVertex * >(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SVertex, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TVertex_setFrontVertex" "', argument " "2"" of type '" "SVertex *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TVertex_setFrontSVertex" "', argument " "2"" of type '" "SVertex *""'"); } arg2 = reinterpret_cast< SVertex * >(argp2); { try { - (arg1)->setFrontVertex(arg2); + (arg1)->setFrontSVertex(arg2); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -50333,7 +50333,7 @@ fail: } -SWIGINTERN PyObject *_wrap_TVertex_GetSVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_TVertex_getSVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; TVertex *arg1 = (TVertex *) 0 ; FEdge *arg2 = (FEdge *) 0 ; @@ -50345,20 +50345,20 @@ SWIGINTERN PyObject *_wrap_TVertex_GetSVertex(PyObject *SWIGUNUSEDPARM(self), Py PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:TVertex_GetSVertex",&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:TVertex_getSVertex",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_TVertex, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TVertex_GetSVertex" "', argument " "1"" of type '" "TVertex *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TVertex_getSVertex" "', argument " "1"" of type '" "TVertex *""'"); } arg1 = reinterpret_cast< TVertex * >(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_FEdge, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TVertex_GetSVertex" "', argument " "2"" of type '" "FEdge *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TVertex_getSVertex" "', argument " "2"" of type '" "FEdge *""'"); } arg2 = reinterpret_cast< FEdge * >(argp2); { try { - result = (SVertex *)(arg1)->GetSVertex(arg2); + result = (SVertex *)(arg1)->getSVertex(arg2); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -107608,8 +107608,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"ViewMap_userdata_get", _wrap_ViewMap_userdata_get, METH_VARARGS, NULL}, { (char *)"new_ViewMap", _wrap_new_ViewMap, METH_VARARGS, NULL}, { (char *)"delete_ViewMap", _wrap_delete_ViewMap, METH_VARARGS, NULL}, - { (char *)"ViewMap_GetClosestViewEdge", _wrap_ViewMap_GetClosestViewEdge, METH_VARARGS, NULL}, - { (char *)"ViewMap_GetClosestFEdge", _wrap_ViewMap_GetClosestFEdge, METH_VARARGS, NULL}, + { (char *)"ViewMap_getClosestViewEdge", _wrap_ViewMap_getClosestViewEdge, METH_VARARGS, NULL}, + { (char *)"ViewMap_getClosestFEdge", _wrap_ViewMap_getClosestFEdge, METH_VARARGS, NULL}, { (char *)"ViewMap_getInstance", _wrap_ViewMap_getInstance, METH_VARARGS, NULL}, { (char *)"ViewMap_ViewShapes", _wrap_ViewMap_ViewShapes, METH_VARARGS, NULL}, { (char *)"ViewMap_ViewEdges", _wrap_ViewMap_ViewEdges, METH_VARARGS, NULL}, @@ -107664,14 +107664,14 @@ static PyMethodDef SwigMethods[] = { { (char *)"TVertex_frontEdgeB", _wrap_TVertex_frontEdgeB, METH_VARARGS, NULL}, { (char *)"TVertex_backEdgeA", _wrap_TVertex_backEdgeA, METH_VARARGS, NULL}, { (char *)"TVertex_backEdgeB", _wrap_TVertex_backEdgeB, METH_VARARGS, NULL}, - { (char *)"TVertex_setFrontVertex", _wrap_TVertex_setFrontVertex, METH_VARARGS, NULL}, + { (char *)"TVertex_setFrontSVertex", _wrap_TVertex_setFrontSVertex, METH_VARARGS, NULL}, { (char *)"TVertex_setBackSVertex", _wrap_TVertex_setBackSVertex, METH_VARARGS, NULL}, { (char *)"TVertex_setFrontEdgeA", _wrap_TVertex_setFrontEdgeA, METH_VARARGS, NULL}, { (char *)"TVertex_setFrontEdgeB", _wrap_TVertex_setFrontEdgeB, METH_VARARGS, NULL}, { (char *)"TVertex_setBackEdgeA", _wrap_TVertex_setBackEdgeA, METH_VARARGS, NULL}, { (char *)"TVertex_setBackEdgeB", _wrap_TVertex_setBackEdgeB, METH_VARARGS, NULL}, { (char *)"TVertex_setId", _wrap_TVertex_setId, METH_VARARGS, NULL}, - { (char *)"TVertex_GetSVertex", _wrap_TVertex_GetSVertex, METH_VARARGS, NULL}, + { (char *)"TVertex_getSVertex", _wrap_TVertex_getSVertex, METH_VARARGS, NULL}, { (char *)"TVertex_Replace", _wrap_TVertex_Replace, METH_VARARGS, NULL}, { (char *)"TVertex_mate", _wrap_TVertex_mate, METH_VARARGS, NULL}, { (char *)"TVertex_edges_end", _wrap_TVertex_edges_end, METH_VARARGS, NULL}, diff --git a/source/blender/freestyle/python/Freestyle.py b/source/blender/freestyle/python/Freestyle.py index 079eb01eb31..9db78a050e0 100755 --- a/source/blender/freestyle/python/Freestyle.py +++ b/source/blender/freestyle/python/Freestyle.py @@ -1403,8 +1403,8 @@ class ViewMap(_object): except: self.this = this __swig_destroy__ = _Freestyle.delete_ViewMap __del__ = lambda self : None; - def GetClosestViewEdge(*args): return _Freestyle.ViewMap_GetClosestViewEdge(*args) - def GetClosestFEdge(*args): return _Freestyle.ViewMap_GetClosestFEdge(*args) + def getClosestViewEdge(*args): return _Freestyle.ViewMap_getClosestViewEdge(*args) + def getClosestFEdge(*args): return _Freestyle.ViewMap_getClosestFEdge(*args) __swig_getmethods__["getInstance"] = lambda x: _Freestyle.ViewMap_getInstance if _newclass:getInstance = staticmethod(_Freestyle.ViewMap_getInstance) def ViewShapes(*args): return _Freestyle.ViewMap_ViewShapes(*args) @@ -1487,14 +1487,14 @@ class TVertex(ViewVertex): def frontEdgeB(*args): return _Freestyle.TVertex_frontEdgeB(*args) def backEdgeA(*args): return _Freestyle.TVertex_backEdgeA(*args) def backEdgeB(*args): return _Freestyle.TVertex_backEdgeB(*args) - def setFrontVertex(*args): return _Freestyle.TVertex_setFrontVertex(*args) + def setFrontSVertex(*args): return _Freestyle.TVertex_setFrontSVertex(*args) def setBackSVertex(*args): return _Freestyle.TVertex_setBackSVertex(*args) def setFrontEdgeA(*args): return _Freestyle.TVertex_setFrontEdgeA(*args) def setFrontEdgeB(*args): return _Freestyle.TVertex_setFrontEdgeB(*args) def setBackEdgeA(*args): return _Freestyle.TVertex_setBackEdgeA(*args) def setBackEdgeB(*args): return _Freestyle.TVertex_setBackEdgeB(*args) def setId(*args): return _Freestyle.TVertex_setId(*args) - def GetSVertex(*args): return _Freestyle.TVertex_GetSVertex(*args) + def getSVertex(*args): return _Freestyle.TVertex_getSVertex(*args) def Replace(*args): return _Freestyle.TVertex_Replace(*args) def mate(*args): return _Freestyle.TVertex_mate(*args) def edges_end(*args): return _Freestyle.TVertex_edges_end(*args) -- cgit v1.2.3