soc-2008-mxcurioni: finished porting the Freestyle API. All of the original classes...
authorMaxime Curioni <maxime.curioni@gmail.com>
Tue, 29 Jul 2008 05:45:16 +0000 (05:45 +0000)
committerMaxime Curioni <maxime.curioni@gmail.com>
Tue, 29 Jul 2008 05:45:16 +0000 (05:45 +0000)
Quite a few modifications were made to finish the API:
- Freestyle's SConscript was modified to catch all files within the intern/python directory, allowing integration of future shaders implemented in C++.
- the Operators class was ported, with a special care of making its methods static (using the METH_STATIC flag in the tp_methods method definitions)
- all of the type-checking functions [ BPy_[class name]_Check(obj) ] were changed to allow subclasses to be seen as that type too: instead on looking at the ob_type value, the PyObject_IsInstance function is used.
- all of the iterators can now retrieve the object pointed to by the operator, using the getObject() method. A directedViewEdge pair is returned as a list of the two elements in the pair.
- all of the style modules were copied to a style_modules_blender/ folder and were modified to use Freestyle as a Blender's submodule. IntegrationType and MediumType was also integrated (for example, changing MEAN to IntegrationType.MEAN).

Testing now begins. If everything works correctly, I'll move on to lib3ds removal right away.

214 files changed:
source/blender/freestyle/SConscript
source/blender/freestyle/intern/python/BPy_BBox.h
source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.h
source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.h
source/blender/freestyle/intern/python/BPy_Convert.cpp
source/blender/freestyle/intern/python/BPy_Convert.h
source/blender/freestyle/intern/python/BPy_Freestyle.cpp
source/blender/freestyle/intern/python/BPy_Freestyle.h
source/blender/freestyle/intern/python/BPy_FrsMaterial.h
source/blender/freestyle/intern/python/BPy_Id.h
source/blender/freestyle/intern/python/BPy_IntegrationType.h
source/blender/freestyle/intern/python/BPy_Interface0D.h
source/blender/freestyle/intern/python/BPy_Interface1D.h
source/blender/freestyle/intern/python/BPy_Iterator.cpp
source/blender/freestyle/intern/python/BPy_Iterator.h
source/blender/freestyle/intern/python/BPy_MediumType.h
source/blender/freestyle/intern/python/BPy_Nature.h
source/blender/freestyle/intern/python/BPy_Noise.h
source/blender/freestyle/intern/python/BPy_Operators.cpp
source/blender/freestyle/intern/python/BPy_Operators.h [new file with mode: 0644]
source/blender/freestyle/intern/python/BPy_SShape.h
source/blender/freestyle/intern/python/BPy_StrokeAttribute.h
source/blender/freestyle/intern/python/BPy_StrokeShader.h
source/blender/freestyle/intern/python/BPy_UnaryFunction0D.h
source/blender/freestyle/intern/python/BPy_UnaryFunction1D.h
source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.h
source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.h
source/blender/freestyle/intern/python/BPy_ViewMap.h
source/blender/freestyle/intern/python/BPy_ViewShape.h
source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.h
source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_Length2DBP1D.h
source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_SameShapeIdBP1D.h
source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_TrueBP1D.h
source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.h
source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.h
source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.h
source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.h
source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.h
source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.h
source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.h
source/blender/freestyle/intern/python/Interface1D/BPy_Curve.h
source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.h
source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.h
source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.h
source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.h
source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.h
source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp
source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.h
source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.h
source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.h
source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp
source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.h
source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.h
source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.h
source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp
source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.h
source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.h
source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp
source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.h
source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp
source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.h
source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessVariationPatternShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_fstreamShader.h
source/blender/freestyle/intern/python/StrokeShader/BPy_streamShader.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.h
source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Id/BPy_ShapeIdF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Material/BPy_MaterialF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Nature_EdgeNature/BPy_CurveNatureF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_Normal2DF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_VertexOrientation2DF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec3f/BPy_VertexOrientation3DF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetOccludeeF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetShapeF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_Curvature2DAngleF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_DensityF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedXF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedYF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedZF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetXF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetYF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetZF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_LocalAverageDepthF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_ZDiscontinuityF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetCurvilinearAbscissaF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetParameterF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetViewMapGradientNormF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadCompleteViewMapPixelF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadMapPixelF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadSteerableViewMapPixelF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.h
source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_vector_ViewShape/BPy_GetOccludersF0D.h
source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.h
source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.h
source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.h
source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.h
source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.h
source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.h
source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.h
source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludeeF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludersF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetShapeF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_ChainingTimeStampF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_IncrementChainingTimeStampF1D.h
source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_TimeStampF1D.h
source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_FalseUP0D.h
source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_TrueUP0D.h
source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ContourUP1D.h
source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_DensityLowerThanUP1D.h
source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToChainingTimeStampUP1D.h
source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToTimeStampUP1D.h
source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ExternalContourUP1D.h
source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_FalseUP1D.h
source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_QuantitativeInvisibilityUP1D.h
source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ShapeUP1D.h
source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_TrueUP1D.h
source/blender/freestyle/style_modules_blender/ChainingIterators.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/Functions0D.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/Functions1D.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/PredicatesB1D.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/PredicatesU0D.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/PredicatesU1D.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/anisotropic_diffusion.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/apriori_and_causal_density.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/apriori_density.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/backbone_stretcher.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/blueprint_circles.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/blueprint_ellipses.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/blueprint_squares.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/cartoon.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/contour.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/curvature2d.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/external_contour.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/external_contour_sketchy.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/external_contour_smooth.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/extra-lines.sml [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/haloing.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/ignore_small_occlusions.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/invisible_lines.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/japanese_bigbrush.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/logical_operators.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/long_anisotropically_dense.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/multiple_parameterization.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/nature.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/near_lines.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/occluded_by_specific_object.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/polygonalize.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/qi0.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/qi0_not_external_contour.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/qi1.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/qi2.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/sequentialsplit_sketchy.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/shaders.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/sketchy_multiple_parameterization.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/sketchy_topology_broken.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/sketchy_topology_preserved.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/split_at_highest_2d_curvatures.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/split_at_tvertices.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/stroke_texture.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/suggestive.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/thickness_fof_depth_discontinuity.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/tipremover.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/tvertex_remover.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/uniformpruning_zsort.py [new file with mode: 0755]
source/blender/freestyle/style_modules_blender/vector.py [new file with mode: 0755]

index 6423cce65933d25a08692f000dae3f53dd4cbeb6..f74479a8309781add460657bd7b0a0c7fb282df9 100644 (file)
@@ -9,7 +9,7 @@ incs = ''
 incs += '../blenkernel ../blenlib ../imbuf ../makesdna ../python '
 incs += '../render/extern/include ../render/intern/include ../include ../src'
 incs += ' #/extern/freestyle/lib3ds' 
-incs += ' ' + env['BF_PYTHON_INC']
+incs += ' ' + env['BF_PYTHON_INC']     
 incs += ' ' + env['BF_LIB3DS_INC']
 incs += ' ' + env['BF_PNG_INC']
 
@@ -58,145 +58,10 @@ app_sources = env.Glob(prefix + '/*.cpp')
 
 #      Python
 prefix = 'intern/python'
-# python_sources = env.Glob(prefix + '/*.cpp')
-python_sources = [
-                                       prefix + '/BPy_Freestyle.cpp',
-                                       prefix + '/BPy_Convert.cpp',
-                                       prefix + '/BPy_BBox.cpp',
-                                       prefix + '/BPy_BinaryPredicate0D.cpp',
-                                       prefix + '/BPy_BinaryPredicate1D.cpp',
-                                       prefix + '/BPy_FrsMaterial.cpp',
-                                       prefix + '/BPy_Id.cpp',
-                                       prefix + '/BPy_IntegrationType.cpp',
-                                       prefix + '/BPy_Interface0D.cpp',
-                                               prefix + '/Interface0D/BPy_CurvePoint.cpp',
-                                               prefix + '/Interface0D/CurvePoint/BPy_StrokeVertex.cpp',
-                                               prefix + '/Interface0D/BPy_SVertex.cpp',
-                                               prefix + '/Interface0D/BPy_ViewVertex.cpp',
-                                               prefix + '/Interface0D/ViewVertex/BPy_NonTVertex.cpp',
-                                               prefix + '/Interface0D/ViewVertex/BPy_TVertex.cpp',
-                                       prefix + '/BPy_Interface1D.cpp',
-                                               prefix + '/Interface1D/BPy_Curve.cpp',
-                                               prefix + '/Interface1D/Curve/BPy_Chain.cpp',
-                                               prefix + '/Interface1D/BPy_FEdge.cpp',
-                                               prefix + '/Interface1D/FEdge/BPy_FEdgeSharp.cpp',
-                                               prefix + '/Interface1D/FEdge/BPy_FEdgeSmooth.cpp',
-                                               prefix + '/Interface1D/BPy_Stroke.cpp',
-                                               prefix + '/Interface1D/BPy_ViewEdge.cpp',
-                                       prefix + '/BPy_Iterator.cpp',
-                                               prefix + '/Iterator/BPy_AdjacencyIterator.cpp',
-                                               prefix + '/Iterator/BPy_Interface0DIterator.cpp',
-                                               prefix + '/Iterator/BPy_CurvePointIterator.cpp',
-                                               prefix + '/Iterator/BPy_StrokeVertexIterator.cpp',
-                                               prefix + '/Iterator/BPy_SVertexIterator.cpp',
-                                               prefix + '/Iterator/BPy_orientedViewEdgeIterator.cpp',
-                                               prefix + '/Iterator/BPy_ViewEdgeIterator.cpp',
-                                               prefix + '/Iterator/BPy_ChainingIterator.cpp',
-                                               prefix + '/Iterator/BPy_ChainPredicateIterator.cpp',
-                                               prefix + '/Iterator/BPy_ChainSilhouetteIterator.cpp',
-                                       prefix + '/BPy_MediumType.cpp',
-                                       prefix + '/BPy_Nature.cpp',
-                                       prefix + '/BPy_Noise.cpp',
-                                       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',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_DensityF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedXF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedYF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedZF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetXF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetYF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_GetZF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_LocalAverageDepthF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_double/BPy_ZDiscontinuityF0D.cpp',
-                                               prefix + '/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_Nature_EdgeNature/BPy_CurveNatureF0D.cpp',
-                                               prefix + '/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_GetCurvilinearAbscissaF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_GetParameterF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_GetViewMapGradientNormF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadCompleteViewMapPixelF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadMapPixelF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadSteerableViewMapPixelF0D.cpp',
-                                               prefix + '/UnaryFunction0D/BPy_UnaryFunction0DId.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_Id/BPy_ShapeIdF0D.cpp',
-                                               prefix + '/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_Material/BPy_MaterialF0D.cpp',
-                                               prefix + '/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp',
-                                               prefix + '/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_Normal2DF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_VertexOrientation2DF0D.cpp',
-                                               prefix + '/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_Vec3f/BPy_VertexOrientation3DF0D.cpp',
-                                               prefix + '/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_vector_ViewShape/BPy_GetOccludersF0D.cpp',
-                                               prefix + '/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetOccludeeF0D.cpp',
-                                                       prefix + '/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetShapeF0D.cpp',
-                                       prefix + '/BPy_UnaryFunction1D.cpp',
-                                                       prefix + '/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp',
-                                                       prefix + '/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp',
-                                                                       prefix + '/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp',
-                                                       prefix + '/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp',
-                                                       prefix + '/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp',
-                                                       prefix + '/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp',
-                                                       prefix + '/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp',
-                                                       prefix + '/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludeeF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludersF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetShapeF1D.cpp',
-                                                       prefix + '/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_void/BPy_ChainingTimeStampF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_void/BPy_IncrementChainingTimeStampF1D.cpp',
-                                                               prefix + '/UnaryFunction1D/UnaryFunction1D_void/BPy_TimeStampF1D.cpp',
-                                       prefix + '/BPy_UnaryPredicate0D.cpp',
-                                       prefix + '/BPy_UnaryPredicate1D.cpp',
-                                       prefix + '/BPy_ViewMap.cpp',
-                                       prefix + '/BPy_ViewShape.cpp'
-                               ]
+python_sources =  env.Glob(prefix + '/*.cpp') \
+                               + env.Glob(prefix + '/*/*.cpp') \
+                               + env.Glob(prefix + '/*/*/*.cpp') \
+                               + env.Glob(prefix + '/*/*/*/*.cpp')
 
 sources =      system_sources + image_sources + geometry_sources + scene_graph_sources \
                  +     winged_edge_sources + view_map_sources + stroke_sources + rendering_sources \
index 88bba3301bb8d26d89f8bc2666bd70bb8e03649e..90fbc565b33ae561f19c49f7ab4715a0a6070b74 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject BBox_Type;
 
-#define BPy_BBox_Check(v)      (( (PyObject *) v)->ob_type == &BBox_Type)
+#define BPy_BBox_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &BBox_Type)  )
 
 /*---------------------------Python BPy_BBox structure definition----------*/
 typedef struct {
index dd19287767519b5fb39ee8c03144b3f755be65db..8b92fbe4e35416ad3026e095a8f2e443b08b8b2e 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject BinaryPredicate0D_Type;
 
-#define BPy_BinaryPredicate0D_Check(v) (( (PyObject *) v)->ob_type == &BinaryPredicate0D_Type)
+#define BPy_BinaryPredicate0D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &BinaryPredicate0D_Type)  )
 
 /*---------------------------Python BPy_BinaryPredicate0D structure definition----------*/
 typedef struct {
index 035e2b6cb17961229e4c00775b7d78d6a1a467fc..66f5e2fd4dfe435f7ccaf6e1572bc39bd1d9557d 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject BinaryPredicate1D_Type;
 
-#define BPy_BinaryPredicate1D_Check(v) (( (PyObject *) v)->ob_type == &BinaryPredicate1D_Type)
+#define BPy_BinaryPredicate1D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &BinaryPredicate1D_Type)  )
 
 /*---------------------------Python BPy_BinaryPredicate1D structure definition----------*/
 typedef struct {
index 042d4b7bef09f20d058ec281a81e04f76332ddd4..b541babd7521575ade10110e91270b67b77b9cd8 100644 (file)
@@ -5,20 +5,29 @@
 #include "BPy_Id.h"
 #include "BPy_IntegrationType.h"
 #include "BPy_Interface0D.h"
+#include "Interface0D/BPy_CurvePoint.cpp"
 #include "Interface0D/CurvePoint/BPy_StrokeVertex.h"
 #include "Interface0D/BPy_SVertex.h"
 #include "Interface0D/BPy_ViewVertex.h"
 #include "Interface1D/BPy_FEdge.h"
 #include "Interface1D/BPy_ViewEdge.h"
-#include "Iterator/BPy_Interface0DIterator.h"
-#include "Iterator/BPy_orientedViewEdgeIterator.h"
-#include "Iterator/BPy_StrokeVertexIterator.h"
 #include "BPy_Nature.h"
 #include "BPy_MediumType.h"
 #include "BPy_SShape.h"
 #include "BPy_StrokeAttribute.h"
 #include "BPy_ViewShape.h"
 
+#include "Iterator/BPy_AdjacencyIterator.h"
+#include "Iterator/BPy_ChainPredicateIterator.h"
+#include "Iterator/BPy_ChainSilhouetteIterator.h"
+#include "Iterator/BPy_ChainingIterator.h"
+#include "Iterator/BPy_CurvePointIterator.h"
+#include "Iterator/BPy_Interface0DIterator.h"
+#include "Iterator/BPy_SVertexIterator.h"
+#include "Iterator/BPy_StrokeVertexIterator.h"
+#include "Iterator/BPy_ViewEdgeIterator.h"
+#include "Iterator/BPy_orientedViewEdgeIterator.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -161,11 +170,62 @@ PyObject * BPy_ViewShape_from_ViewShape( ViewShape& vs ) {
        return py_vs;
 }
 
-PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ViewVertexInternal::orientedViewEdgeIterator& ove_it ) {
-       PyObject *py_ove_it = orientedViewEdgeIterator_Type.tp_new( &orientedViewEdgeIterator_Type, 0, 0 );
-       ((BPy_orientedViewEdgeIterator *) py_ove_it)->ove_it = new ViewVertexInternal::orientedViewEdgeIterator( ove_it );
+PyObject * BPy_FrsMaterial_from_Material( Material& m ){
+       PyObject *py_m = FrsMaterial_Type.tp_new( &FrsMaterial_Type, 0, 0 );
+       ((BPy_FrsMaterial*) py_m)->m = new Material( m );
 
-       return py_ove_it;
+       return py_m;
+}
+
+PyObject * BPy_IntegrationType_from_IntegrationType( int i ) {
+       PyObject *py_it = IntegrationType_Type.tp_new( &IntegrationType_Type, 0, 0 );
+
+       PyObject *args = PyTuple_New(1);
+       PyTuple_SetItem( args, 0, PyInt_FromLong(i) );
+       IntegrationType_Type.tp_init( py_it, args, 0 );
+       Py_DECREF(args);
+
+       return py_it;
+}
+
+PyObject * BPy_CurvePoint_from_CurvePoint( CurvePoint& cp ) {
+       PyObject *py_cp = CurvePoint_Type.tp_new( &CurvePoint_Type, 0, 0 );
+       ((BPy_CurvePoint*) py_cp)->cp = new CurvePoint( cp );
+
+       return py_cp;
+}
+
+PyObject * BPy_directedViewEdge_from_directedViewEdge( ViewVertex::directedViewEdge& dve ) {
+       PyObject *py_dve = PyList_New(2);
+       
+       PyList_SetItem( py_dve, 0, BPy_ViewEdge_from_ViewEdge(*(dve.first)) );
+       PyList_SetItem( py_dve, 1, PyBool_from_bool(dve.second) );
+       
+       return py_dve;
+}
+
+
+//==============================
+// Constants
+//==============================
+
+IntegrationType IntegrationType_from_BPy_IntegrationType( PyObject* obj ) {
+       return static_cast<IntegrationType>( PyInt_AsLong(obj) );
+}
+
+Stroke::MediumType MediumType_from_BPy_MediumType( PyObject* obj ) {
+       return static_cast<Stroke::MediumType>( PyInt_AsLong(obj) );
+}
+
+//==============================
+// Iterators
+//==============================
+
+PyObject * BPy_AdjacencyIterator_from_AdjacencyIterator( AdjacencyIterator& a_it ) {
+       PyObject *py_a_it = AdjacencyIterator_Type.tp_new( &AdjacencyIterator_Type, 0, 0 );
+       ((BPy_AdjacencyIterator *) py_a_it)->a_it = new AdjacencyIterator( a_it );
+
+       return py_a_it;
 }
 
 PyObject * BPy_Interface0DIterator_from_Interface0DIterator( Interface0DIterator& if0D_it ) {
@@ -175,6 +235,13 @@ PyObject * BPy_Interface0DIterator_from_Interface0DIterator( Interface0DIterator
        return py_if0D_it;
 }
 
+PyObject * BPy_CurvePointIterator_from_CurvePointIterator( CurveInternal::CurvePointIterator& cp_it ) {
+       PyObject *py_cp_it = CurvePointIterator_Type.tp_new( &CurvePointIterator_Type, 0, 0 );
+       ((BPy_CurvePointIterator*) py_cp_it)->cp_it = new CurveInternal::CurvePointIterator( cp_it );
+
+       return py_cp_it;
+}
+
 PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator( StrokeInternal::StrokeVertexIterator& sv_it) {
        PyObject *py_sv_it = StrokeVertexIterator_Type.tp_new( &StrokeVertexIterator_Type, 0, 0 );
        ((BPy_StrokeVertexIterator*) py_sv_it)->sv_it = new StrokeInternal::StrokeVertexIterator( sv_it );
@@ -182,33 +249,52 @@ PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator( StrokeInternal::S
        return py_sv_it;
 }
 
-PyObject * BPy_FrsMaterial_from_Material( Material& m ){
-       PyObject *py_m = FrsMaterial_Type.tp_new( &FrsMaterial_Type, 0, 0 );
-       ((BPy_FrsMaterial*) py_m)->m = new Material( m );
+PyObject * BPy_SVertexIterator_from_SVertexIterator( ViewEdgeInternal::SVertexIterator& sv_it ) {
+       PyObject *py_sv_it = SVertexIterator_Type.tp_new( &SVertexIterator_Type, 0, 0 );
+       ((BPy_SVertexIterator*) py_sv_it)->sv_it = new ViewEdgeInternal::SVertexIterator( sv_it );
 
-       return py_m;
+       return py_sv_it;
 }
 
-PyObject * BPy_IntegrationType_from_IntegrationType( int i ) {
-       PyObject *py_it = IntegrationType_Type.tp_new( &IntegrationType_Type, 0, 0 );
+PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ViewVertexInternal::orientedViewEdgeIterator& ove_it ) {
+       PyObject *py_ove_it = orientedViewEdgeIterator_Type.tp_new( &orientedViewEdgeIterator_Type, 0, 0 );
+       ((BPy_orientedViewEdgeIterator *) py_ove_it)->ove_it = new ViewVertexInternal::orientedViewEdgeIterator( ove_it );
 
-       PyObject *args = PyTuple_New(1);
-       PyTuple_SetItem( args, 0, PyInt_FromLong(i) );
-       IntegrationType_Type.tp_init( py_it, args, 0 );
-       Py_DECREF(args);
+       return py_ove_it;
+}
 
-       return py_it;
+PyObject * BPy_ViewEdgeIterator_from_ViewEdgeIterator( ViewEdgeInternal::ViewEdgeIterator& ve_it )  {
+       PyObject *py_ve_it = ViewEdgeIterator_Type.tp_new( &ViewEdgeIterator_Type, 0, 0 );
+       ((BPy_ViewEdgeIterator*) py_ve_it)->ve_it = new ViewEdgeInternal::ViewEdgeIterator( ve_it );
+
+       return py_ve_it;
 }
 
-IntegrationType IntegrationType_from_BPy_IntegrationType( PyObject* obj ) {
-       return static_cast<IntegrationType>( PyInt_AsLong(obj) );
+PyObject * BPy_ChainingIterator_from_ChainingIterator( ChainingIterator& c_it ) {
+       PyObject *py_c_it = ChainingIterator_Type.tp_new( &ChainingIterator_Type, 0, 0 );
+       ((BPy_ChainingIterator*) py_c_it)->c_it = new ChainingIterator( c_it );
+
+       return py_c_it;
 }
 
-Stroke::MediumType MediumType_from_BPy_MediumType( PyObject* obj ) {
-       return static_cast<Stroke::MediumType>( PyInt_AsLong(obj) );
+PyObject * BPy_ChainPredicateIterator_from_ChainPredicateIterator( ChainPredicateIterator& cp_it ) {
+       PyObject *py_cp_it = ChainPredicateIterator_Type.tp_new( &ChainPredicateIterator_Type, 0, 0 );
+       ((BPy_ChainPredicateIterator*) py_cp_it)->cp_it = new ChainPredicateIterator( cp_it );
+
+       return py_cp_it;
+}
+
+PyObject * BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator( ChainSilhouetteIterator& cs_it ) {
+       PyObject *py_cs_it = ChainSilhouetteIterator_Type.tp_new( &ChainSilhouetteIterator_Type, 0, 0 );
+       ((BPy_ChainSilhouetteIterator*) py_cs_it)->cs_it = new ChainSilhouetteIterator( cs_it );
+
+       return py_cs_it;
 }
 
 
+
+
+
 ///////////////////////////////////////////////////////////////////////////////////////////
 
 #ifdef __cplusplus
index b43f7bab29189db6265af9d946c0074807bb8b9a..5b613b3c4c313c3750d76eb6fb2f2cd9a15bd834 100644 (file)
@@ -26,20 +26,24 @@ using namespace Geometry;
 // NonTVertex, TVertex, ViewEdge, ViewMap, ViewShape, ViewVertex
 #include "../view_map/ViewMap.h"
 
+// CurvePoint, Curve
+#include "../stroke/Curve.h"
+
+//====== ITERATORS
+
+// AdjacencyIterator, ChainingIterator, ChainSilhouetteIterator, ChainPredicateIterator
+#include "../stroke/ChainingIterators.h"
+
 // ViewVertexInternal::orientedViewEdgeIterator
 // ViewEdgeInternal::SVertexIterator
 // ViewEdgeInternal::ViewEdgeIterator
 #include "../view_map/ViewMapIterators.h"
-//#####################    IMPORTANT   #####################
-//  Do not use the following namespaces within this file :
-//   - ViewVertexInternal 
-//   - ViewEdgeInternal
-//##########################################################
 
 // StrokeInternal::StrokeVertexIterator
 #include "../stroke/StrokeIterators.h"
 
-
+// CurveInternal::CurvePointIterator
+#include "../stroke/CurveIterators.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -62,6 +66,8 @@ 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_CurvePoint_from_CurvePoint( CurvePoint& cp );
+PyObject * BPy_directedViewEdge_from_directedViewEdge( ViewVertex::directedViewEdge& dve );
 PyObject * BPy_FEdge_from_FEdge( FEdge& fe );
 PyObject * BPy_Id_from_Id( Id& id );
 PyObject * BPy_Interface0D_from_Interface0D( Interface0D& if0D );
@@ -77,9 +83,19 @@ PyObject * BPy_ViewVertex_from_ViewVertex_ptr( ViewVertex *vv );
 PyObject * BPy_ViewEdge_from_ViewEdge( ViewEdge& ve );
 PyObject * BPy_ViewShape_from_ViewShape( ViewShape& vs );
 
+PyObject * BPy_AdjacencyIterator_from_AdjacencyIterator( AdjacencyIterator& a_it );
 PyObject * BPy_Interface0DIterator_from_Interface0DIterator( Interface0DIterator& if0D_it );
-PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ViewVertexInternal::orientedViewEdgeIterator& ove_it );
+PyObject * BPy_CurvePointIterator_from_CurvePointIterator( CurveInternal::CurvePointIterator& cp_it );
 PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator( StrokeInternal::StrokeVertexIterator& sv_it);
+PyObject * BPy_SVertexIterator_from_SVertexIterator( ViewEdgeInternal::SVertexIterator& sv_it );
+PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ViewVertexInternal::orientedViewEdgeIterator& ove_it );
+PyObject * BPy_ViewEdgeIterator_from_ViewEdgeIterator( ViewEdgeInternal::ViewEdgeIterator& ve_it );
+PyObject * BPy_ChainingIterator_from_ChainingIterator( ChainingIterator& c_it );
+PyObject * BPy_ChainPredicateIterator_from_ChainPredicateIterator( ChainPredicateIterator& cp_it );
+PyObject * BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator( ChainSilhouetteIterator& cs_it );
+
+
+   
 
 ///////////////////////////////////////////////////////////////////////////////////////////
 
index ed35a85068b93a8dd3bc5445f65a56c6c97f2080..85a2783102ea3451b1a89c2ad15b02bf7cf0989d 100644 (file)
@@ -11,6 +11,7 @@
 #include "BPy_Iterator.h"
 #include "BPy_MediumType.h"
 #include "BPy_Nature.h"
+#include "BPy_Operators.h"
 #include "BPy_Noise.h"
 #include "BPy_SShape.h"
 #include "BPy_StrokeAttribute.h"
@@ -152,6 +153,7 @@ PyObject *Freestyle_Init( void )
        Interface0D_Init( module );
        Interface1D_Init( module );
        Iterator_Init( module );
+       Operators_Init( module );
        Noise_Init( module );
        SShape_Init( module );
        StrokeAttribute_Init( module );
index 9cdef4df2d295621fd53ab3254eeb80c670c191a..4990a2e685d1d776d08f6ae168824b9a3801b53f 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
 
 extern PyTypeObject Freestyle_Type;
 
-#define BPy_Freestyle_Check(v) (( (PyObject *) v)->ob_type == &Freestyle_Type)
+#define BPy_Freestyle_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Freestyle_Type)  )
 
 /*---------------------------Python BPy_Freestyle structure definition----------*/
 typedef struct {
index 90ed68059741459164812dc91bff544e89289923..cb1aa20bb212cac205fa4e1a0bb09019d0b43c17 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject FrsMaterial_Type;
 
-#define BPy_FrsMaterial_Check(v)       (( (PyObject *) v)->ob_type == &FrsMaterial_Type)
+#define BPy_FrsMaterial_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &FrsMaterial_Type)  )
 
 /*---------------------------Python BPy_FrsMaterial structure definition----------*/
 typedef struct {
index d5e90a0a3e5ca815420dee64dda38344df5d68bd..fd9446618b8ecf2cba762baf7f68631346909250 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject Id_Type;
 
-#define BPy_Id_Check(v)        (( (PyObject *) v)->ob_type == &Id_Type)
+#define BPy_Id_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Id_Type)  )
 
 /*---------------------------Python BPy_Id structure definition----------*/
 typedef struct {
index ab212ac65608e2a9e36fc19acac8f5d1ce59ad18..a31fe9599963899a36a5396a534f2afb4b00f2b8 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject IntegrationType_Type;
 
-#define BPy_IntegrationType_Check(v)   (( (PyObject *) v)->ob_type == &IntegrationType_Type)
+#define BPy_IntegrationType_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &IntegrationType_Type)  )
 
 /*---------------------------Python BPy_IntegrationType structure definition----------*/
 typedef struct {
index aaecc6dad941f957a805a3e154c572cb14f8f8c8..a55deb80a6f908540b42e7d30ce7e575714aa37f 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Interface0D_Type;
 
-#define BPy_Interface0D_Check(v)       (( (PyObject *) v)->ob_type == &Interface0D_Type)
+#define BPy_Interface0D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Interface0D_Type)  )
 
 /*---------------------------Python BPy_Interface0D structure definition----------*/
 typedef struct {
index c49a8c130b0dfb3537dffc36428a810320582f42..14971bf88f576432626ec6b6a257300544eadc59 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Interface1D_Type;
 
-#define BPy_Interface1D_Check(v)       (( (PyObject *) v)->ob_type == &Interface1D_Type)
+#define BPy_Interface1D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Interface1D_Type)  )
 
 /*---------------------------Python BPy_Interface1D structure definition----------*/
 typedef struct {
index b946e0a9a9a6661d946f10a68b7dd10c4ac5040c..cf6d8ed48770d5d897ff9e5fe3d09af3361de2ba 100644 (file)
@@ -227,6 +227,12 @@ PyObject * Iterator_isEnd(BPy_Iterator* self) {
        return PyBool_from_bool( self->it->isEnd() );
 }
 
+//%rename(getObject) Interface0DIterator::operator*
+PyObject * Iterator_getObject(BPy_Iterator* self) {
+       return PyBool_from_bool( self->it->isEnd() );
+}
+
+
 
 
 ///////////////////////////////////////////////////////////////////////////////////////////
index 0f92c3b7f281f80caf71220e1f965945bda8849f..bad3980616348d95c54fa0c872aababa544eef0c 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Iterator_Type;
 
-#define BPy_Iterator_Check(v)  (( (PyObject *) v)->ob_type == &Iterator_Type)
+#define BPy_Iterator_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Iterator_Type)  )
 
 /*---------------------------Python BPy_Iterator structure definition----------*/
 typedef struct {
index d56594e0f6831da7c1d2e71eba6f90b093196624..9b4ff5a2fd97c28e2a8e4e62e202335fe00f83b6 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject MediumType_Type;
 
-#define BPy_MediumType_Check(v)        (( (PyObject *) v)->ob_type == &MediumType_Type)
+#define BPy_MediumType_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &MediumType_Type)  )
 
 /*---------------------------Python BPy_MediumType structure definition----------*/
 typedef struct {
index 7473869158ff68d4df2702df7744834604bd85aa..493a4f785999b9eafa79a240ad7422882ed92059 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Nature_Type;
 
-#define BPy_Nature_Check(v)    (( (PyObject *) v)->ob_type == &Nature_Type)
+#define BPy_Nature_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Nature_Type)  )
 
 /*---------------------------Python BPy_Nature structure definition----------*/
 typedef struct {
index b9b66d34e942791c15c3806b61f9c90e8a92d94b..5dc8a1a4bd15793c983de630315d1cf29785b20f 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Noise_Type;
 
-#define BPy_Noise_Check(v)     (( (PyObject *) v)->ob_type == &Noise_Type)
+#define BPy_Noise_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Noise_Type)  )
 
 /*---------------------------Python BPy_Noise structure definition----------*/
 typedef struct {
index efae258d5ee8503f4243b2adeba8fd2e4ac29296..2d883363998cd77d068f80d4706fc15e0d5ab4df 100644 (file)
-PyObject *Operators_select(PyObject *self , PyObject *args) {
-}
+#include "BPy_Operators.h"
 
+#include "BPy_BinaryPredicate1D.h"
+#include "BPy_UnaryPredicate0D.h"
+#include "BPy_UnaryPredicate1D.h"
+#include "UnaryFunction0D/BPy_UnaryFunction0DDouble.h"
+#include "UnaryFunction1D/BPy_UnaryFunction1DVoid.h"
+#include "Iterator/BPy_ViewEdgeIterator.h"
+#include "Iterator/BPy_ChainingIterator.h"
+#include "BPy_StrokeShader.h"
 
-PyObject *Operators_chain(PyObject *self, PyObject *args) {
-}
+#ifdef __cplusplus
+extern "C" {
+#endif
 
+///////////////////////////////////////////////////////////////////////////////////////////
 
-PyObject *Operators_bidirectionalChain(PyObject *self, PyObject *args) {
-}
+/*---------------  Python API function prototypes for Operators instance  -----------*/
+static void Operators___dealloc__(BPy_Operators *self);
 
+static PyObject * Operators_select(BPy_Operators* self, PyObject *args);
 
-PyObject *Operators_sequentialSplit(PyObject *self, PyObject *args) {
-}
+/*----------------------Operators instance definitions ----------------------------*/
+static PyMethodDef BPy_Operators_methods[] = {
+       {"select", ( PyCFunction ) Operators_select, METH_VARARGS | METH_STATIC, "(UnaryPredicate1D up1D )Selects the ViewEdges of the ViewMap verifying a specified condition. "},
+       {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_Operators type definition ------------------------------*/
+
+PyTypeObject Operators_Type = {
+       PyObject_HEAD_INIT( NULL ) 
+       0,                                                      /* ob_size */
+       "Operators",                            /* tp_name */
+       sizeof( BPy_Operators ),        /* tp_basicsize */
+       0,                                                      /* tp_itemsize */
+       
+       /* methods */
+       (destructor)Operators___dealloc__,      /* 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; */
 
-PyObject *Operators_recursiveSplit(PyObject *self, PyObject *args) {
+  /***  weak reference enabler ***/
+       0,                          /* long tp_weaklistoffset; */
+
+  /*** Added in release 2.2 ***/
+       /*   Operatorss */
+       NULL,                       /* getiterfunc tp_iter; */
+       NULL,                       /* iternextfunc tp_iternext; */
+
+  /*** Attribute descriptor and subclassing stuff ***/
+       BPy_Operators_methods,  /* struct PyMethodDef *tp_methods; */
+       NULL,                           /* struct PyMemberDef *tp_members; */
+       NULL,                                           /* struct PyGetSetDef *tp_getset; */
+       NULL,                                                   /* struct _typeobject *tp_base; */
+       NULL,                                                   /* PyObject *tp_dict; */
+       NULL,                                                   /* descrgetfunc tp_descr_get; */
+       NULL,                                                   /* descrsetfunc tp_descr_set; */
+       0,                              /* long tp_dictoffset; */
+       NULL,                           /* initproc tp_init; */
+       NULL,                                                   /* allocfunc tp_alloc; */
+       PyType_GenericNew,              /* 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
+};
+
+//-------------------MODULE INITIALIZATION--------------------------------
+PyMODINIT_FUNC Operators_Init( PyObject *module )
+{      
+       if( module == NULL )
+               return;
+
+       if( PyType_Ready( &Operators_Type ) < 0 )
+               return;
+       Py_INCREF( &Operators_Type );
+       PyModule_AddObject(module, "Operators", (PyObject *)&Operators_Type);   
+       
 }
 
+//------------------------INSTANCE METHODS ----------------------------------
 
-PyObject *Operators_sort(PyObject *self , PyObject *args) {
+void Operators___dealloc__(BPy_Operators* self)
+{
+    self->ob_type->tp_free((PyObject*)self);
 }
 
+PyObject * Operators_select(BPy_Operators* self, PyObject *args)
+{
+       PyObject *obj = 0;
 
-PyObject *Operators_create(PyObject *self , PyObject *args) {
+       if(!(   PyArg_ParseTuple(args, "O", &obj) && 
+                       BPy_UnaryPredicate1D_Check(obj) && ((BPy_UnaryPredicate1D *) obj)->up1D )) {
+               cout << "ERROR: Operators_select" << endl;
+               Py_RETURN_NONE;
+       }
+
+       Operators::select(*( ((BPy_UnaryPredicate1D *) obj)->up1D ));
+
+       Py_RETURN_NONE;
 }
 
+PyObject * Operators_chain(BPy_Operators* self, PyObject *args)
+{
+       PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0;
 
-PyObject *Operators_getViewEdgeFromIndex(PyObject *self , PyObject *args) {
+       if(!(   PyArg_ParseTuple(args, "OO|O", &obj1, &obj2, &obj3) && 
+                       BPy_ViewEdgeIterator_Check(obj1) && ((BPy_ViewEdgeIterator *) obj1)->ve_it &&
+                       BPy_UnaryPredicate1D_Check(obj2) && ((BPy_UnaryPredicate1D *) obj2)->up1D )) {
+               cout << "ERROR: Operators_chain" << endl;
+               Py_RETURN_NONE;
+       }
 
+       if( !obj3 ) {
+               
+               Operators::chain(       *( ((BPy_ViewEdgeIterator *) obj1)->ve_it ),
+                                                       *( ((BPy_UnaryPredicate1D *) obj2)->up1D )  );
+                                                       
+       } else if( BPy_UnaryFunction1DVoid_Check(obj3) && ((BPy_UnaryFunction1DVoid *) obj3)->uf1D_void ) {
+               
+               Operators::chain(       *( ((BPy_ViewEdgeIterator *) obj1)->ve_it ),
+                                                       *( ((BPy_UnaryPredicate1D *) obj2)->up1D ),
+                                                       *( ((BPy_UnaryFunction1DVoid *) obj3)->uf1D_void )  );
+               
+       }
+       
+       Py_RETURN_NONE;
 }
 
+PyObject * Operators_bidirectionalChain(BPy_Operators* self, PyObject *args)
+{
+       PyObject *obj1 = 0, *obj2 = 0;
+
+       if(!(   PyArg_ParseTuple(args, "O|O", &obj1, &obj2) && 
+                       BPy_ChainingIterator_Check(obj1) && ((BPy_ChainingIterator *) obj1)->c_it )) {
+               cout << "ERROR: Operators_bidirectionalChain" << endl;
+               Py_RETURN_NONE;
+       }
 
-PyObject *Operators_getChainFromIndex(PyObject *self , PyObject *args) {
+       if( !obj2 ) {
+
+               Operators::bidirectionalChain(  *( ((BPy_ChainingIterator *) obj1)->c_it ) );
+                                                       
+       } else if( BPy_UnaryPredicate1D_Check(obj2) && ((BPy_UnaryPredicate1D *) obj2)->up1D ) {
+               
+               Operators::bidirectionalChain(  *( ((BPy_ChainingIterator *) obj1)->c_it ),
+                                                                               *( ((BPy_UnaryPredicate1D *) obj2)->up1D )  );
+               
+       }
+       
+       Py_RETURN_NONE;
 }
 
+PyObject * Operators_sequentialSplit(BPy_Operators* self, PyObject *args)
+{
+       PyObject *obj1 = 0, *obj2 = 0;
+       float f3 = 0.0;
+
+       if(!(   PyArg_ParseTuple(args, "O|Of", &obj1, &obj2, &f3) && 
+                       BPy_UnaryPredicate0D_Check(obj1) && ((BPy_UnaryPredicate0D *) obj1)->up0D )) {
+               cout << "ERROR: Operators_sequentialSplit" << endl;
+               Py_RETURN_NONE;
+       }
 
-PyObject *Operators_getStrokeFromIndex(PyObject *self , PyObject *args) {
+       if( obj2 && BPy_UnaryPredicate0D_Check(obj2) ) {
+               
+               Operators::sequentialSplit(     *( ((BPy_UnaryPredicate0D *) obj1)->up0D ),
+                                                                               *( ((BPy_UnaryPredicate0D *) obj2)->up0D ),
+                                                                               f3 );
+                       
+       } else {
+               
+               float f = ( obj2 && PyFloat_Check(obj2) ) ? PyFloat_AsDouble(obj2) : 0.0;
+               
+               Operators::sequentialSplit( *( ((BPy_UnaryPredicate0D *) obj1)->up0D ), f );
+               
+       }
+       
+       Py_RETURN_NONE;
 }
 
+PyObject * Operators_recursiveSplit(BPy_Operators* self, PyObject *args)
+{
+       PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0;
+       float f4 = 0.0;
 
-PyObject *Operators_getViewEdgesSize(PyObject *self , PyObject *args) {
+       if(!(   PyArg_ParseTuple(args, "OO|Of", &obj1, &obj2, &obj3, &f4) && 
+                       BPy_UnaryFunction0DDouble_Check(obj1) && ((BPy_UnaryFunction0DDouble *) obj1)->uf0D_double )) {
+               cout << "ERROR: Operators_recursiveSplit" << endl;
+               Py_RETURN_NONE;
+       }
+       
+       if( BPy_UnaryPredicate1D_Check(obj2) && ((BPy_UnaryPredicate1D *) obj2)->up1D ) {
+               
+               float f = ( obj3 && PyFloat_Check(obj3) ) ? PyFloat_AsDouble(obj3) : 0.0;
+               
+               Operators::recursiveSplit(      *( ((BPy_UnaryFunction0DDouble *) obj1)->uf0D_double ),
+                                                                       *( ((BPy_UnaryPredicate1D *) obj2)->up1D ),
+                                                                       f );
+       
+       } else if(      BPy_UnaryPredicate0D_Check(obj2) && ((BPy_UnaryPredicate0D *) obj2)->up0D &&
+                               BPy_UnaryPredicate1D_Check(obj3) && ((BPy_UnaryPredicate1D *) obj3)->up1D    ) {
+               
+               Operators::recursiveSplit(      *( ((BPy_UnaryFunction0DDouble *) obj1)->uf0D_double ),
+                                                                       *( ((BPy_UnaryPredicate0D *) obj2)->up0D ),
+                                                                       *( ((BPy_UnaryPredicate1D *) obj3)->up1D ),
+                                                                       f4 );
+
+       }
+       
+       Py_RETURN_NONE;
 }
 
+PyObject * Operators_sort(BPy_Operators* self, PyObject *args)
+{
+       PyObject *obj = 0;
+
+       if(!(   PyArg_ParseTuple(args, "O", &obj) && 
+                       BPy_BinaryPredicate1D_Check(obj) && ((BPy_BinaryPredicate1D *) obj)->bp1D )) {
+               cout << "ERROR: Operators_sort" << endl;
+               Py_RETURN_NONE;
+       }
 
-PyObject *Operators_getChainsSize(PyObject *self , PyObject *args) {
+       Operators::sort(*( ((BPy_BinaryPredicate1D *) obj)->bp1D ));
+
+       Py_RETURN_NONE;
 }
 
+PyObject * Operators_create(BPy_Operators* self, PyObject *args)
+{
+       PyObject *obj1 = 0, *obj2 = 0;
+
+       if(!(   PyArg_ParseTuple(args, "OO", &obj1, &obj2) && 
+                       BPy_UnaryPredicate1D_Check(obj1) && ((BPy_UnaryPredicate1D *) obj1)->up1D &&
+                       PyList_Check(obj2) && PyList_Size(obj2) > 0   )) {
+               cout << "ERROR: Operators_create" << endl;
+               Py_RETURN_NONE;
+       }
+
+       vector<StrokeShader *> shaders;
+       for( int i = 0; i < PyList_Size(obj2); i++) {
+               PyObject *py_ss = PyList_GetItem(obj2,i);
+               if( BPy_StrokeShader_Check(py_ss) )
+                shaders.push_back( ((BPy_StrokeShader *) py_ss)->ss );
+       }
+       
+       Operators::create( *( ((BPy_UnaryPredicate1D *) obj1)->up1D ), shaders);
 
-PyObject *Operators_getStrokesSize(PyObject *self , PyObject *args) {
+       Py_RETURN_NONE;
 }
 
+///////////////////////////////////////////////////////////////////////////////////////////
 
- PyObject *delete_Operators(PyObject *self , PyObject *args) {
+#ifdef __cplusplus
 }
+#endif
 
 
diff --git a/source/blender/freestyle/intern/python/BPy_Operators.h b/source/blender/freestyle/intern/python/BPy_Operators.h
new file mode 100644 (file)
index 0000000..0af4055
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef FREESTYLE_PYTHON_OPERATORS_H
+#define FREESTYLE_PYTHON_OPERATORS_H
+
+#include "../stroke/Operators.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////
+
+#include <Python.h>
+
+extern PyTypeObject Operators_Type;
+
+#define BPy_Operators_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Operators_Type)  )
+
+/*---------------------------Python BPy_Operators structure definition----------*/
+typedef struct {
+       PyObject_HEAD
+} BPy_Operators;
+
+/*---------------------------Python BPy_Operators visible prototypes-----------*/
+
+PyMODINIT_FUNC Operators_Init( PyObject *module );
+
+
+///////////////////////////////////////////////////////////////////////////////////////////
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FREESTYLE_PYTHON_OPERATORS_H */
index 2064b6c4b642b18416dd7a2c7ec22ab721c016d3..5ca4d9abefe08d51b4db263fd12d07c69003c3ca 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject SShape_Type;
 
-#define BPy_SShape_Check(v)    (( (PyObject *) v)->ob_type == &SShape_Type)
+#define BPy_SShape_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &SShape_Type)  )
 
 /*---------------------------Python BPy_SShape structure definition----------*/
 typedef struct {
index a0828e4f668669e2cc020ec797aa3fdb557260b0..a2100c3b0f6d154dc8349856e000a3d4f68e4579 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject StrokeAttribute_Type;
 
-#define BPy_StrokeAttribute_Check(v)   (( (PyObject *) v)->ob_type == &StrokeAttribute_Type)
+#define BPy_StrokeAttribute_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &StrokeAttribute_Type)  )
 
 /*---------------------------Python BPy_StrokeAttribute structure definition----------*/
 typedef struct {
index 091eaa5038313d28cebab156af924e9c63e58643..5ee89a3587536ffceef1bea4816d14cfe7841644 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
 
 extern PyTypeObject StrokeShader_Type;
 
-#define BPy_StrokeShader_Check(v)      (( (PyObject *) v)->ob_type == &StrokeShader_Type)
+#define BPy_StrokeShader_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &StrokeShader_Type)  )
 
 /*---------------------------Python BPy_StrokeShader structure definition----------*/
 typedef struct {
index e4854c58b4597ab05240d35a878214fb1eb16700..0ab0bfbdc2e5790783571d2239bc2d6ac2f665ae 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0D_Type;
 
-#define BPy_UnaryFunction0D_Check(v)   (( (PyObject *) v)->ob_type == &UnaryFunction0D_Type)
+#define BPy_UnaryFunction0D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0D_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0D structure definition----------*/
 typedef struct {
index 21cece45fa47b4e34e2bad329078049433d67101..f33fcf48da4d5c25ee186104afb833b4a1418092 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction1D_Type;
 
-#define BPy_UnaryFunction1D_Check(v)   (( (PyObject *) v)->ob_type == &UnaryFunction1D_Type)
+#define BPy_UnaryFunction1D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction1D_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction1D structure definition----------*/
 typedef struct {
index 1f72ba5e86bb6ad286798ae742b07ae741c05281..c242a71d1a3fc8af02cb03f5b0c7ae7d33441099 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryPredicate0D_Type;
 
-#define BPy_UnaryPredicate0D_Check(v)  (( (PyObject *) v)->ob_type == &UnaryPredicate0D_Type)
+#define BPy_UnaryPredicate0D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryPredicate0D_Type)  )
 
 /*---------------------------Python BPy_UnaryPredicate0D structure definition----------*/
 typedef struct {
index 509d81f6937562e949eff11185f6e3aacfced7f8..ac5451d3b0ed6d082faca583ec7e7ce7915004a3 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryPredicate1D_Type;
 
-#define BPy_UnaryPredicate1D_Check(v)  (( (PyObject *) v)->ob_type == &UnaryPredicate1D_Type)
+#define BPy_UnaryPredicate1D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryPredicate1D_Type)  )
 
 /*---------------------------Python BPy_UnaryPredicate1D structure definition----------*/
 typedef struct {
index 841b5d46f07259a81fee5c51986e3655dd6e0856..f76f09a4c756e60ddd7f3c67928a621692aec4b4 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ViewMap_Type;
 
-#define BPy_ViewMap_Check(v)   (( (PyObject *) v)->ob_type == &ViewMap_Type)
+#define BPy_ViewMap_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ViewMap_Type)  )
 
 /*---------------------------Python BPy_ViewMap structure definition----------*/
 typedef struct {
index 20490cd71aab59289029eddc5a40c96cd9499dd3..a7d01c098d2a9d99135ba5e8e95ad1f43feb2196 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ViewShape_Type;
 
-#define BPy_ViewShape_Check(v) (( (PyObject *) v)->ob_type == &ViewShape_Type)
+#define BPy_ViewShape_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ViewShape_Type)  )
 
 /*---------------------------Python BPy_ViewShape structure definition----------*/
 typedef struct {
index 7e090fc92d3f39757a5cb08dfadc4e3fd5b2a396..a8d4aad88aa29020bac16ee7d19c26d627ca724f 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject FalseBP1D_Type;
 
-#define BPy_FalseBP1D_Check(v) (( (PyObject *) v)->ob_type == &FalseBP1D_Type)
+#define BPy_FalseBP1D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &FalseBP1D_Type)  )
 
 /*---------------------------Python BPy_FalseBP1D structure definition----------*/
 typedef struct {
index e499067d05e695e40ca68f0ddf7ddb39cb745d5c..d5bce5b150d94202193c877a2442e2d46446162a 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Length2DBP1D_Type;
 
-#define BPy_Length2DBP1D_Check(v)      (( (PyObject *) v)->ob_type == &Length2DBP1D_Type)
+#define BPy_Length2DBP1D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Length2DBP1D_Type)  )
 
 /*---------------------------Python BPy_Length2DBP1D structure definition----------*/
 typedef struct {
index 31e47040bcb95b78ae94a133381e4f018adebd66..71065d4ceeb65fe7db8e1630716393ada1aacb6c 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject SameShapeIdBP1D_Type;
 
-#define BPy_SameShapeIdBP1D_Check(v)   (( (PyObject *) v)->ob_type == &SameShapeIdBP1D_Type)
+#define BPy_SameShapeIdBP1D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &SameShapeIdBP1D_Type)  )
 
 /*---------------------------Python BPy_SameShapeIdBP1D structure definition----------*/
 typedef struct {
index a975fe0b662cf78be919053cf16ade340d437478..7d809e1fe65b7c3764e16eda229c0cf408a97218 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject TrueBP1D_Type;
 
-#define BPy_TrueBP1D_Check(v)  (( (PyObject *) v)->ob_type == &TrueBP1D_Type)
+#define BPy_TrueBP1D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &TrueBP1D_Type)  )
 
 /*---------------------------Python BPy_TrueBP1D structure definition----------*/
 typedef struct {
index 16fe71dee07d2849d4f219620528105a3d5cb0a4..23d27e118a9f04231415952e2c53651e45ec70b8 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ViewMapGradientNormBP1D_Type;
 
-#define BPy_ViewMapGradientNormBP1D_Check(v)   (( (PyObject *) v)->ob_type == &ViewMapGradientNormBP1D_Type)
+#define BPy_ViewMapGradientNormBP1D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ViewMapGradientNormBP1D_Type)  )
 
 /*---------------------------Python BPy_ViewMapGradientNormBP1D structure definition----------*/
 typedef struct {
index c2a8023b7454fc0320266e7c34bd404af4375a0a..b4c22645503a09227c3cd604613732d1c279f135 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject CurvePoint_Type;
 
-#define BPy_CurvePoint_Check(v)        (( (PyObject *) v)->ob_type == &CurvePoint_Type)
+#define BPy_CurvePoint_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &CurvePoint_Type)  )
 
 /*---------------------------Python BPy_CurvePoint structure definition----------*/
 typedef struct {
index 95b7d833d65fb220078515870bc91930bc05d5df..7d310f2b7dcc22c75b9cd9f6954b9e06f754f491 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject SVertex_Type;
 
-#define BPy_SVertex_Check(v)   (( (PyObject *) v)->ob_type == &SVertex_Type)
+#define BPy_SVertex_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &SVertex_Type)  )
 
 /*---------------------------Python BPy_SVertex structure definition----------*/
 typedef struct {
index 592a46186c24c49a6945a75b1ef7691f1403a79d..26c06b50d714d8aa0358b8b0f0376449d070d9dd 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject ViewVertex_Type;
 
-#define BPy_ViewVertex_Check(v)        (( (PyObject *) v)->ob_type == &ViewVertex_Type)
+#define BPy_ViewVertex_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ViewVertex_Type)  )
 
 /*---------------------------Python BPy_ViewVertex structure definition----------*/
 typedef struct {
index f1c54ed00416f82f910b12ce767a84dbe26532a0..2a84e2480f0dc79a11ac4bfa0bfa2250aabe05d7 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject StrokeVertex_Type;
 
-#define BPy_StrokeVertex_Check(v)      (( (PyObject *) v)->ob_type == &StrokeVertex_Type)
+#define BPy_StrokeVertex_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &StrokeVertex_Type)  )
 
 /*---------------------------Python BPy_StrokeVertex structure definition----------*/
 typedef struct {
index 13b520d81db74458aa3181e47846feff8f33947a..071194d2d42e34df19a6773ed6fa01971cf0a4e7 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject NonTVertex_Type;
 
-#define BPy_NonTVertex_Check(v)        (( (PyObject *) v)->ob_type == &NonTVertex_Type)
+#define BPy_NonTVertex_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &NonTVertex_Type)  )
 
 /*---------------------------Python BPy_NonTVertex structure definition----------*/
 typedef struct {
index a4f564446ef3ade694722fc05b971a1801a42c11..12fe5c0cb433db9839062d70ce110b737942fb29 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject TVertex_Type;
 
-#define BPy_TVertex_Check(v)   (( (PyObject *) v)->ob_type == &TVertex_Type)
+#define BPy_TVertex_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &TVertex_Type)  )
 
 /*---------------------------Python BPy_TVertex structure definition----------*/
 typedef struct {
index fd19612261adbace39e7a9a18c06f92e1d26de9a..fd29a7bf4f18748631491c21c4412a7576ba4860 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject Curve_Type;
 
-#define BPy_Curve_Check(v)     (( (PyObject *) v)->ob_type == &Curve_Type)
+#define BPy_Curve_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Curve_Type)  )
 
 /*---------------------------Python BPy_Curve structure definition----------*/
 typedef struct {
index c54dbee98b7322499eb441f701a00fe59affde1b..9d13145aaf2419a6628fcdeaa06f499e20fb72d5 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject FEdge_Type;
 
-#define BPy_FEdge_Check(v)     (( (PyObject *) v)->ob_type == &FEdge_Type)
+#define BPy_FEdge_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &FEdge_Type)  )
 
 /*---------------------------Python BPy_FEdge structure definition----------*/
 typedef struct {
index a7e7455b764a4a56016ba8c1bbb5cbb53342c071..ead377377e885079c939c3913b3337d1eb06820b 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject ViewEdge_Type;
 
-#define BPy_ViewEdge_Check(v)  (( (PyObject *) v)->ob_type == &ViewEdge_Type)
+#define BPy_ViewEdge_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ViewEdge_Type)  )
 
 /*---------------------------Python BPy_ViewEdge structure definition----------*/
 typedef struct {
index eaf80033098cfb449b6bf2c86bfdee19cd4d7fb6..ade70c47f25d1f83d2e006d1ed5d2b2db03ac480 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject Chain_Type;
 
-#define BPy_Chain_Check(v)     (( (PyObject *) v)->ob_type == &Chain_Type)
+#define BPy_Chain_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Chain_Type)  )
 
 /*---------------------------Python BPy_Chain structure definition----------*/
 typedef struct {
index d08ef0069414b1b21b393a5f1b7e8529c6cef897..84b01e27c21aef396493f5af4b1e936e2bdb0492 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject FEdgeSharp_Type;
 
-#define BPy_FEdgeSharp_Check(v)        (( (PyObject *) v)->ob_type == &FEdgeSharp_Type)
+#define BPy_FEdgeSharp_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &FEdgeSharp_Type)  )
 
 /*---------------------------Python BPy_FEdgeSharp structure definition----------*/
 typedef struct {
index 6b26f65d81c2a94c491f2b721f282344362105a4..d7b44bb1da74e77da5bd55159c31be3754b7194f 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 extern PyTypeObject FEdgeSmooth_Type;
 
-#define BPy_FEdgeSmooth_Check(v)       (( (PyObject *) v)->ob_type == &FEdgeSmooth_Type)
+#define BPy_FEdgeSmooth_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &FEdgeSmooth_Type)  )
 
 /*---------------------------Python BPy_FEdgeSmooth structure definition----------*/
 typedef struct {
index e40f129d3d8ea44795c468fe272a780de59fcb34..13c8382c3a2a05c0615e5f09487485e6a2bbd149 100644 (file)
@@ -12,8 +12,11 @@ extern "C" {
 /*---------------  Python API function prototypes for AdjacencyIterator instance  -----------*/
 static int AdjacencyIterator___init__(BPy_AdjacencyIterator *self, PyObject *args);
 
+static PyObject * AdjacencyIterator_getObject(BPy_AdjacencyIterator *self);
+
 /*----------------------AdjacencyIterator instance definitions ----------------------------*/
 static PyMethodDef BPy_AdjacencyIterator_methods[] = {
+       {"getObject", ( PyCFunction ) AdjacencyIterator_getObject, METH_NOARGS, "() Get object referenced by the iterator"},
        {NULL, NULL, 0, NULL}
 };
 
@@ -135,6 +138,16 @@ int AdjacencyIterator___init__(BPy_AdjacencyIterator *self, PyObject *args )
 
 }
 
+PyObject * AdjacencyIterator_getObject(BPy_AdjacencyIterator *self) {
+       
+       ViewEdge *ve = self->a_it->operator*();
+       if( ve )
+               return BPy_ViewEdge_from_ViewEdge( *ve );
+
+       Py_RETURN_NONE;
+}
+
+
 ///////////////////////////////////////////////////////////////////////////////////////////
 
 #ifdef __cplusplus
index de0178f7725dd956a5d18cc30241f88602e35dc0..733a9f2fcab5bfebc646761e6911aab15d99e2ed 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject AdjacencyIterator_Type;
 
-#define BPy_AdjacencyIterator_Check(v) (( (PyObject *) v)->ob_type == &AdjacencyIterator_Type)
+#define BPy_AdjacencyIterator_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &AdjacencyIterator_Type)  )
 
 /*---------------------------Python BPy_AdjacencyIterator structure definition----------*/
 typedef struct {
index c5d32fb01f3f6ce42629e4328d8e40d692529f08..39a794b27f73aea6bd5573ce0342afd54ea8845d 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject ChainPredicateIterator_Type;
 
-#define BPy_ChainPredicateIterator_Check(v)    (( (PyObject *) v)->ob_type == &ChainPredicateIterator_Type)
+#define BPy_ChainPredicateIterator_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ChainPredicateIterator_Type)  )
 
 /*---------------------------Python BPy_ChainPredicateIterator structure definition----------*/
 typedef struct {
index 7e6feb00910e2b2ec3be979c3f115c5737d3ff86..912d397d279ae094e5aded742b1168e68c5b2ef9 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject ChainSilhouetteIterator_Type;
 
-#define BPy_ChainSilhouetteIterator_Check(v)   (( (PyObject *) v)->ob_type == &ChainSilhouetteIterator_Type)
+#define BPy_ChainSilhouetteIterator_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ChainSilhouetteIterator_Type)  )
 
 /*---------------------------Python BPy_ChainSilhouetteIterator structure definition----------*/
 typedef struct {
index c695e92ec70f54405a0d1fe2eeff6df83398a452..525b0697fa7b005291a3c520f8b885871087a046 100644 (file)
@@ -18,12 +18,15 @@ static PyObject * ChainingIterator_traverse( BPy_ChainingIterator *self, PyObjec
 static PyObject * ChainingIterator_getVertex( BPy_ChainingIterator *self );
 static PyObject * ChainingIterator_isIncrementing( BPy_ChainingIterator *self );
 
+static PyObject * ChainingIterator_getObject( BPy_ChainingIterator *self);
+
 /*----------------------ChainingIterator instance definitions ----------------------------*/
 static PyMethodDef BPy_ChainingIterator_methods[] = {
        {"init", ( PyCFunction ) ChainingIterator_init, METH_NOARGS, "() Inits the iterator context. This method is called each time a new chain is started. It can be used to reset some history information that you might want to keep."},
        {"traverse", ( PyCFunction ) ChainingIterator_traverse, METH_VARARGS, "(AdjacencyIterator ai) This method iterates over the potential next ViewEdges and returns the one that will be followed next. Returns the next ViewEdge to follow or 0 when the end of the chain is reached. "},
        {"getVertex", ( PyCFunction ) ChainingIterator_getVertex, METH_NOARGS, "() Returns the vertex which is the next crossing "},
        {"isIncrementing", ( PyCFunction ) ChainingIterator_isIncrementing, METH_NOARGS, "() Returns true if the current iteration is an incrementation."},
+       {"getObject", ( PyCFunction ) ChainingIterator_getObject, METH_NOARGS, "() Get object referenced by the iterator"},
        {NULL, NULL, 0, NULL}
 };
 
@@ -171,7 +174,14 @@ PyObject *ChainingIterator_isIncrementing( BPy_ChainingIterator *self ) {
        return PyBool_from_bool( self->c_it->isIncrementing() );
 }
 
+PyObject * ChainingIterator_getObject( BPy_ChainingIterator *self) {
+       
+       ViewEdge *ve = self->c_it->operator*();
+       if( ve )
+               return BPy_ViewEdge_from_ViewEdge( *ve );
 
+       Py_RETURN_NONE;
+}
 
 
 
index 2994f381c1d0554bd0d9f0e7c16a2debe30e2ee3..2a00aa8072f627b4305dc26b16c3fe5f81b66a26 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject ChainingIterator_Type;
 
-#define BPy_ChainingIterator_Check(v)  (( (PyObject *) v)->ob_type == &ChainingIterator_Type)
+#define BPy_ChainingIterator_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ChainingIterator_Type)  )
 
 /*---------------------------Python BPy_ChainingIterator structure definition----------*/
 typedef struct {
index 1f83026173918fffed4df7348966e74bf334dd08..c02bd0a00fc8fae2d099d53979f86fb17224d31f 100644 (file)
@@ -1,5 +1,6 @@
 #include "BPy_CurvePointIterator.h"
 
+#include "../BPy_Convert.h"
 #include "BPy_Interface0DIterator.h"
 
 #ifdef __cplusplus
@@ -14,12 +15,14 @@ static PyObject * CurvePointIterator_t( BPy_CurvePointIterator *self );
 static PyObject * CurvePointIterator_u( BPy_CurvePointIterator *self );
 static PyObject * CurvePointIterator_castToInterface0DIterator( BPy_CurvePointIterator *self );
 
+static PyObject * CurvePointIterator_getObject(BPy_CurvePointIterator *self);
 
 /*----------------------CurvePointIterator instance definitions ----------------------------*/
 static PyMethodDef BPy_CurvePointIterator_methods[] = {
        {"t", ( PyCFunction ) CurvePointIterator_t, METH_NOARGS, "( )Returns the curvilinear abscissa."},
        {"u", ( PyCFunction ) CurvePointIterator_u, METH_NOARGS, "( )Returns the point parameter in the curve 0<=u<=1."},
        {"castToInterface0DIterator", ( PyCFunction ) CurvePointIterator_castToInterface0DIterator, METH_NOARGS, "() Casts this CurvePointIterator into an Interface0DIterator. Useful for any call to a function of the type UnaryFunction0D."},
+       {"getObject", ( PyCFunction ) CurvePointIterator_getObject, METH_NOARGS, "() Get object referenced by the iterator"},
        {NULL, NULL, 0, NULL}
 };
 
@@ -153,6 +156,10 @@ PyObject * CurvePointIterator_castToInterface0DIterator( BPy_CurvePointIterator
        return py_if0D_it;
 }
 
+PyObject * CurvePointIterator_getObject(BPy_CurvePointIterator *self) {
+       return BPy_CurvePoint_from_CurvePoint( self->cp_it->operator*() );
+}
+
 
 ///////////////////////////////////////////////////////////////////////////////////////////
 
index e8f082216de7a82a7a0b343bf876e6cb7801baf4..ad04c7208bb573df8687bbe21844b9989b26377f 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject CurvePointIterator_Type;
 
-#define BPy_CurvePointIterator_Check(v)        (( (PyObject *) v)->ob_type == &CurvePointIterator_Type)
+#define BPy_CurvePointIterator_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &CurvePointIterator_Type)  )
 
 /*---------------------------Python BPy_CurvePointIterator structure definition----------*/
 typedef struct {
index c88ba7773ab6fe150addd3813c6a34159797032b..92c3a7dfc38271c0fead64feaf46827b23b906cc 100644 (file)
@@ -1,5 +1,7 @@
 #include "BPy_Interface0DIterator.h"
 
+#include "../BPy_Convert.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -12,10 +14,13 @@ static int Interface0DIterator___init__(BPy_Interface0DIterator *self, PyObject
 static PyObject * Interface0DIterator_t( BPy_Interface0DIterator *self );
 static PyObject * Interface0DIterator_u( BPy_Interface0DIterator *self );
 
+static PyObject * Interface0DIterator_getObject(BPy_Interface0DIterator *self);
+
 /*----------------------Interface0DIterator instance definitions ----------------------------*/
 static PyMethodDef BPy_Interface0DIterator_methods[] = {
        {"t", ( PyCFunction ) Interface0DIterator_t, METH_NOARGS, "( )Returns the curvilinear abscissa."},
        {"u", ( PyCFunction ) Interface0DIterator_u, METH_NOARGS, "( )Returns the point parameter in the curve 0<=u<=1."},
+       {"getObject", ( PyCFunction ) Interface0DIterator_getObject, METH_NOARGS, "() Get object referenced by the iterator"},
        {NULL, NULL, 0, NULL}
 };
 
@@ -130,6 +135,11 @@ PyObject * Interface0DIterator_u( BPy_Interface0DIterator *self ) {
        return PyFloat_FromDouble( self->if0D_it->u() );
 }
 
+PyObject * Interface0DIterator_getObject(BPy_Interface0DIterator *self) {
+       return BPy_Interface0D_from_Interface0D( self->if0D_it->operator*() );
+}
+
+
 ///////////////////////////////////////////////////////////////////////////////////////////
 
 #ifdef __cplusplus
index 16edb2c3d68c7f0815b4fdd68cf0d3982341a38b..c829d3d9d31bbfb9573ca909828757211ac104b4 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject Interface0DIterator_Type;
 
-#define BPy_Interface0DIterator_Check(v)       (( (PyObject *) v)->ob_type == &Interface0DIterator_Type)
+#define BPy_Interface0DIterator_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Interface0DIterator_Type)  )
 
 /*---------------------------Python BPy_Interface0DIterator structure definition----------*/
 typedef struct {
index 649447f1db67e5de101dcce33c0718488b08499e..383480b8a9dd903b840f93860e0e86aa5440724f 100644 (file)
@@ -1,5 +1,6 @@
 #include "BPy_SVertexIterator.h"
 
+#include "../BPy_Convert.h"
 #include "../Interface0D/BPy_SVertex.h"
 #include "../Interface1D/BPy_FEdge.h"
 
@@ -15,10 +16,13 @@ static int SVertexIterator___init__(BPy_SVertexIterator *self, PyObject *args);
 static PyObject * SVertexIterator_t( BPy_SVertexIterator *self );
 static PyObject * SVertexIterator_u( BPy_SVertexIterator *self );
 
+static PyObject * SVertexIterator_getObject( BPy_SVertexIterator *self);
+
 /*----------------------SVertexIterator instance definitions ----------------------------*/
 static PyMethodDef BPy_SVertexIterator_methods[] = {
        {"t", ( PyCFunction ) SVertexIterator_t, METH_NOARGS, "( )Returns the curvilinear abscissa."},
        {"u", ( PyCFunction ) SVertexIterator_u, METH_NOARGS, "( )Returns the point parameter in the curve 0<=u<=1."},
+       {"getObject", ( PyCFunction ) SVertexIterator_getObject, METH_NOARGS, "() Get object referenced by the iterator"},
        {NULL, NULL, 0, NULL}
 };
 
@@ -155,6 +159,11 @@ PyObject * SVertexIterator_u( BPy_SVertexIterator *self ) {
        return PyFloat_FromDouble( self->sv_it->u() );
 }
 
+PyObject * SVertexIterator_getObject( BPy_SVertexIterator *self) {
+       return BPy_SVertex_from_SVertex( self->sv_it->operator*() );
+}
+
+
 ///////////////////////////////////////////////////////////////////////////////////////////
 
 #ifdef __cplusplus
index ba6fbf020d03d35331e96ce26e5357fce91ddf86..b40f4d3642069150b9a4d5d1bcf74601cb919b1a 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject SVertexIterator_Type;
 
-#define BPy_SVertexIterator_Check(v)   (( (PyObject *) v)->ob_type == &SVertexIterator_Type)
+#define BPy_SVertexIterator_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &SVertexIterator_Type)  )
 
 /*---------------------------Python BPy_SVertexIterator structure definition----------*/
 typedef struct {
index 1f04be635c55e41453fd897b4f4c6b2fc308aa1d..0b1554a1cb7e3207f06c922dc39358aa7f7f2427 100644 (file)
@@ -1,5 +1,6 @@
 #include "BPy_StrokeVertexIterator.h"
 
+#include "../BPy_Convert.h"
 #include "BPy_Interface0DIterator.h"
 
 #ifdef __cplusplus
@@ -14,11 +15,15 @@ static PyObject * StrokeVertexIterator_t( BPy_StrokeVertexIterator *self );
 static PyObject * StrokeVertexIterator_u( BPy_StrokeVertexIterator *self );
 static PyObject * StrokeVertexIterator_castToInterface0DIterator( BPy_StrokeVertexIterator *self );
 
+static PyObject * StrokeVertexIterator_getObject( BPy_StrokeVertexIterator *self);
+
+
 /*----------------------StrokeVertexIterator instance definitions ----------------------------*/
 static PyMethodDef BPy_StrokeVertexIterator_methods[] = {
        {"t", ( PyCFunction ) StrokeVertexIterator_t, METH_NOARGS, "( )Returns the curvilinear abscissa."},
        {"u", ( PyCFunction ) StrokeVertexIterator_u, METH_NOARGS, "( )Returns the point parameter in the curve 0<=u<=1."},
        {"castToInterface0DIterator", ( PyCFunction ) StrokeVertexIterator_castToInterface0DIterator, METH_NOARGS, "() Casts this StrokeVertexIterator into an Interface0DIterator. Useful for any call to a function of the type UnaryFunction0D."},
+       {"getObject", ( PyCFunction ) StrokeVertexIterator_getObject, METH_NOARGS, "() Get object referenced by the iterator"},
        {NULL, NULL, 0, NULL}
 };
 
@@ -149,6 +154,10 @@ PyObject * StrokeVertexIterator_castToInterface0DIterator( BPy_StrokeVertexItera
        return py_if0D_it;
 }
 
+PyObject * StrokeVertexIterator_getObject( BPy_StrokeVertexIterator *self) {
+       return BPy_StrokeVertex_from_StrokeVertex( self->sv_it->operator*() );
+}
+
 
 ///////////////////////////////////////////////////////////////////////////////////////////
 
index 488a1efea3d0a7cc2bcfe082d6e6d9f8e155dfa9..9e95fc0a401ddaa26a9b31fd6b0df35d1c53cdb1 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject StrokeVertexIterator_Type;
 
-#define BPy_StrokeVertexIterator_Check(v)      (( (PyObject *) v)->ob_type == &StrokeVertexIterator_Type)
+#define BPy_StrokeVertexIterator_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &StrokeVertexIterator_Type)  )
 
 /*---------------------------Python BPy_StrokeVertexIterator structure definition----------*/
 typedef struct {
index add10cd1522cbaaac80d3b43b6103cb0d4e00fab..1f3e3c05d9175df467243a7e3da66a7adb4d2130 100644 (file)
@@ -21,6 +21,9 @@ static PyObject * ViewEdgeIterator_getOrientation( BPy_ViewEdgeIterator *self );
 static PyObject * ViewEdgeIterator_setOrientation( BPy_ViewEdgeIterator *self, PyObject *args );
 static PyObject * ViewEdgeIterator_changeOrientation( BPy_ViewEdgeIterator *self );
 
+static PyObject * ViewEdgeIterator_getObject(BPy_ViewEdgeIterator *self);
+
+
 /*----------------------ViewEdgeIterator instance definitions ----------------------------*/
 static PyMethodDef BPy_ViewEdgeIterator_methods[] = {
        {"getCurrentEdge", ( PyCFunction ) ViewEdgeIterator_getCurrentEdge, METH_NOARGS, "() Returns the current pointed ViewEdge."},
@@ -30,6 +33,7 @@ static PyMethodDef BPy_ViewEdgeIterator_methods[] = {
        {"getOrientation", ( PyCFunction ) ViewEdgeIterator_getOrientation, METH_NOARGS, "() Gets the orientation of the pointed ViewEdge in the iteration. "},
        {"setOrientation", ( PyCFunction ) ViewEdgeIterator_setOrientation, METH_VARARGS, "(bool b) Sets the orientation of the pointed ViewEdge in the iteration. "},
        {"changeOrientation", ( PyCFunction ) ViewEdgeIterator_changeOrientation, METH_NOARGS, "() Changes the current orientation."},
+       {"getObject", ( PyCFunction ) ViewEdgeIterator_getObject, METH_NOARGS, "() Get object referenced by the iterator"},
        {NULL, NULL, 0, NULL}
 };
 
@@ -208,6 +212,14 @@ PyObject *ViewEdgeIterator_changeOrientation( BPy_ViewEdgeIterator *self ) {
        Py_RETURN_NONE;
 }
 
+PyObject * ViewEdgeIterator_getObject( BPy_ViewEdgeIterator *self) {
+
+       ViewEdge *ve = self->ve_it->operator*();
+       if( ve )
+               return BPy_ViewEdge_from_ViewEdge( *ve );
+
+       Py_RETURN_NONE;
+}
 
 
 ///////////////////////////////////////////////////////////////////////////////////////////
index a86547c59375aa38627b2717ac81c228edd50ef9..dce90efc8cfa42493a53703a7ced6ab8b25b10ce 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject ViewEdgeIterator_Type;
 
-#define BPy_ViewEdgeIterator_Check(v)  (( (PyObject *) v)->ob_type == &ViewEdgeIterator_Type)
+#define BPy_ViewEdgeIterator_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ViewEdgeIterator_Type)  )
 
 /*---------------------------Python BPy_ViewEdgeIterator structure definition----------*/
 typedef struct {
index ec6850c3b96070d132e5afd823ea2424893b24ac..0937e04e3a7e86b6529867df246648ff25b6af90 100644 (file)
@@ -1,5 +1,7 @@
 #include "BPy_orientedViewEdgeIterator.h"
 
+#include "../BPy_Convert.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -9,8 +11,12 @@ extern "C" {
 /*---------------  Python API function prototypes for orientedViewEdgeIterator instance  -----------*/
 static int orientedViewEdgeIterator___init__(BPy_orientedViewEdgeIterator *self, PyObject *args);
 
+static PyObject * orientedViewEdgeIterator_getObject(BPy_orientedViewEdgeIterator *self);
+
+
 /*----------------------orientedViewEdgeIterator instance definitions ----------------------------*/
 static PyMethodDef BPy_orientedViewEdgeIterator_methods[] = {
+       {"getObject", ( PyCFunction ) orientedViewEdgeIterator_getObject, METH_NOARGS, "() Get object referenced by the iterator"},
        {NULL, NULL, 0, NULL}
 };
 
@@ -99,9 +105,6 @@ PyTypeObject orientedViewEdgeIterator_Type = {
        NULL
 };
 
-//-------------------MODULE INITIALIZATION--------------------------------
-
-
 //------------------------INSTANCE METHODS ----------------------------------
 
 int orientedViewEdgeIterator___init__(BPy_orientedViewEdgeIterator *self, PyObject *args )
@@ -121,6 +124,10 @@ int orientedViewEdgeIterator___init__(BPy_orientedViewEdgeIterator *self, PyObje
        return 0;
 }
 
+PyObject * orientedViewEdgeIterator_getObject( BPy_orientedViewEdgeIterator *self) {
+       return BPy_directedViewEdge_from_directedViewEdge( self->ove_it->operator*() );
+}
+
 ///////////////////////////////////////////////////////////////////////////////////////////
 
 #ifdef __cplusplus
index 1c8a25258b77c4b75493c9c7ca3bd4658ac0407c..973d0f2b7280fcae8f47a17f1ce094533c1b09a0 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject orientedViewEdgeIterator_Type;
 
-#define BPy_orientedViewEdgeIterator_Check(v)  (( (PyObject *) v)->ob_type == &orientedViewEdgeIterator_Type)
+#define BPy_orientedViewEdgeIterator_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &orientedViewEdgeIterator_Type)  )
 
 /*---------------------------Python BPy_orientedViewEdgeIterator structure definition----------*/
 typedef struct {
index 161bdb5db40d3afd2cad461ab822bfb32286d140..35a74c0bda2326a8696b8186eaa9a83d0b86959f 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject BackboneStretcherShader_Type;
 
-#define BPy_BackboneStretcherShader_Check(v)   (( (PyObject *) v)->ob_type == &BackboneStretcherShader_Type)
+#define BPy_BackboneStretcherShader_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &BackboneStretcherShader_Type)  )
 
 /*---------------------------Python BPy_BackboneStretcherShader structure definition----------*/
 typedef struct {
index 56443ca26add82508c64f192b49867bfe69a8dd4..b94ef88aceae7bb2e9545c8e75df7e473e07a1f0 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject BezierCurveShader_Type;
 
-#define BPy_BezierCurveShader_Check(v) (( (PyObject *) v)->ob_type == &BezierCurveShader_Type)
+#define BPy_BezierCurveShader_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &BezierCurveShader_Type)  )
 
 /*---------------------------Python BPy_BezierCurveShader structure definition----------*/
 typedef struct {
index d3a4782c7946f93babb7a25f710b93a747742ea4..c573b0184addf00e40f2c1c212668a26d8ccd411 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject CalligraphicShader_Type;
 
-#define BPy_CalligraphicShader_Check(v)        (( (PyObject *) v)->ob_type == &CalligraphicShader_Type)
+#define BPy_CalligraphicShader_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &CalligraphicShader_Type)
 
 /*---------------------------Python BPy_CalligraphicShader structure definition----------*/
 typedef struct {
index e4ad2c0e1af066285d1dabb6478702f1f4731d58..694b847565e17b03026ad882578e099fa4f9d2b8 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ColorNoiseShader_Type;
 
-#define BPy_ColorNoiseShader_Check(v)  (( (PyObject *) v)->ob_type == &ColorNoiseShader_Type)
+#define BPy_ColorNoiseShader_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ColorNoiseShader_Type)  )
 
 /*---------------------------Python BPy_ColorNoiseShader structure definition----------*/
 typedef struct {
index 12f7bbca1518d0f95f2a7833ae6ec8c730569546..b1898ebfecfa3b4262537fcc0f757c56d12b3e89 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ColorVariationPatternShader_Type;
 
-#define BPy_ColorVariationPatternShader_Check(v)       (( (PyObject *) v)->ob_type == &ColorVariationPatternShader_Type)
+#define BPy_ColorVariationPatternShader_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ColorVariationPatternShader_Type)  )
 
 /*---------------------------Python BPy_ColorVariationPatternShader structure definition----------*/
 typedef struct {
index 0f3ae177d152ae6dcb014162a1234efb3fd9e296..30a09d852fd173902a159c846ab2d8acecf26703 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ConstantColorShader_Type;
 
-#define BPy_ConstantColorShader_Check(v)       (( (PyObject *) v)->ob_type == &ConstantColorShader_Type)
+#define BPy_ConstantColorShader_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ConstantColorShader_Type)  )
 
 /*---------------------------Python BPy_ConstantColorShader structure definition----------*/
 typedef struct {
index d8cb7239fd9420bbc35c28142bc869e5ccfc074b..bb7f3c0f6224d757c085960893cc15e035467b4b 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ConstantThicknessShader_Type;
 
-#define BPy_ConstantThicknessShader_Check(v)   (( (PyObject *) v)->ob_type == &ConstantThicknessShader_Type)
+#define BPy_ConstantThicknessShader_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ConstantThicknessShader_Type)  )
 
 /*---------------------------Python BPy_ConstantThicknessShader structure definition----------*/
 typedef struct {
index f712706d2ee5f25e4f4cd3ae1071ec012aeb7ced..38a8aa2bfe04ce4aaa8e9f7df4bece7d110c3c7b 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ConstrainedIncreasingThicknessShader_Type;
 
-#define BPy_ConstrainedIncreasingThicknessShader_Check(v)      (( (PyObject *) v)->ob_type == &ConstrainedIncreasingThicknessShader_Type)
+#define BPy_ConstrainedIncreasingThicknessShader_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ConstrainedIncreasingThicknessShader_Type)  )
 
 /*---------------------------Python BPy_ConstrainedIncreasingThicknessShader structure definition----------*/
 typedef struct {
index 2cf032e24ae145fa380944a05cf610a8696888df..e25704c33ba7197d6995f503f98d2779365c8538 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GuidingLinesShader_Type;
 
-#define BPy_GuidingLinesShader_Check(v)        (( (PyObject *) v)->ob_type == &GuidingLinesShader_Type)
+#define BPy_GuidingLinesShader_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GuidingLinesShader_Type)  )
 
 /*---------------------------Python BPy_GuidingLinesShader structure definition----------*/
 typedef struct {
index 4ef7f3f239d5a456d1fa7c711ba455e5dc61079a..9bc82e980985f78b3b95b7efe465479f8527a094 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject IncreasingColorShader_Type;
 
-#define BPy_IncreasingColorShader_Check(v)     (( (PyObject *) v)->ob_type == &IncreasingColorShader_Type)
+#define BPy_IncreasingColorShader_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &IncreasingColorShader_Type)  )
 
 /*---------------------------Python BPy_IncreasingColorShader structure definition----------*/
 typedef struct {
index ae4f37835ccfacdd45786c156f027d79d3c4a222..33d883b18607931cbe5761bd935eb341ad58e458 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject IncreasingThicknessShader_Type;
 
-#define BPy_IncreasingThicknessShader_Check(v) (( (PyObject *) v)->ob_type == &IncreasingThicknessShader_Type)
+#define BPy_IncreasingThicknessShader_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &IncreasingThicknessShader_Type)  )
 
 /*---------------------------Python BPy_IncreasingThicknessShader structure definition----------*/
 typedef struct {
index 7cc2e94e2cc306a4ed237e562f20c31a575fce0a..85bcc00e86966e0e3b10e19cc14c44ffec12ea97 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject PolygonalizationShader_Type;
 
-#define BPy_PolygonalizationShader_Check(v)    (( (PyObject *) v)->ob_type == &PolygonalizationShader_Type)
+#define BPy_PolygonalizationShader_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &PolygonalizationShader_Type)  )
 
 /*---------------------------Python BPy_PolygonalizationShader structure definition----------*/
 typedef struct {
index 763bee2316815200234a49ea8c5ba7f374c33c4f..dfc6efb33190bde93bd0525b040031ff51e862cd 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject SamplingShader_Type;
 
-#define BPy_SamplingShader_Check(v)    (( (PyObject *) v)->ob_type == &SamplingShader_Type)
+#define BPy_SamplingShader_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &SamplingShader_Type)  )
 
 /*---------------------------Python BPy_SamplingShader structure definition----------*/
 typedef struct {
index ac23250288174f3656131c8009cb37d1c1f0111f..46e1c12385d577bde4da9afae993ee4318c5d64b 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject SpatialNoiseShader_Type;
 
-#define BPy_SpatialNoiseShader_Check(v)        (( (PyObject *) v)->ob_type == &SpatialNoiseShader_Type)
+#define BPy_SpatialNoiseShader_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &SpatialNoiseShader_Type)  )
 
 /*---------------------------Python BPy_SpatialNoiseShader structure definition----------*/
 typedef struct {
index d60ba3080ab78eb125a757bcfabf2ac1ee3f3736..c65506f2f147e67d0651582c6e7ef5b6695470b8 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject StrokeTextureShader_Type;
 
-#define BPy_StrokeTextureShader_Check(v)       (( (PyObject *) v)->ob_type == &StrokeTextureShader_Type)
+#define BPy_StrokeTextureShader_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &StrokeTextureShader_Type)  )
 
 /*---------------------------Python BPy_StrokeTextureShader structure definition----------*/
 typedef struct {
index 658f3f4ec8d05fd6d1eec6aa4b48e98ef892f2c1..9cffc1c1662619621fa26afe09b052452d671dda 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject TextureAssignerShader_Type;
 
-#define BPy_TextureAssignerShader_Check(v)     (( (PyObject *) v)->ob_type == &TextureAssignerShader_Type)
+#define BPy_TextureAssignerShader_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &TextureAssignerShader_Type)  )
 
 /*---------------------------Python BPy_TextureAssignerShader structure definition----------*/
 typedef struct {
index 8a0437715f45cb8700f6dda3e32bd3d76cf0b9eb..c3ef101683e7b5a6bcdd925d968bad955f4fe231 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ThicknessNoiseShader_Type;
 
-#define BPy_ThicknessNoiseShader_Check(v)      (( (PyObject *) v)->ob_type == &ThicknessNoiseShader_Type)
+#define BPy_ThicknessNoiseShader_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ThicknessNoiseShader_Type)  )
 
 /*---------------------------Python BPy_ThicknessNoiseShader structure definition----------*/
 typedef struct {
index 4c850bdb50f4c8558b08e9f1c0736ba4a0819590..302c9e005ae255dde1684676ededf1d13fca0a96 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ThicknessVariationPatternShader_Type;
 
-#define BPy_ThicknessVariationPatternShader_Check(v)   (( (PyObject *) v)->ob_type == &ThicknessVariationPatternShader_Type)
+#define BPy_ThicknessVariationPatternShader_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ThicknessVariationPatternShader_Type)  )
 
 /*---------------------------Python BPy_ThicknessVariationPatternShader structure definition----------*/
 typedef struct {
index 1ca4594d8d55e889072af9b95986c67b60e9bf11..a1b2e3988bca453dd2b78e0f62478710b8fe31c1 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject TipRemoverShader_Type;
 
-#define BPy_TipRemoverShader_Check(v)  (( (PyObject *) v)->ob_type == &TipRemoverShader_Type)
+#define BPy_TipRemoverShader_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &TipRemoverShader_Type)  )
 
 /*---------------------------Python BPy_TipRemoverShader structure definition----------*/
 typedef struct {
index 02cf0daff186ba63f96db59ba91a22785690fd8b..843d50505db0c1e0c93ec2b78b4cae2e784f897e 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject fstreamShader_Type;
 
-#define BPy_fstreamShader_Check(v)     (( (PyObject *) v)->ob_type == &fstreamShader_Type)
+#define BPy_fstreamShader_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &fstreamShader_Type)  )
 
 /*---------------------------Python BPy_fstreamShader structure definition----------*/
 typedef struct {
index ae34cb44798d03424413023fc6283cfffdd218aa..38056d5fa59c9d905b01dc1e644ba17e31e8cf47 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject streamShader_Type;
 
-#define BPy_streamShader_Check(v)      (( (PyObject *) v)->ob_type == &streamShader_Type)
+#define BPy_streamShader_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &streamShader_Type)  )
 
 /*---------------------------Python BPy_streamShader structure definition----------*/
 typedef struct {
index 2f0cb828419416dcbbc12b87f3e83f0ca3a91fbf..6aadc3be4acfd261e4248bf211fa9f6971fc38f8 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DDouble_Type;
 
-#define BPy_UnaryFunction0DDouble_Check(v)     (( (PyObject *) v)->ob_type == &UnaryFunction0DDouble_Type)
+#define BPy_UnaryFunction0DDouble_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DDouble_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DDouble structure definition----------*/
 typedef struct {
index 2aacd343ab15e624982dd6ed792b00309f7a08d2..30e16835482114ede1d85289acaff6a8e7ebed4f 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DEdgeNature_Type;
 
-#define BPy_UnaryFunction0DEdgeNature_Check(v) (( (PyObject *) v)->ob_type == &UnaryFunction0DEdgeNature_Type)
+#define BPy_UnaryFunction0DEdgeNature_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DEdgeNature_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DEdgeNature structure definition----------*/
 typedef struct {
index 46183228af64c2a476b88b1ca020a58f6cd4947a..7662a118a095fb6bc9436f15c59286ed44799d58 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DFloat_Type;
 
-#define BPy_UnaryFunction0DFloat_Check(v)      (( (PyObject *) v)->ob_type == &UnaryFunction0DFloat_Type)
+#define BPy_UnaryFunction0DFloat_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DFloat_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DFloat structure definition----------*/
 typedef struct {
index b1b87058bc87694a8fabb792265fd55fdf1b510c..ee15c63d8f06eedbabc3e9dedff8aaf8e3bb3c90 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DId_Type;
 
-#define BPy_UnaryFunction0DId_Check(v) (( (PyObject *) v)->ob_type == &UnaryFunction0DId_Type)
+#define BPy_UnaryFunction0DId_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DId_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DId structure definition----------*/
 typedef struct {
index d8baa3d98f43f5005ae5feab3c714f0a529e1d75..5e932213128bd56821ce0684c82567fe604a1f25 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DMaterial_Type;
 
-#define BPy_UnaryFunction0DMaterial_Check(v)   (( (PyObject *) v)->ob_type == &UnaryFunction0DMaterial_Type)
+#define BPy_UnaryFunction0DMaterial_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DMaterial_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DMaterial structure definition----------*/
 typedef struct {
index f79739b7a341340d42b38babe128e2b3a23e5595..e6b7351ae07c384ec2a06010c3f2543a8a77e882 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DUnsigned_Type;
 
-#define BPy_UnaryFunction0DUnsigned_Check(v)   (( (PyObject *) v)->ob_type == &UnaryFunction0DUnsigned_Type)
+#define BPy_UnaryFunction0DUnsigned_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DUnsigned_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DUnsigned structure definition----------*/
 typedef struct {
index a52edd1461a813027d665d0aa96a96a43c1c223d..82c9845e08bc797399af07e59ef5810949999d1f 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DVec2f_Type;
 
-#define BPy_UnaryFunction0DVec2f_Check(v)      (( (PyObject *) v)->ob_type == &UnaryFunction0DVec2f_Type)
+#define BPy_UnaryFunction0DVec2f_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DVec2f_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DVec2f structure definition----------*/
 typedef struct {
index b0e598c05cdd3be36449b8eceaa79b0077fe0738..7bd2b81dad6099410711affed1e3f780afb7eb9c 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DVec3f_Type;
 
-#define BPy_UnaryFunction0DVec3f_Check(v)      (( (PyObject *) v)->ob_type == &UnaryFunction0DVec3f_Type)
+#define BPy_UnaryFunction0DVec3f_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DVec3f_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DVec3f structure definition----------*/
 typedef struct {
index 88daae11b68cb0c40dc36098cd4ad055314bbf80..9d9f7b9deda3ab125f00a389e8a999753bc98061 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DVectorViewShape_Type;
 
-#define BPy_UnaryFunction0DVectorViewShape_Check(v)    (( (PyObject *) v)->ob_type == &UnaryFunction0DVectorViewShape_Type)
+#define BPy_UnaryFunction0DVectorViewShape_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DVectorViewShape_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DVectorViewShape structure definition----------*/
 typedef struct {
index 01057333a3eb6796c2a0f912f5db58e44160b20a..e0bb3989506d6cd49ca195486e63ec81a51058bd 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction0DViewShape_Type;
 
-#define BPy_UnaryFunction0DViewShape_Check(v)  (( (PyObject *) v)->ob_type == &UnaryFunction0DViewShape_Type)
+#define BPy_UnaryFunction0DViewShape_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction0DViewShape_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction0DViewShape structure definition----------*/
 typedef struct {
index 25d4bd76a1bd4ee4980f010c1cb008aed53b9023..11995bb4e88ab8f4c2f2373813547ca8d54159c1 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ShapeIdF0D_Type;
 
-#define BPy_ShapeIdF0D_Check(v)        (( (PyObject *) v)->ob_type == &ShapeIdF0D_Type)
+#define BPy_ShapeIdF0D_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ShapeIdF0D_Type)  )
 
 /*---------------------------Python BPy_ShapeIdF0D structure definition----------*/
 typedef struct {
index 4a3af1b9ff653c8c9af1893e974020c59a4f168a..1ae30484ba5897891ede61453d2eec2a348c7181 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject MaterialF0D_Type;
 
-#define BPy_MaterialF0D_Check(v)       (( (PyObject *) v)->ob_type == &MaterialF0D_Type)
+#define BPy_MaterialF0D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &MaterialF0D_Type)  )
 
 /*---------------------------Python BPy_MaterialF0D structure definition----------*/
 typedef struct {
index 62494f3dbaa00f15811a8c6324ca6f99cccb1376..63b3050c474bbeed28138253794d7c9bdd2f7226 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject CurveNatureF0D_Type;
 
-#define BPy_CurveNatureF0D_Check(v)    (( (PyObject *) v)->ob_type == &CurveNatureF0D_Type)
+#define BPy_CurveNatureF0D_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &CurveNatureF0D_Type)  )
 
 /*---------------------------Python BPy_CurveNatureF0D structure definition----------*/
 typedef struct {
index 1482ffae5f210d24b9461bdeab46ee375087afba..0b3be2df428f7dae7392ae9d1ef49381c17d5fac 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Normal2DF0D_Type;
 
-#define BPy_Normal2DF0D_Check(v)       (( (PyObject *) v)->ob_type == &Normal2DF0D_Type)
+#define BPy_Normal2DF0D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Normal2DF0D_Type)  )
 
 /*---------------------------Python BPy_Normal2DF0D structure definition----------*/
 typedef struct {
index c6ace665481633f75d7f0c1b9a3a0c9c348cf304..1cce9b592ba8e0d62383569e497628b6690b3b59 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject VertexOrientation2DF0D_Type;
 
-#define BPy_VertexOrientation2DF0D_Check(v)    (( (PyObject *) v)->ob_type == &VertexOrientation2DF0D_Type)
+#define BPy_VertexOrientation2DF0D_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &VertexOrientation2DF0D_Type)  )
 
 /*---------------------------Python BPy_VertexOrientation2DF0D structure definition----------*/
 typedef struct {
index 6a916362bb7acf0164f6a4197bec30ed3319aaec..80cac529f0bd356775885431cc9744f86fd7dcb8 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject VertexOrientation3DF0D_Type;
 
-#define BPy_VertexOrientation3DF0D_Check(v)    (( (PyObject *) v)->ob_type == &VertexOrientation3DF0D_Type)
+#define BPy_VertexOrientation3DF0D_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &VertexOrientation3DF0D_Type)  )
 
 /*---------------------------Python BPy_VertexOrientation3DF0D structure definition----------*/
 typedef struct {
index 2ba71a6637e4d5798e8acd7ffee353f51127c336..fd4f7d92bbb85ebd201340e4a8dffb42b83aa20b 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetOccludeeF0D_Type;
 
-#define BPy_GetOccludeeF0D_Check(v)    (( (PyObject *) v)->ob_type == &GetOccludeeF0D_Type)
+#define BPy_GetOccludeeF0D_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetOccludeeF0D_Type)  )
 
 /*---------------------------Python BPy_GetOccludeeF0D structure definition----------*/
 typedef struct {
index 6e97bd9a6909a5c3888d477efc1a4da246024da2..040c753968dc8a23f49a76dbf67ccdccd72aad8a 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetShapeF0D_Type;
 
-#define BPy_GetShapeF0D_Check(v)       (( (PyObject *) v)->ob_type == &GetShapeF0D_Type)
+#define BPy_GetShapeF0D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetShapeF0D_Type)  )
 
 /*---------------------------Python BPy_GetShapeF0D structure definition----------*/
 typedef struct {
index 1146369320ad41a2dea8f3efcc4fe0889f03c6bd..810ba04db8a4ea7aae54d1511ca9217981e561b6 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Curvature2DAngleF0D_Type;
 
-#define BPy_Curvature2DAngleF0D_Check(v)       (( (PyObject *) v)->ob_type == &Curvature2DAngleF0D_Type)
+#define BPy_Curvature2DAngleF0D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Curvature2DAngleF0D_Type)  )
 
 /*---------------------------Python BPy_Curvature2DAngleF0D structure definition----------*/
 typedef struct {
index 3b113a0e636d60b1e164cd25d3d39229471bb8b1..17ea95a771c9e0b93d5c3c1bee60a0e74649dfc6 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject DensityF0D_Type;
 
-#define BPy_DensityF0D_Check(v)        (( (PyObject *) v)->ob_type == &DensityF0D_Type)
+#define BPy_DensityF0D_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &DensityF0D_Type)  )
 
 /*---------------------------Python BPy_DensityF0D structure definition----------*/
 typedef struct {
index dcf6648cd6d612fb8efaa4276a376ba5f986cbd6..da73623cbf0fd41523677dcca8ba9e3444bb1c57 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetProjectedXF0D_Type;
 
-#define BPy_GetProjectedXF0D_Check(v)  (( (PyObject *) v)->ob_type == &GetProjectedXF0D_Type)
+#define BPy_GetProjectedXF0D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetProjectedXF0D_Type)  )
 
 /*---------------------------Python BPy_GetProjectedXF0D structure definition----------*/
 typedef struct {
index ea7d5a5ab76c35ea4673e19e414ce4683ea0ad8b..3a26e093747cdc6d2e5f0a08fcce53d5e0210d26 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetProjectedYF0D_Type;
 
-#define BPy_GetProjectedYF0D_Check(v)  (( (PyObject *) v)->ob_type == &GetProjectedYF0D_Type)
+#define BPy_GetProjectedYF0D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetProjectedYF0D_Type)  )
 
 /*---------------------------Python BPy_GetProjectedYF0D structure definition----------*/
 typedef struct {
index c3cd9cb8c19e2533a592ab102908234cb687f49c..aa41b70c660301aa8b4823426c89da40845546e4 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetProjectedZF0D_Type;
 
-#define BPy_GetProjectedZF0D_Check(v)  (( (PyObject *) v)->ob_type == &GetProjectedZF0D_Type)
+#define BPy_GetProjectedZF0D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetProjectedZF0D_Type)  )
 
 /*---------------------------Python BPy_GetProjectedZF0D structure definition----------*/
 typedef struct {
index 6164a46f2523e9c3c84e279d428b4f993207cfe1..69e9a892f4a95876c6346405cc522d28e24e67e8 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetXF0D_Type;
 
-#define BPy_GetXF0D_Check(v)   (( (PyObject *) v)->ob_type == &GetXF0D_Type)
+#define BPy_GetXF0D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetXF0D_Type)  )
 
 /*---------------------------Python BPy_GetXF0D structure definition----------*/
 typedef struct {
index f85e2c5976a3a65580810f012727a4e4fa157938..0601f38585ff93b165577f8b026526bccc5aa8ee 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetYF0D_Type;
 
-#define BPy_GetYF0D_Check(v)   (( (PyObject *) v)->ob_type == &GetYF0D_Type)
+#define BPy_GetYF0D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetYF0D_Type)  )
 
 /*---------------------------Python BPy_GetYF0D structure definition----------*/
 typedef struct {
index c7bed2ebda8225cbfe77573372db20cd8b3fce3e..eac5242660016b1d2a51bdb00e00a8dbf9e1823f 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetZF0D_Type;
 
-#define BPy_GetZF0D_Check(v)   (( (PyObject *) v)->ob_type == &GetZF0D_Type)
+#define BPy_GetZF0D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetZF0D_Type)  )
 
 /*---------------------------Python BPy_GetZF0D structure definition----------*/
 typedef struct {
index 6f84891fc1dc5d359e4beb6ac3e7a95d4fa5db5d..7385e1d24c1845a930776104d38248c56d9e4b34 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject LocalAverageDepthF0D_Type;
 
-#define BPy_LocalAverageDepthF0D_Check(v)      (( (PyObject *) v)->ob_type == &LocalAverageDepthF0D_Type)
+#define BPy_LocalAverageDepthF0D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &LocalAverageDepthF0D_Type)  )
 
 /*---------------------------Python BPy_LocalAverageDepthF0D structure definition----------*/
 typedef struct {
index 21f854d96c96a6973456ad8d0b12dcfa1735303f..a26ba4fdbd63916d41999b4a160b00c51eab8ce5 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ZDiscontinuityF0D_Type;
 
-#define BPy_ZDiscontinuityF0D_Check(v) (( (PyObject *) v)->ob_type == &ZDiscontinuityF0D_Type)
+#define BPy_ZDiscontinuityF0D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ZDiscontinuityF0D_Type)  )
 
 /*---------------------------Python BPy_ZDiscontinuityF0D structure definition----------*/
 typedef struct {
index f36371dfee51c35b564b27fb66db378768b19713..0cb56fcec70ae4c9bbe6f4ee1165b020b3c49205 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetCurvilinearAbscissaF0D_Type;
 
-#define BPy_GetCurvilinearAbscissaF0D_Check(v) (( (PyObject *) v)->ob_type == &GetCurvilinearAbscissaF0D_Type)
+#define BPy_GetCurvilinearAbscissaF0D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetCurvilinearAbscissaF0D_Type)  )
 
 /*---------------------------Python BPy_GetCurvilinearAbscissaF0D structure definition----------*/
 typedef struct {
index 77a08de4b07514db6a61cbbc8f2f3db16fd53453..4817e5cec865d00ee5f416d5eb62b5bcc59aec2f 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetParameterF0D_Type;
 
-#define BPy_GetParameterF0D_Check(v)   (( (PyObject *) v)->ob_type == &GetParameterF0D_Type)
+#define BPy_GetParameterF0D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetParameterF0D_Type)  )
 
 /*---------------------------Python BPy_GetParameterF0D structure definition----------*/
 typedef struct {
index aa626703aff4f316318ada1cac74e962852592ad..c072ba7f408bf642b711e516fe445e4312954e7a 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetViewMapGradientNormF0D_Type;
 
-#define BPy_GetViewMapGradientNormF0D_Check(v) (( (PyObject *) v)->ob_type == &GetViewMapGradientNormF0D_Type)
+#define BPy_GetViewMapGradientNormF0D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetViewMapGradientNormF0D_Type)  )
 
 /*---------------------------Python BPy_GetViewMapGradientNormF0D structure definition----------*/
 typedef struct {
index 5a4d90e821d528586be697a5c4e1137cddbf0d47..6a10e6c06a4832225836e545302e648580d0d758 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ReadCompleteViewMapPixelF0D_Type;
 
-#define BPy_ReadCompleteViewMapPixelF0D_Check(v)       (( (PyObject *) v)->ob_type == &ReadCompleteViewMapPixelF0D_Type)
+#define BPy_ReadCompleteViewMapPixelF0D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ReadCompleteViewMapPixelF0D_Type)  )
 
 /*---------------------------Python BPy_ReadCompleteViewMapPixelF0D structure definition----------*/
 typedef struct {
index e010bd3495a4b8f776df9c2ebf08e9c8cc73b0f1..9aed0cd82bff3f370015d031acc55d9dfba3a829 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ReadMapPixelF0D_Type;
 
-#define BPy_ReadMapPixelF0D_Check(v)   (( (PyObject *) v)->ob_type == &ReadMapPixelF0D_Type)
+#define BPy_ReadMapPixelF0D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ReadMapPixelF0D_Type)  )
 
 /*---------------------------Python BPy_ReadMapPixelF0D structure definition----------*/
 typedef struct {
index cc0c3a93f0ed069d60824077283971617f12e7a5..a881a10f72d7ef63960b2c4b0f83455ba867b758 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ReadSteerableViewMapPixelF0D_Type;
 
-#define BPy_ReadSteerableViewMapPixelF0D_Check(v)      (( (PyObject *) v)->ob_type == &ReadSteerableViewMapPixelF0D_Type)
+#define BPy_ReadSteerableViewMapPixelF0D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ReadSteerableViewMapPixelF0D_Type)  )
 
 /*---------------------------Python BPy_ReadSteerableViewMapPixelF0D structure definition----------*/
 typedef struct {
index 02706b48bd554107d590af39b02740db93b14644..39b73343608b1fe5be964cb906245369ed7371c9 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject QuantitativeInvisibilityF0D_Type;
 
-#define BPy_QuantitativeInvisibilityF0D_Check(v)       (( (PyObject *) v)->ob_type == &QuantitativeInvisibilityF0D_Type)
+#define BPy_QuantitativeInvisibilityF0D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &QuantitativeInvisibilityF0D_Type)  )
 
 /*---------------------------Python BPy_QuantitativeInvisibilityF0D structure definition----------*/
 typedef struct {
index 3d4108124f0eedf8455f6f722511583a01018933..0e92158a2e783277d1804cbbd97112d4037f9c4b 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetOccludersF0D_Type;
 
-#define BPy_GetOccludersF0D_Check(v)   (( (PyObject *) v)->ob_type == &GetOccludersF0D_Type)
+#define BPy_GetOccludersF0D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetOccludersF0D_Type)  )
 
 /*---------------------------Python BPy_GetOccludersF0D structure definition----------*/
 typedef struct {
index 7b6e94304981f372fedb246bff9cc2752a6ef5e9..81533dc21aaba370855d96120f86e7b46213e121 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction1DDouble_Type;
 
-#define BPy_UnaryFunction1DDouble_Check(v)     (( (PyObject *) v)->ob_type == &UnaryFunction1DDouble_Type)
+#define BPy_UnaryFunction1DDouble_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction1DDouble_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction1DDouble structure definition----------*/
 typedef struct {
index 9e899916a958af2a5f5dcf1c759d32fa17022352..afa65511560343784cfb500287ee7614bec47f01 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction1DEdgeNature_Type;
 
-#define BPy_UnaryFunction1DEdgeNature_Check(v) (( (PyObject *) v)->ob_type == &UnaryFunction1DEdgeNature_Type)
+#define BPy_UnaryFunction1DEdgeNature_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction1DEdgeNature_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction1DEdgeNature structure definition----------*/
 typedef struct {
index f454ab664ed8b68b57894cf859e7644199b5ab70..b144a95afe3d5eecf79ccfcd33e4a9b43d605a98 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction1DFloat_Type;
 
-#define BPy_UnaryFunction1DFloat_Check(v)      (( (PyObject *) v)->ob_type == &UnaryFunction1DFloat_Type)
+#define BPy_UnaryFunction1DFloat_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction1DFloat_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction1DFloat structure definition----------*/
 typedef struct {
index 0df50d9a9990f90ec9b89466e72a25c493b8a906..5904f0ad26775ffb956fbdd6fe7133fb021cf2ec 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction1DUnsigned_Type;
 
-#define BPy_UnaryFunction1DUnsigned_Check(v)   (( (PyObject *) v)->ob_type == &UnaryFunction1DUnsigned_Type)
+#define BPy_UnaryFunction1DUnsigned_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction1DUnsigned_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction1DUnsigned structure definition----------*/
 typedef struct {
index 098992e6631da7c5478a4f5495f733c6666f4585..9d369a646a13ee26db5bf71fcb7bb59c59e71724 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction1DVec2f_Type;
 
-#define BPy_UnaryFunction1DVec2f_Check(v)      (( (PyObject *) v)->ob_type == &UnaryFunction1DVec2f_Type)
+#define BPy_UnaryFunction1DVec2f_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction1DVec2f_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction1DVec2f structure definition----------*/
 typedef struct {
index 3829fa12b62b1d9a07312fe66b3e801f063fe78b..a79b173f0a99ae42ec9515ee8c6f1e75c8499bb1 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction1DVec3f_Type;
 
-#define BPy_UnaryFunction1DVec3f_Check(v)      (( (PyObject *) v)->ob_type == &UnaryFunction1DVec3f_Type)
+#define BPy_UnaryFunction1DVec3f_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction1DVec3f_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction1DVec3f structure definition----------*/
 typedef struct {
index cdde1926c8616eaf70a9299d5e8fbd1f79c855bf..492129c2b9aa52e3e22bbab736cb1da49ed37753 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction1DVectorViewShape_Type;
 
-#define BPy_UnaryFunction1DVectorViewShape_Check(v)    (( (PyObject *) v)->ob_type == &UnaryFunction1DVectorViewShape_Type)
+#define BPy_UnaryFunction1DVectorViewShape_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction1DVectorViewShape_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction1DVectorViewShape structure definition----------*/
 typedef struct {
index 68d9c61569cc9000d7891a765c3c79762541404c..3e8ad431ec4126b6108ffa494fac939b9a11fbbe 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject UnaryFunction1DVoid_Type;
 
-#define BPy_UnaryFunction1DVoid_Check(v)       (( (PyObject *) v)->ob_type == &UnaryFunction1DVoid_Type)
+#define BPy_UnaryFunction1DVoid_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &UnaryFunction1DVoid_Type)  )
 
 /*---------------------------Python BPy_UnaryFunction1DVoid structure definition----------*/
 typedef struct {
index 7e9344ddddab7ff561b0d8eabaf90013a81027ed..852f8937954562fd2c695a06cf48e1a7a5f6040d 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject CurveNatureF1D_Type;
 
-#define BPy_CurveNatureF1D_Check(v)    (( (PyObject *) v)->ob_type == &CurveNatureF1D_Type)
+#define BPy_CurveNatureF1D_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &CurveNatureF1D_Type)  )
 
 /*---------------------------Python BPy_CurveNatureF1D structure definition----------*/
 typedef struct {
index 70bfb0adb12c82c7d8eb7ed9137d7403e0e13c80..32078558d0c4dc47186083779c41db5f421af8dd 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Normal2DF1D_Type;
 
-#define BPy_Normal2DF1D_Check(v)       (( (PyObject *) v)->ob_type == &Normal2DF1D_Type)
+#define BPy_Normal2DF1D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Normal2DF1D_Type)  )
 
 /*---------------------------Python BPy_Normal2DF1D structure definition----------*/
 typedef struct {
index bcae5fc220f9b614332d9aa9c3da54e385210dc4..189ab04db4f121e29405fcc05b8337925e35e017 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Orientation2DF1D_Type;
 
-#define BPy_Orientation2DF1D_Check(v)  (( (PyObject *) v)->ob_type == &Orientation2DF1D_Type)
+#define BPy_Orientation2DF1D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Orientation2DF1D_Type)  )
 
 /*---------------------------Python BPy_Orientation2DF1D structure definition----------*/
 typedef struct {
index a868c04ce15f55771d55ba064d82d96243255538..b69baf106f4d27ba2cca74a708f6ee80c2569243 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Orientation3DF1D_Type;
 
-#define BPy_Orientation3DF1D_Check(v)  (( (PyObject *) v)->ob_type == &Orientation3DF1D_Type)
+#define BPy_Orientation3DF1D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Orientation3DF1D_Type)  )
 
 /*---------------------------Python BPy_Orientation3DF1D structure definition----------*/
 typedef struct {
index 838bb2298444785c16ee56a1aca0f766f4043c92..1603a7dc4ea8009e1b9fbfe96e6d6302179399cf 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject Curvature2DAngleF1D_Type;
 
-#define BPy_Curvature2DAngleF1D_Check(v)       (( (PyObject *) v)->ob_type == &Curvature2DAngleF1D_Type)
+#define BPy_Curvature2DAngleF1D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &Curvature2DAngleF1D_Type)  )
 
 /*---------------------------Python BPy_Curvature2DAngleF1D structure definition----------*/
 typedef struct {
index c7839b86d4d5a79139b020802c080a59c91bec14..36426536b3609c7501a9d86deb8ca6f745c97160 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject DensityF1D_Type;
 
-#define BPy_DensityF1D_Check(v)        (( (PyObject *) v)->ob_type == &DensityF1D_Type)
+#define BPy_DensityF1D_Check(v)        (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &DensityF1D_Type)  )
 
 /*---------------------------Python BPy_DensityF1D structure definition----------*/
 typedef struct {
index 5106930be75bdc1a348e5e66a50bfd8f3f5f5cbb..5963b820348f46043237f3353d62e39181799b0c 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetCompleteViewMapDensityF1D_Type;
 
-#define BPy_GetCompleteViewMapDensityF1D_Check(v)      (( (PyObject *) v)->ob_type == &GetCompleteViewMapDensityF1D_Type)
+#define BPy_GetCompleteViewMapDensityF1D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetCompleteViewMapDensityF1D_Type)  )
 
 /*---------------------------Python BPy_GetCompleteViewMapDensityF1D structure definition----------*/
 typedef struct {
index a2c3572694fc765083c3c34603fc5888ba77cec5..0e2d7ec27188e007c4541c75a879301a017c70c5 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetDirectionalViewMapDensityF1D_Type;
 
-#define BPy_GetDirectionalViewMapDensityF1D_Check(v)   (( (PyObject *) v)->ob_type == &GetDirectionalViewMapDensityF1D_Type)
+#define BPy_GetDirectionalViewMapDensityF1D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetDirectionalViewMapDensityF1D_Type)  )
 
 /*---------------------------Python BPy_GetDirectionalViewMapDensityF1D structure definition----------*/
 typedef struct {
index 26350df20132cba3726641334720451e0b52fec3..d799fb7b3342f2c0037509d90784fe6a75b271df 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetProjectedXF1D_Type;
 
-#define BPy_GetProjectedXF1D_Check(v)  (( (PyObject *) v)->ob_type == &GetProjectedXF1D_Type)
+#define BPy_GetProjectedXF1D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetProjectedXF1D_Type)  )
 
 /*---------------------------Python BPy_GetProjectedXF1D structure definition----------*/
 typedef struct {
index 86602d9619c42da2a6537b3ddb07285ad27e3cc8..1b7fe6c6b5fb9269cd8be6c3cf08a07a5d7a13d0 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetProjectedYF1D_Type;
 
-#define BPy_GetProjectedYF1D_Check(v)  (( (PyObject *) v)->ob_type == &GetProjectedYF1D_Type)
+#define BPy_GetProjectedYF1D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetProjectedYF1D_Type)  )
 
 /*---------------------------Python BPy_GetProjectedYF1D structure definition----------*/
 typedef struct {
index 9f2a4bc1a3e863be9a1cdac294988b613b10e632..a87ac6f8c5e8e2a6e69c00d3a5dd32eca574ee79 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetProjectedZF1D_Type;
 
-#define BPy_GetProjectedZF1D_Check(v)  (( (PyObject *) v)->ob_type == &GetProjectedZF1D_Type)
+#define BPy_GetProjectedZF1D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetProjectedZF1D_Type)  )
 
 /*---------------------------Python BPy_GetProjectedZF1D structure definition----------*/
 typedef struct {
index fa9942a55a1f714ea9c68e3a731b2e37c5a3d0bb..29880c7e9a726aa9ccd9fab2b93bdd2a451c5b92 100644 (file)
@@ -13,8 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetSteerableViewMapDensityF1D_Type;
 
-#define BPy_GetSteerableViewMapDensityF1D_Check(v)     (( (PyObject *) v)->ob_type == &GetSteerableViewMapDensityF1D_Type)
-
+#define BPy_GetSteerableViewMapDensityF1D_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetSteerableViewMapDensityF1D_Type)  )
 /*---------------------------Python BPy_GetSteerableViewMapDensityF1D structure definition----------*/
 typedef struct {
        BPy_UnaryFunction1DDouble py_uf1D_double;
index 5fcb88d5a29b35b724776bc6aeb89e7f20ccdc22..4f07629870f201906be7fa6e69ddd7d95e5b8c0f 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetViewMapGradientNormF1D_Type;
 
-#define BPy_GetViewMapGradientNormF1D_Check(v) (( (PyObject *) v)->ob_type == &GetViewMapGradientNormF1D_Type)
+#define BPy_GetViewMapGradientNormF1D_Check(v) ( ((PyObject *) v)->ob_type == PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetViewMapGradientNormF1D_Type)  )
 
 /*---------------------------Python BPy_GetViewMapGradientNormF1D structure definition----------*/
 typedef struct {
index ad39a5a9b10e37168334722304b2da340443a329..5eae107daaeb2bc9ec8604ac282b3dcb89f957a9 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetXF1D_Type;
 
-#define BPy_GetXF1D_Check(v)   (( (PyObject *) v)->ob_type == &GetXF1D_Type)
+#define BPy_GetXF1D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetXF1D_Type)  )
 
 /*---------------------------Python BPy_GetXF1D structure definition----------*/
 typedef struct {
index 6fc7da72752c9182fbb7e92e36d08132452aac3c..5864c2457765bd96615af3ef0a5fee0df056dda6 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetYF1D_Type;
 
-#define BPy_GetYF1D_Check(v)   (( (PyObject *) v)->ob_type == &GetYF1D_Type)
+#define BPy_GetYF1D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetYF1D_Type)  )
 
 /*---------------------------Python BPy_GetYF1D structure definition----------*/
 typedef struct {
index 71e57faa7ef64096eafef8190d796479c6f0b7ce..4b91a567eef1652ce60591095b31e769f32c96d0 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetZF1D_Type;
 
-#define BPy_GetZF1D_Check(v)   (( (PyObject *) v)->ob_type == &GetZF1D_Type)
+#define BPy_GetZF1D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetZF1D_Type)  )
 
 /*---------------------------Python BPy_GetZF1D structure definition----------*/
 typedef struct {
index cb9902cc38fadbc303b009e55026b15caffa08a8..627d10b641426ef9008213ea0739af8e2002e1d0 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject LocalAverageDepthF1D_Type;
 
-#define BPy_LocalAverageDepthF1D_Check(v)      (( (PyObject *) v)->ob_type == &LocalAverageDepthF1D_Type)
+#define BPy_LocalAverageDepthF1D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &LocalAverageDepthF1D_Type)  )
 
 /*---------------------------Python BPy_LocalAverageDepthF1D structure definition----------*/
 typedef struct {
index 66524e5c16aba1e922b5ee465e9d0c5ba3618414..e6b4be556d705222745c19184ec7222ca8eb8c64 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ZDiscontinuityF1D_Type;
 
-#define BPy_ZDiscontinuityF1D_Check(v) (( (PyObject *) v)->ob_type == &ZDiscontinuityF1D_Type)
+#define BPy_ZDiscontinuityF1D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ZDiscontinuityF1D_Type)  )
 
 /*---------------------------Python BPy_ZDiscontinuityF1D structure definition----------*/
 typedef struct {
index 8b8e793582fbad4d60445e109521afcdc69e6ef9..5bcf5fcc0a2defa1e0aaefe5dfecb26b2f6604ae 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject QuantitativeInvisibilityF1D_Type;
 
-#define BPy_QuantitativeInvisibilityF1D_Check(v)       (( (PyObject *) v)->ob_type == &QuantitativeInvisibilityF1D_Type)
+#define BPy_QuantitativeInvisibilityF1D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &QuantitativeInvisibilityF1D_Type)  )
 
 /*---------------------------Python BPy_QuantitativeInvisibilityF1D structure definition----------*/
 typedef struct {
index 0377214cb7014290d593195deb07eb7835b3f034..c8d5e99a6a7628b0ced34df0f510390d0b183144 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetOccludeeF1D_Type;
 
-#define BPy_GetOccludeeF1D_Check(v)    (( (PyObject *) v)->ob_type == &GetOccludeeF1D_Type)
+#define BPy_GetOccludeeF1D_Check(v)    (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetOccludeeF1D_Type)  )
 
 /*---------------------------Python BPy_GetOccludeeF1D structure definition----------*/
 typedef struct {
index 76031c5a8115cd4bf5b0c3a09d9fb842dd6b5573..ad39ad25c3dcbaa5a070a4c391845efdbf10bf2e 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetOccludersF1D_Type;
 
-#define BPy_GetOccludersF1D_Check(v)   (( (PyObject *) v)->ob_type == &GetOccludersF1D_Type)
+#define BPy_GetOccludersF1D_Check(v)   (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetOccludersF1D_Type)  )
 
 /*---------------------------Python BPy_GetOccludersF1D structure definition----------*/
 typedef struct {
index 3505e6688b07387bff039f58066a8adba91777c5..39d1268c03fe79f978e899de09d7a2c90b029237 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject GetShapeF1D_Type;
 
-#define BPy_GetShapeF1D_Check(v)       (( (PyObject *) v)->ob_type == &GetShapeF1D_Type)
+#define BPy_GetShapeF1D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &GetShapeF1D_Type)  )
 
 /*---------------------------Python BPy_GetShapeF1D structure definition----------*/
 typedef struct {
index e52e037e9864029068e59603ce0ef552a138ad5c..6855ddaf14b1336a706120e6069624a578865162 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ChainingTimeStampF1D_Type;
 
-#define BPy_ChainingTimeStampF1D_Check(v)      (( (PyObject *) v)->ob_type == &ChainingTimeStampF1D_Type)
+#define BPy_ChainingTimeStampF1D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ChainingTimeStampF1D_Type)  )
 
 /*---------------------------Python BPy_ChainingTimeStampF1D structure definition----------*/
 typedef struct {
index 82236dd0b79f14dfc1086fe2c43f872f82f158d0..a1d5714ab6329c2c702b3186e7cf4ff277892e87 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject IncrementChainingTimeStampF1D_Type;
 
-#define BPy_IncrementChainingTimeStampF1D_Check(v)     (( (PyObject *) v)->ob_type == &IncrementChainingTimeStampF1D_Type)
+#define BPy_IncrementChainingTimeStampF1D_Check(v)     (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &IncrementChainingTimeStampF1D_Type)  )
 
 /*---------------------------Python BPy_IncrementChainingTimeStampF1D structure definition----------*/
 typedef struct {
index f1f91d2cd6ecf598491c46937f48c2e41da0e730..d9bee247c098bf27f61c536277258405dc994490 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject TimeStampF1D_Type;
 
-#define BPy_TimeStampF1D_Check(v)      (( (PyObject *) v)->ob_type == &TimeStampF1D_Type)
+#define BPy_TimeStampF1D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &TimeStampF1D_Type)  )
 
 /*---------------------------Python BPy_TimeStampF1D structure definition----------*/
 typedef struct {
index 1cc043791c32a0c747c1cea001e3c4edb1fdd27b..399941d442d8426987fe2e1ea4bb14ac8c0ac1d7 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject FalseUP0D_Type;
 
-#define BPy_FalseUP0D_Check(v) (( (PyObject *) v)->ob_type == &FalseUP0D_Type)
+#define BPy_FalseUP0D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &FalseUP0D_Type)  )
 
 /*---------------------------Python BPy_FalseUP0D structure definition----------*/
 typedef struct {
index a05bff86a90a1db0207dc81c3ea73717bcc23d93..24976aaa5c9e132c63965753ea16d948bc29f244 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject TrueUP0D_Type;
 
-#define BPy_TrueUP0D_Check(v)  (( (PyObject *) v)->ob_type == &TrueUP0D_Type)
+#define BPy_TrueUP0D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &TrueUP0D_Type)  )
 
 /*---------------------------Python BPy_TrueUP0D structure definition----------*/
 typedef struct {
index 30d71a0cd2caa1e0400901c0f08c7f0503aebff8..a24261a60deca583c7dd79e854883aeca5ed7068 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ContourUP1D_Type;
 
-#define BPy_ContourUP1D_Check(v)       (( (PyObject *) v)->ob_type == &ContourUP1D_Type)
+#define BPy_ContourUP1D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ContourUP1D_Type)  )
 
 /*---------------------------Python BPy_ContourUP1D structure definition----------*/
 typedef struct {
index a6e6fdcd81f764d1637cd2877d887a271b4089de..2862b060a0a7530011b1979ce151cceb00dc7d7d 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject DensityLowerThanUP1D_Type;
 
-#define BPy_DensityLowerThanUP1D_Check(v)      (( (PyObject *) v)->ob_type == &DensityLowerThanUP1D_Type)
+#define BPy_DensityLowerThanUP1D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &DensityLowerThanUP1D_Type)  )
 
 /*---------------------------Python BPy_DensityLowerThanUP1D structure definition----------*/
 typedef struct {
index fa8d67d0ec6eebfadda1700ecc26811bfa4ea961..39423423b8e4a893792820305addc8c5e133530a 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject EqualToChainingTimeStampUP1D_Type;
 
-#define BPy_EqualToChainingTimeStampUP1D_Check(v)      (( (PyObject *) v)->ob_type == &EqualToChainingTimeStampUP1D_Type)
+#define BPy_EqualToChainingTimeStampUP1D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &EqualToChainingTimeStampUP1D_Type)  )
 
 /*---------------------------Python BPy_EqualToChainingTimeStampUP1D structure definition----------*/
 typedef struct {
index 6de9927d7ad506ec846fc504589b2c72e2cac5ad..538dc400dc292b4c194a697730054ec5d26a059e 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject EqualToTimeStampUP1D_Type;
 
-#define BPy_EqualToTimeStampUP1D_Check(v)      (( (PyObject *) v)->ob_type == &EqualToTimeStampUP1D_Type)
+#define BPy_EqualToTimeStampUP1D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &EqualToTimeStampUP1D_Type)  )
 
 /*---------------------------Python BPy_EqualToTimeStampUP1D structure definition----------*/
 typedef struct {
index 0d35f05bc7b3925a1e875188a91d5b7b5002ba5c..31300f04dfee3cf31dcf8746e84e92816f47ea79 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ExternalContourUP1D_Type;
 
-#define BPy_ExternalContourUP1D_Check(v)       (( (PyObject *) v)->ob_type == &ExternalContourUP1D_Type)
+#define BPy_ExternalContourUP1D_Check(v)       (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ExternalContourUP1D_Type)  )
 
 /*---------------------------Python BPy_ExternalContourUP1D structure definition----------*/
 typedef struct {
index c406a9265266553a55a089af7786cee3283e244f..273e4962db91b54a9503193ca2dc7eb6ca14f967 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject FalseUP1D_Type;
 
-#define BPy_FalseUP1D_Check(v) (( (PyObject *) v)->ob_type == &FalseUP1D_Type)
+#define BPy_FalseUP1D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &FalseUP1D_Type)  )
 
 /*---------------------------Python BPy_FalseUP1D structure definition----------*/
 typedef struct {
index 676bfc007155466e1fba080e4982762436924bd8..f120ecb9778aa831487173033b46a4e2423dbb8f 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject QuantitativeInvisibilityUP1D_Type;
 
-#define BPy_QuantitativeInvisibilityUP1D_Check(v)      (( (PyObject *) v)->ob_type == &QuantitativeInvisibilityUP1D_Type)
+#define BPy_QuantitativeInvisibilityUP1D_Check(v)      (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &QuantitativeInvisibilityUP1D_Type)  )
 
 /*---------------------------Python BPy_QuantitativeInvisibilityUP1D structure definition----------*/
 typedef struct {
index 0da88d959bcfd67ffb16293d89563c9da7e2a608..ce6d0276edd3d700211ca348410e86dbe240c342 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject ShapeUP1D_Type;
 
-#define BPy_ShapeUP1D_Check(v) (( (PyObject *) v)->ob_type == &ShapeUP1D_Type)
+#define BPy_ShapeUP1D_Check(v) (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &ShapeUP1D_Type)  )
 
 /*---------------------------Python BPy_ShapeUP1D structure definition----------*/
 typedef struct {
index b30b72320767b1f4b8ebc536f959f904705cd793..5a01ad42d2a1dd89d9b84d240d68fa1829066cca 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
 extern PyTypeObject TrueUP1D_Type;
 
-#define BPy_TrueUP1D_Check(v)  (( (PyObject *) v)->ob_type == &TrueUP1D_Type)
+#define BPy_TrueUP1D_Check(v)  (  PyObject_IsInstance( (PyObject *) v, (PyObject *) &TrueUP1D_Type)  )
 
 /*---------------------------Python BPy_TrueUP1D structure definition----------*/
 typedef struct {
diff --git a/source/blender/freestyle/style_modules_blender/ChainingIterators.py b/source/blender/freestyle/style_modules_blender/ChainingIterators.py
new file mode 100755 (executable)
index 0000000..3fe5779
--- /dev/null
@@ -0,0 +1,731 @@
+#
+#  Filename : ChainingIterators.py
+#  Author   : Stephane Grabli
+#  Date     : 04/08/2005
+#  Purpose  : Chaining Iterators to be used with chaining operators
+#
+#############################################################################  
+#
+#  Copyright (C) : Please refer to the COPYRIGHT file distributed 
+#  with this source distribution. 
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+#############################################################################
+
+from Blender.Freestyle import *
+
+## the natural chaining iterator
+## It follows the edges of same nature following the topology of
+## objects with  preseance on silhouettes, then borders, 
+## then suggestive contours, then everything else. It doesn't chain the same ViewEdge twice
+## You can specify whether to stay in the selection or not.
+class pyChainSilhouetteIterator(ChainingIterator):
+       def __init__(self, stayInSelection=1):
+               ChainingIterator.__init__(self, stayInSelection, 1,None,1)
+       def getExactTypeName(self):
+               return "pyChainSilhouetteIterator"
+       def traverse(self, iter):
+               winner = None
+               it = AdjacencyIterator(iter)
+               nextVertex = self.getVertex()
+               if(nextVertex.getNature() & T_VERTEX != 0):
+                       tvertex = nextVertex.castToTVertex()
+                       mateVE = tvertex.mate(self.getCurrentEdge())
+                       while(it.isEnd() == 0):
+                               ve = it.getObject()
+                               if(ve.getId() == mateVE.getId() ):
+                                       winner = ve
+                                       break
+                               it.increment()
+               else:
+                       ## case of NonTVertex
+                       natures = [SILHOUETTE,BORDER,CREASE,SUGGESTIVE_CONTOUR,VALLEY,RIDGE]
+                       for i in range(len(natures)):
+                               currentNature = self.getCurrentEdge().getNature()
+                               if(natures[i] & currentNature):
+                                       count=0
+                                       while(it.isEnd() == 0):
+                                               visitNext = 0
+                                               oNature = it.getObject().getNature()
+                                               if(oNature & natures[i] != 0):
+                                                       if(natures[i] != oNature):
+                                                               for j in range(i):
+                                                                       if(natures[j] & oNature != 0):
+                                                                               visitNext = 1
+                                                                               break
+                                                               if(visitNext != 0):
+                                                                       break    
+                                                       count = count+1
+                                                       winner = it.getObject()
+                                               it.increment()
+                                       if(count != 1):
+                                               winner = None
+                                       break
+               return winner
+
+## the natural chaining iterator
+## It follows the edges of same nature on the same
+## objects with  preseance on silhouettes, then borders, 
+## then suggestive contours, then everything else. It doesn't chain the same ViewEdge twice
+## You can specify whether to stay in the selection or not.
+## You can specify whether to chain iterate over edges that were 
+## already visited or not.
+class pyChainSilhouetteGenericIterator(ChainingIterator):
+       def __init__(self, stayInSelection=1, stayInUnvisited=1):
+               ChainingIterator.__init__(self, stayInSelection, stayInUnvisited,None,1)
+       def getExactTypeName(self):
+               return "pyChainSilhouetteGenericIterator"
+       def traverse(self, iter):
+               winner = None
+               it = AdjacencyIterator(iter)
+               nextVertex = self.getVertex()
+               if(nextVertex.getNature() & T_VERTEX != 0):
+                       tvertex = nextVertex.castToTVertex()
+                       mateVE = tvertex.mate(self.getCurrentEdge())
+                       while(it.isEnd() == 0):
+                               ve = it.getObject()
+                               if(ve.getId() == mateVE.getId() ):
+                                       winner = ve
+                                       break
+                               it.increment()
+               else:
+                       ## case of NonTVertex
+                       natures = [SILHOUETTE,BORDER,CREASE,SUGGESTIVE_CONTOUR,VALLEY,RIDGE]
+                       for i in range(len(natures)):
+                               currentNature = self.getCurrentEdge().getNature()
+                               if(natures[i] & currentNature):
+                                       count=0
+                                       while(it.isEnd() == 0):
+                                               visitNext = 0
+                                               oNature = it.getObject().getNature()
+                                               ve = it.getObject()
+                                               if(ve.getId() == self.getCurrentEdge().getId()):
+                                                       it.increment()
+                                                       continue
+                                               if(oNature & natures[i] != 0):
+                                                       if(natures[i] != oNature):
+                                                               for j in range(i):
+                                                                       if(natures[j] & oNature != 0):
+                                                                               visitNext = 1
+                                                                               break
+                                                               if(visitNext != 0):
+                                                                       break    
+                                                       count = count+1
+                                                       winner = ve
+                                               it.increment()
+                                       if(count != 1):
+                                               winner = None
+                                       break
+               return winner
+                       
+class pyExternalContourChainingIterator(ChainingIterator):
+       def __init__(self):
+               ChainingIterator.__init__(self, 0, 1,None,1)
+               self._isExternalContour = ExternalContourUP1D()
+               
+       def getExactTypeName(self):
+               return "pyExternalContourIterator"
+       
+       def init(self):
+               self._nEdges = 0
+               self._isInSelection = 1
+
+       def checkViewEdge(self, ve, orientation):
+               if(orientation != 0):
+                       vertex = ve.B()
+               else:
+                       vertex = ve.A()
+               it = AdjacencyIterator(vertex,1,1)
+               while(it.isEnd() == 0):
+                       ave = it.getObject()
+                       if(self._isExternalContour(ave)):
+                               return 1
+                       it.increment()
+               print "pyExternlContourChainingIterator : didn't find next edge"
+               return 0
+       def traverse(self, iter):
+               winner = None
+               it = AdjacencyIterator(iter)
+               while(it.isEnd() == 0):
+                       ve = it.getObject()
+                       if(self._isExternalContour(ve)):
+                               if (ve.getTimeStamp() == GetTimeStampCF()):
+                                       winner = ve
+                       it.increment()
+               
+               self._nEdges = self._nEdges+1
+               if(winner == None):
+                       orient = 1
+                       it = AdjacencyIterator(iter)
+                       while(it.isEnd() == 0):
+                               ve = it.getObject()
+                               if(it.isIncoming() != 0):
+                                       orient = 0
+                               good = self.checkViewEdge(ve,orient)
+                               if(good != 0):
+                                       winner = ve
+                               it.increment()
+               return winner
+
+## the natural chaining iterator
+## with a sketchy multiple touch
+class pySketchyChainSilhouetteIterator(ChainingIterator):
+       def __init__(self, nRounds=3,stayInSelection=1):
+               ChainingIterator.__init__(self, stayInSelection, 0,None,1)
+               self._timeStamp = GetTimeStampCF()+nRounds
+               self._nRounds = nRounds
+       def getExactTypeName(self):
+               return "pySketchyChainSilhouetteIterator"
+       def init(self):
+               self._timeStamp = GetTimeStampCF()+self._nRounds
+       def traverse(self, iter):
+               winner = None
+               it = AdjacencyIterator(iter)
+               nextVertex = self.getVertex()
+               if(nextVertex.getNature() & T_VERTEX != 0):
+                       tvertex = nextVertex.castToTVertex()
+                       mateVE = tvertex.mate(self.getCurrentEdge())
+                       while(it.isEnd() == 0):
+                               ve = it.getObject()
+                               if(ve.getId() == mateVE.getId() ):
+                                       winner = ve
+                                       break
+                               it.increment()
+               else:
+                       ## case of NonTVertex
+                       natures = [SILHOUETTE,BORDER,CREASE,SUGGESTIVE_CONTOUR,VALLEY,RIDGE]
+                       for i in range(len(natures)):
+                               currentNature = self.getCurrentEdge().getNature()
+                               if(natures[i] & currentNature):
+                                       count=0
+                                       while(it.isEnd() == 0):
+                                               visitNext = 0
+                                               oNature = it.getObject().getNature()
+                                               ve = it.getObject()
+                                               if(ve.getId() == self.getCurrentEdge().getId()):
+                                                       it.increment()
+                                                       continue
+                                               if(oNature & natures[i] != 0):
+                                                       if(natures[i] != oNature):
+                                                               for j in range(i):
+                                                                       if(natures[j] & oNature != 0):
+                                                                               visitNext = 1
+                                                                               break
+                                                               if(visitNext != 0):
+                                                                       break    
+                                                       count = count+1
+                                                       winner = ve
+                                               it.increment()
+                                       if(count != 1):
+                                               winner = None
+                                       break
+               if(winner == None):
+                       winner = self.getCurrentEdge()
+               if(winner.getChainingTimeStamp() == self._timeStamp):
+                       winner = None
+               return winner
+
+
+# Chaining iterator designed for sketchy style.
+# can chain several times the same ViewEdge
+# in order to produce multiple strokes per ViewEdge.
+class pySketchyChainingIterator(ChainingIterator):
+       def __init__(self, nRounds=3, stayInSelection=1):
+               ChainingIterator.__init__(self, stayInSelection, 0,None,1)
+               self._timeStamp = GetTimeStampCF()+nRounds
+               self._nRounds = nRounds
+       def getExactTypeName(self):
+               return "pySketchyChainingIterator"
+
+       def init(self):
+               self._timeStamp = GetTimeStampCF()+self._nRounds
+
+       def traverse(self, iter):
+               winner = None
+               it = AdjacencyIterator(iter)
+               while(it.isEnd() == 0):
+                       ve = it.getObject()
+                       if(ve.getId() == self.getCurrentEdge().getId()):
+                               it.increment()
+                               continue
+                       winner = ve
+                       it.increment()
+               if(winner == None):
+                       winner = self.getCurrentEdge()
+               if(winner.getChainingTimeStamp() == self._timeStamp):
+                       return None
+               return winner
+
+
+## Chaining iterator that fills small occlusions
+##     percent
+##             The max length of the occluded part 
+##             expressed in % of the total chain length
+class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
+       def __init__(self, percent):
+               ChainingIterator.__init__(self, 0, 1,None,1)
+               self._length = 0
+               self._percent = float(percent)
+       def getExactTypeName(self):
+               return "pyFillOcclusionsChainingIterator"
+       def init(self):
+               # each time we're evaluating a chain length 
+               # we try to do it once. Thus we reinit 
+               # the chain length here:
+               self._length = 0
+       def traverse(self, iter):
+               winner = None
+               winnerOrientation = 0
+               print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
+               it = AdjacencyIterator(iter)
+               nextVertex = self.getVertex()
+               if(nextVertex.getNature() & T_VERTEX != 0):
+                       tvertex = nextVertex.castToTVertex()
+                       mateVE = tvertex.mate(self.getCurrentEdge())
+                       while(it.isEnd() == 0):
+                               ve = it.getObject()
+                               if(ve.getId() == mateVE.getId() ):
+                                       winner = ve
+                                       if(it.isIncoming() == 0):
+                                               winnerOrientation = 1
+                                       else:
+                                               winnerOrientation = 0
+                                        break
+                               it.increment()
+               else:
+                       ## case of NonTVertex
+                       natures = [SILHOUETTE,BORDER,CREASE,SUGGESTIVE_CONTOUR,VALLEY,RIDGE]
+                       for nat in natures:
+                               if(self.getCurrentEdge().getNature() & nat != 0):
+                                       count=0
+                                       while(it.isEnd() == 0):
+                                               ve = it.getObject()
+                                               if(ve.getNature() & nat != 0):
+                                                       count = count+1
+                                                       winner = ve
+                                                       if(it.isIncoming() == 0):
+                                                               winnerOrientation = 1
+                                                       else:
+                                                               winnerOrientation = 0
+                                               it.increment()
+                                       if(count != 1):
+                                               winner = None
+                                       break
+               if(winner != None):
+                       # check whether this edge was part of the selection
+                       if(winner.getTimeStamp() != GetTimeStampCF()):
+                               #print "---", winner.getId().getFirst(), winner.getId().getSecond()
+                               # if not, let's check whether it's short enough with
+                               # respect to the chain made without staying in the selection
+                               #------------------------------------------------------------
+                               # Did we compute the prospective chain length already ?
+                               if(self._length == 0):
+                                       #if not, let's do it
+                                       _it = pyChainSilhouetteGenericIterator(0,0)
+                                       _it.setBegin(winner)
+                                       _it.setCurrentEdge(winner)
+                                       _it.setOrientation(winnerOrientation)
+                                       _it.init()
+                                       while(_it.isEnd() == 0):
+                                               ve = _it.getObject()
+                                               #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+                                               self._length = self._length + ve.getLength2D()
+                                               _it.increment()
+                                               if(_it.isBegin() != 0):
+                                                       break;
+                                       _it.setBegin(winner)
+                                       _it.setCurrentEdge(winner)
+                                       _it.setOrientation(winnerOrientation)
+                                       if(_it.isBegin() == 0):
+                                               _it.decrement()
+                                               while ((_it.isEnd() == 0) and (_it.isBegin() == 0)):
+                                                       ve = _it.getObject()
+                                                       #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+                                                       self._length = self._length + ve.getLength2D()
+                                                       _it.decrement()
+
+                               # let's do the comparison:
+                               # nw let's compute the length of this connex non selected part:
+                               connexl = 0
+                               _cit = pyChainSilhouetteGenericIterator(0,0)
+                               _cit.setBegin(winner)
+                               _cit.setCurrentEdge(winner)
+                               _cit.setOrientation(winnerOrientation)
+                               _cit.init()
+                               while((_cit.isEnd() == 0) and (_cit.getObject().getTimeStamp() != GetTimeStampCF())):
+                                       ve = _cit.getObject()
+                                       #print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
+                                       connexl = connexl + ve.getLength2D()
+                                       _cit.increment()
+                               if(connexl > self._percent * self._length):
+                                       winner = None
+               return winner
+
+## Chaining iterator that fills small occlusions
+##     size
+##             The max length of the occluded part 
+##             expressed in pixels
+class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
+       def __init__(self, length):
+               ChainingIterator.__init__(self, 0, 1,None,1)
+               self._length = float(length)
+       def getExactTypeName(self):
+               return "pySmallFillOcclusionsChainingIterator"
+       def traverse(self, iter):
+               winner = None
+               winnerOrientation = 0
+               #print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
+               it = AdjacencyIterator(iter)
+               nextVertex = self.getVertex()
+               if(nextVertex.getNature() & T_VERTEX != 0):
+                       tvertex = nextVertex.castToTVertex()
+                       mateVE = tvertex.mate(self.getCurrentEdge())
+                       while(it.isEnd() == 0):
+                               ve = it.getObject()
+                               if(ve.getId() == mateVE.getId() ):
+                                       winner = ve
+                                       if(it.isIncoming() == 0):
+                                               winnerOrientation = 1
+                                       else:
+                                               winnerOrientation = 0
+                                        break
+                               it.increment()
+               else:
+                       ## case of NonTVertex
+                       natures = [SILHOUETTE,BORDER,CREASE,SUGGESTIVE_CONTOUR,VALLEY,RIDGE]
+                       for nat in natures:
+                               if(self.getCurrentEdge().getNature() & nat != 0):
+                                       count=0
+                                       while(it.isEnd() == 0):
+                                               ve = it.getObject()
+                                               if(ve.getNature() & nat != 0):
+                                                       count = count+1
+                                                       winner = ve
+                                                       if(it.isIncoming() == 0):
+                                                               winnerOrientation = 1
+                                                       else:
+                                                               winnerOrientation = 0
+                                               it.increment()
+                                       if(count != 1):
+                                               winner = None
+                                       break
+               if(winner != None):
+                       # check whether this edge was part of the selection
+                       if(winner.getTimeStamp() != GetTimeStampCF()):
+                               #print "---", winner.getId().getFirst(), winner.getId().getSecond()
+                               # nw let's compute the length of this connex non selected part:
+                               connexl = 0
+                               _cit = pyChainSilhouetteGenericIterator(0,0)
+                               _cit.setBegin(winner)
+                               _cit.setCurrentEdge(winner)
+                               _cit.setOrientation(winnerOrientation)
+                               _cit.init()
+                               while((_cit.isEnd() == 0) and (_cit.getObject().getTimeStamp() != GetTimeStampCF())):
+                                       ve = _cit.getObject()
+                                       #print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
+                                       connexl = connexl + ve.getLength2D()
+                                       _cit.increment()
+                               if(connexl > self._length):
+                                       winner = None
+               return winner
+
+
+## Chaining iterator that fills small occlusions
+##     percent
+##             The max length of the occluded part 
+##             expressed in % of the total chain length
+class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
+       def __init__(self, percent, l):
+               ChainingIterator.__init__(self, 0, 1,None,1)
+               self._length = 0
+               self._absLength = l
+               self._percent = float(percent)
+       def getExactTypeName(self):
+               return "pyFillOcclusionsChainingIterator"
+       def init(self):
+               # each time we're evaluating a chain length 
+               # we try to do it once. Thus we reinit 
+               # the chain length here:
+               self._length = 0
+       def traverse(self, iter):
+               winner = None
+               winnerOrientation = 0
+               print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
+               it = AdjacencyIterator(iter)
+               nextVertex = self.getVertex()
+               if(nextVertex.getNature() & T_VERTEX != 0):
+                       tvertex = nextVertex.castToTVertex()
+                       mateVE = tvertex.mate(self.getCurrentEdge())
+                       while(it.isEnd() == 0):
+                               ve = it.getObject()
+                               if(ve.getId() == mateVE.getId() ):
+                                       winner = ve
+                                       if(it.isIncoming() == 0):
+                                               winnerOrientation = 1
+                                       else:
+                                               winnerOrientation = 0
+                                        break
+                               it.increment()
+               else:
+                       ## case of NonTVertex
+                       natures = [SILHOUETTE,BORDER,CREASE,SUGGESTIVE_CONTOUR,VALLEY,RIDGE]
+                       for nat in natures:
+                               if(self.getCurrentEdge().getNature() & nat != 0):
+                                       count=0
+                                       while(it.isEnd() == 0):
+                                               ve = it.getObject()
+                                               if(ve.getNature() & nat != 0):
+                                                       count = count+1
+                                                       winner = ve
+                                                       if(it.isIncoming() == 0):
+                                                               winnerOrientation = 1
+                                                       else:
+                                                               winnerOrientation = 0
+                                               it.increment()
+                                       if(count != 1):
+                                               winner = None
+                                       break
+               if(winner != None):
+                       # check whether this edge was part of the selection
+                       if(winner.getTimeStamp() != GetTimeStampCF()):
+                               #print "---", winner.getId().getFirst(), winner.getId().getSecond()
+                               # if not, let's check whether it's short enough with
+                               # respect to the chain made without staying in the selection
+                               #------------------------------------------------------------
+                               # Did we compute the prospective chain length already ?
+                               if(self._length == 0):
+                                       #if not, let's do it
+                                       _it = pyChainSilhouetteGenericIterator(0,0)
+                                       _it.setBegin(winner)
+                                       _it.setCurrentEdge(winner)
+                                       _it.setOrientation(winnerOrientation)
+                                       _it.init()
+                                       while(_it.isEnd() == 0):
+                                               ve = _it.getObject()
+                                               #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+                                               self._length = self._length + ve.getLength2D()
+                                               _it.increment()
+                                               if(_it.isBegin() != 0):
+                                                       break;
+                                       _it.setBegin(winner)
+                                       _it.setCurrentEdge(winner)
+                                       _it.setOrientation(winnerOrientation)
+                                       if(_it.isBegin() == 0):
+                                               _it.decrement()
+                                               while ((_it.isEnd() == 0) and (_it.isBegin() == 0)):
+                                                       ve = _it.getObject()
+                                                       #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+                                                       self._length = self._length + ve.getLength2D()
+                                                       _it.decrement()
+
+                               # let's do the comparison:
+                               # nw let's compute the length of this connex non selected part:
+                               connexl = 0
+                               _cit = pyChainSilhouetteGenericIterator(0,0)
+                               _cit.setBegin(winner)
+                               _cit.setCurrentEdge(winner)
+                               _cit.setOrientation(winnerOrientation)
+                               _cit.init()
+                               while((_cit.isEnd() == 0) and (_cit.getObject().getTimeStamp() != GetTimeStampCF())):
+                                       ve = _cit.getObject()
+                                       #print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
+                                       connexl = connexl + ve.getLength2D()
+                                       _cit.increment()
+                               if((connexl > self._percent * self._length) or (connexl > self._absLength)):
+                                       winner = None
+               return winner
+
+## Chaining iterator that fills small occlusions without caring about the 
+## actual selection
+##     percent
+##             The max length of the occluded part 
+##             expressed in % of the total chain length
+class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
+       def __init__(self, percent, l):
+               ChainingIterator.__init__(self, 0, 1,None,1)
+               self._length = 0
+               self._absLength = l
+               self._percent = float(percent)
+       def getExactTypeName(self):
+               return "pyFillOcclusionsChainingIterator"
+       def init(self):
+               # each time we're evaluating a chain length 
+               # we try to do it once. Thus we reinit 
+               # the chain length here:
+               self._length = 0
+       def traverse(self, iter):
+               winner = None
+               winnerOrientation = 0
+               print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
+               it = AdjacencyIterator(iter)
+               nextVertex = self.getVertex()
+               if(nextVertex.getNature() & T_VERTEX != 0):
+                       tvertex = nextVertex.castToTVertex()
+                       mateVE = tvertex.mate(self.getCurrentEdge())
+                       while(it.isEnd() == 0):
+                               ve = it.getObject()
+                               if(ve.getId() == mateVE.getId() ):
+                                       winner = ve
+                                       if(it.isIncoming() == 0):
+                                               winnerOrientation = 1
+                                       else:
+                                               winnerOrientation = 0
+                                        break
+                               it.increment()
+               else:
+                       ## case of NonTVertex
+                       natures = [SILHOUETTE,BORDER,CREASE,SUGGESTIVE_CONTOUR,VALLEY,RIDGE]
+                       for nat in natures:
+                               if(self.getCurrentEdge().getNature() & nat != 0):
+                                       count=0
+                                       while(it.isEnd() == 0):
+                                               ve = it.getObject()
+                                               if(ve.getNature() & nat != 0):
+                                                       count = count+1
+                                                       winner = ve
+                                                       if(it.isIncoming() == 0):
+                                                               winnerOrientation = 1
+                                                       else:
+                                                               winnerOrientation = 0
+                                               it.increment()
+                                       if(count != 1):
+                                               winner = None
+                                       break
+               if(winner != None):
+                       # check whether this edge was part of the selection
+                       if(winner.qi() != 0):
+                               #print "---", winner.getId().getFirst(), winner.getId().getSecond()
+                               # if not, let's check whether it's short enough with
+                               # respect to the chain made without staying in the selection
+                               #------------------------------------------------------------
+                               # Did we compute the prospective chain length already ?
+                               if(self._length == 0):
+                                       #if not, let's do it
+                                       _it = pyChainSilhouetteGenericIterator(0,0)
+                                       _it.setBegin(winner)
+                                       _it.setCurrentEdge(winner)
+                                       _it.setOrientation(winnerOrientation)
+                                       _it.init()
+                                       while(_it.isEnd() == 0):
+                                               ve = _it.getObject()
+                                               #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+                                               self._length = self._length + ve.getLength2D()
+                                               _it.increment()
+                                               if(_it.isBegin() != 0):
+                                                       break;
+                                       _it.setBegin(winner)
+                                       _it.setCurrentEdge(winner)
+                                       _it.setOrientation(winnerOrientation)
+                                       if(_it.isBegin() == 0):
+                                               _it.decrement()
+                                               while ((_it.isEnd() == 0) and (_it.isBegin() == 0)):
+                                                       ve = _it.getObject()
+                                                       #print "--------", ve.getId().getFirst(), ve.getId().getSecond()
+                                                       self._length = self._length + ve.getLength2D()
+                                                       _it.decrement()
+
+                               # let's do the comparison:
+                               # nw let's compute the length of this connex non selected part:
+                               connexl = 0
+                               _cit = pyChainSilhouetteGenericIterator(0,0)
+                               _cit.setBegin(winner)
+                               _cit.setCurrentEdge(winner)
+                               _cit.setOrientation(winnerOrientation)
+                               _cit.init()
+                               while((_cit.isEnd() == 0) and (_cit.getObject().qi() != 0)):
+                                       ve = _cit.getObject()
+                                       #print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
+                                       connexl = connexl + ve.getLength2D()
+                                       _cit.increment()
+                               if((connexl > self._percent * self._length) or (connexl > self._absLength)):
+                                       winner = None
+               return winner
+
+
+## the natural chaining iterator
+## It follows the edges of same nature on the same
+## objects with  preseance on silhouettes, then borders, 
+## then suggestive contours, then everything else. It doesn't chain the same ViewEdge twice
+## You can specify whether to stay in the selection or not.
+class pyNoIdChainSilhouetteIterator(ChainingIterator):
+       def __init__(self, stayInSelection=1):
+               ChainingIterator.__init__(self, stayInSelection, 1,None,1)
+       def getExactTypeName(self):
+               return "pyChainSilhouetteIterator"
+       def traverse(self, iter):
+               winner = None
+               it = AdjacencyIterator(iter)
+               nextVertex = self.getVertex()
+               if(nextVertex.getNature() & T_VERTEX != 0):
+                       tvertex = nextVertex.castToTVertex()
+                       mateVE = tvertex.mate(self.getCurrentEdge())
+                       while(it.isEnd() == 0):
+                               ve = it.getObject()
+                               feB = self.getCurrentEdge().fedgeB()
+                               feA = ve.fedgeA()
+                               vB = feB.vertexB()
+                               vA = feA.vertexA()
+                               if vA.getId().getFirst() == vB.getId().getFirst():
+                                       winner = ve
+                                       break
+                               feA = self.getCurrentEdge().fedgeA()
+                               feB = ve.fedgeB()
+                               vB = feB.vertexB()
+                               vA = feA.vertexA()
+                               if vA.getId().getFirst() == vB.getId().getFirst():
+                                       winner = ve
+                                       break
+                               feA = self.getCurrentEdge().fedgeB()
+                               feB = ve.fedgeB()
+                               vB = feB.vertexB()
+                               vA = feA.vertexB()
+                               if vA.getId().getFirst() == vB.getId().getFirst():
+                                       winner = ve
+                                       break
+                               feA = self.getCurrentEdge().fedgeA()
+                               feB = ve.fedgeA()
+                               vB = feB.vertexA()
+                               vA = feA.vertexA()
+                               if vA.getId().getFirst() == vB.getId().getFirst():
+                                       winner = ve
+                                       break
+                               it.increment()
+               else:
+                       ## case of NonTVertex
+                       natures = [SILHOUETTE,BORDER,CREASE,SUGGESTIVE_CONTOUR,VALLEY,RIDGE]
+                       for i in range(len(natures)):
+                               currentNature = self.getCurrentEdge().getNature()
+                               if(natures[i] & currentNature):
+                                       count=0
+                                       while(it.isEnd() == 0):
+                                               visitNext = 0
+                                               oNature = it.getObject().getNature()
+                                               if(oNature & natures[i] != 0):
+                                                       if(natures[i] != oNature):
+                                                               for j in range(i):
+                                                                       if(natures[j] & oNature != 0):
+                                                                               visitNext = 1
+                                                                               break
+                                                               if(visitNext != 0):
+                                                                       break    
+                                                       count = count+1
+                                                       winner = it.getObject()
+                                               it.increment()
+                                       if(count != 1):
+                                               winner = None
+                                       break
+               return winner
+
diff --git a/source/blender/freestyle/style_modules_blender/Functions0D.py b/source/blender/freestyle/style_modules_blender/Functions0D.py
new file mode 100755 (executable)
index 0000000..6285564
--- /dev/null
@@ -0,0 +1,81 @@
+from Blender.Freestyle import *
+
+
+class pyInverseCurvature2DAngleF0D(UnaryFunction0DDouble):
+       def getName(self):
+               return "InverseCurvature2DAngleF0D"
+
+       def __call__(self, inter):
+               func = Curvature2DAngleF0D()
+               c = func(inter)
+               return (3.1415 - c)
+
+class pyCurvilinearLengthF0D(UnaryFunction0DDouble):
+       def getName(self):
+               return "CurvilinearLengthF0D"
+
+       def __call__(self, inter):
+               i0d = inter.getObject()
+               s = i0d.getExactTypeName()
+               if (string.find(s, "CurvePoint") == -1):
+                       print "CurvilinearLengthF0D: not implemented yet for %s" % (s)
+                       return -1
+               cp = castToCurvePoint(i0d)
+               return cp.t2d()
+
+## estimate anisotropy of density
+class pyDensityAnisotropyF0D(UnaryFunction0DDouble):
+       def __init__(self,level):
+               UnaryFunction0DDouble.__init__(self)
+               self.IsoDensity = ReadCompleteViewMapPixelF0D(level)
+               self.d0Density = ReadSteerableViewMapPixelF0D(0, level)
+               self.d1Density = ReadSteerableViewMapPixelF0D(1, level)
+               self.d2Density = ReadSteerableViewMapPixelF0D(2, level)
+               self.d3Density = ReadSteerableViewMapPixelF0D(3, level)
+       def getName(self):
+               return "pyDensityAnisotropyF0D"
+       def __call__(self, inter):
+               c_iso = self.IsoDensity(inter) 
+               c_0 = self.d0Density(inter) 
+               c_1 = self.d1Density(inter) 
+               c_2 = self.d2Density(inter) 
+               c_3 = self.d3Density(inter) 
+               cMax = max( max(c_0,c_1), max(c_2,c_3))
+               cMin = min( min(c_0,c_1), min(c_2,c_3))
+               if ( c_iso == 0 ):
+                       v = 0
+               else:
+                       v = (cMax-cMin)/c_iso
+               return (v)
+
+## Returns the gradient vector for a pixel 
+##     l
+##       the level at which one wants to compute the gradient
+class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
+       def __init__(self, l):
+               UnaryFunction0DVec2f.__init__(self)
+               self._l = l
+               self._step = pow(2,self._l)
+       def getName(self):
+               return "pyViewMapGradientVectorF0D"
+       def __call__(self, iter):
+               p = iter.getObject().getPoint2D()
+               gx = ReadCompleteViewMapPixelCF(self._l, int(p.x()+self._step), int(p.y()))- ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()))
+               gy = ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()+self._step))- ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()))
+               return Vec2f(gx, gy)
+
+class pyViewMapGradientNormF0D(UnaryFunction0DDouble):
+       def __init__(self, l):
+               UnaryFunction0DDouble.__init__(self)
+               self._l = l
+               self._step = pow(2,self._l)
+       def getName(self):
+               return "pyViewMapGradientNormF0D"
+       def __call__(self, iter):
+               p = iter.getObject().getPoint2D()
+               gx = ReadCompleteViewMapPixelCF(self._l, int(p.x()+self._step), int(p.y()))- ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()))
+               gy = ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()+self._step))- ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()))
+               grad = Vec2f(gx, gy)
+               return grad.norm()
+
+
diff --git a/source/blender/freestyle/style_modules_blender/Functions1D.py b/source/blender/freestyle/style_modules_blender/Functions1D.py
new file mode 100755 (executable)
index 0000000..d3474ff
--- /dev/null
@@ -0,0 +1,45 @@
+from Blender.Freestyle import *
+from Functions0D import *
+import string 
+
+class pyGetInverseProjectedZF1D(UnaryFunction1DDouble):
+       def getName(self):
+               return "pyGetInverseProjectedZF1D"
+
+       def __call__(self, inter):
+               func = GetProjectedZF1D()
+               z = func(inter)
+               return (1.0 - z)
+
+class pyGetSquareInverseProjectedZF1D(UnaryFunction1DDouble):
+       def getName(self):
+               return "pyGetInverseProjectedZF1D"
+
+       def __call__(self, inter):
+               func = GetProjectedZF1D()
+               z = func(inter)
+               return (1.0 - z*z)
+
+class pyDensityAnisotropyF1D(UnaryFunction1DDouble):
+       def __init__(self,level,  integrationType=IntegrationType.MEAN, sampling=2.0):
+               UnaryFunction1DDouble.__init__(self, integrationType)
+               self._func = pyDensityAnisotropyF0D(level)
+               self._integration = integrationType
+               self._sampling = sampling
+       def getName(self):
+               return "pyDensityAnisotropyF1D"
+       def __call__(self, inter):
+               v =  integrateDouble(self._func, inter.pointsBegin(self._sampling), inter.pointsEnd(self._sampling), self._integration)
+               return v
+
+class pyViewMapGradientNormF1D(UnaryFunction1DDouble):
+       def __init__(self,l, integrationType, sampling=2.0):
+               UnaryFunction1DDouble.__init__(self, integrationType)
+               self._func = pyViewMapGradientNormF0D(l)
+               self._integration = integrationType
+               self._sampling = sampling
+       def getName(self):
+               return "pyViewMapGradientNormF1D"
+       def __call__(self, inter):
+               v =  integrateDouble(self._func, inter.pointsBegin(self._sampling), inter.pointsEnd(self._sampling), self._integration)
+               return v
diff --git a/source/blender/freestyle/style_modules_blender/PredicatesB1D.py b/source/blender/freestyle/style_modules_blender/PredicatesB1D.py
new file mode 100755 (executable)
index 0000000..21d90f9
--- /dev/null
@@ -0,0 +1,70 @@
+from Blender.Freestyle import *
+from Functions1D import *
+from random import *
+
+class pyZBP1D(BinaryPredicate1D):
+       def getName(self):
+               return "pyZBP1D"
+
+       def __call__(self, i1, i2):
+               func = GetZF1D()
+               return (func(i1) > func(i2))
+
+class pyZDiscontinuityBP1D(BinaryPredicate1D):
+       def __init__(self, iType = IntegrationType.MEAN):
+               BinaryPredicate1D.__init__(self)
+               self._GetZDiscontinuity = ZDiscontinuityF1D(iType)
+
+       def getName(self):
+               return "pyZDiscontinuityBP1D"
+
+       def __call__(self, i1, i2):
+               return (self._GetZDiscontinuity(i1) > self._GetZDiscontinuity(i2))
+
+class pyLengthBP1D(BinaryPredicate1D):
+       def getName(self):
+               return "LengthBP1D"
+
+       def __call__(self, i1, i2):
+               return (i1.getLength2D() > i2.getLength2D())
+
+class pySilhouetteFirstBP1D(BinaryPredicate1D):
+       def getName(self):
+               return "SilhouetteFirstBP1D"
+
+       def __call__(self, inter1, inter2):
+               bpred = SameShapeIdBP1D()
+               if (bpred(inter1, inter2) != 1):
+                       return 0
+               if (inter1.getNature() & SILHOUETTE):
+                       return (inter2.getNature() & SILHOUETTE)
+               return (inter1.getNature() == inter2.getNature())
+
+class pyNatureBP1D(BinaryPredicate1D):
+       def getName(self):
+               return "NatureBP1D"
+
+       def __call__(self, inter1, inter2):
+               return (inter1.getNature() & inter2.getNature())
+
+class pyViewMapGradientNormBP1D(BinaryPredicate1D):
+       def __init__(self,l, sampling=2.0):
+               BinaryPredicate1D.__init__(self)
+               self._GetGradient = pyViewMapGradientNormF1D(l, IntegrationType.MEAN)
+       def getName(self):
+               return "pyViewMapGradientNormBP1D"
+       def __call__(self, i1,i2):
+               print "compare gradient"
+               return (self._GetGradient(i1) > self._GetGradient(i2))
+
+class pyShuffleBP1D(BinaryPredicate1D):
+       def __init__(self):
+               BinaryPredicate1D.__init__(self)
+               seed(1)
+       def getName(self):
+               return "pyNearAndContourFirstBP1D"
+
+       def __call__(self, inter1, inter2):
+               r1 = uniform(0,1)
+               r2 = uniform(0,1)
+               return (r1<r2)
diff --git a/source/blender/freestyle/style_modules_blender/PredicatesU0D.py b/source/blender/freestyle/style_modules_blender/PredicatesU0D.py
new file mode 100755 (executable)
index 0000000..8432dea
--- /dev/null
@@ -0,0 +1,103 @@
+from Blender.Freestyle import *
+from Functions0D import *
+
+class pyHigherCurvature2DAngleUP0D(UnaryPredicate0D):
+       def __init__(self,a):
+               UnaryPredicate0D.__init__(self)
+               self._a = a
+                       
+       def getName(self):
+               return "HigherCurvature2DAngleUP0D"
+
+       def __call__(self, inter):
+               func = Curvature2DAngleF0D()
+               a = func(inter)
+               return ( a > self._a)
+
+class pyUEqualsUP0D(UnaryPredicate0D):
+       def __init__(self,u, w):
+               UnaryPredicate0D.__init__(self)
+               self._u = u
+               self._w = w
+                       
+       def getName(self):
+               return "UEqualsUP0D"
+
+       def __call__(self, inter):
+               func = pyCurvilinearLengthF0D()
+               u = func(inter)
+               return ( ( u > (self._u-self._w) ) and ( u < (self._u+self._w) ) )
+
+class pyVertexNatureUP0D(UnaryPredicate0D):
+       def __init__(self,nature):
+               UnaryPredicate0D.__init__(self)
+               self._nature = nature
+                       
+       def getName(self):
+               return "pyVertexNatureUP0D"
+
+&nbs