[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54803] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/python: Code clean-up and fix for typos in docstrings.
Tamito Kajiyama
rd6t-kjym at asahi-net.or.jp
Sun Feb 24 03:32:58 CET 2013
Revision: 54803
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54803
Author: kjym3
Date: 2013-02-24 02:32:56 +0000 (Sun, 24 Feb 2013)
Log Message:
-----------
Code clean-up and fix for typos in docstrings.
Modified Paths:
--------------
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BBox.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Id.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Iterator.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_MediumType.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Nature.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryFunction0D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryFunction1D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Director.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Director.h
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/BPy_TextureAssignerShader.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ContourUP1D.cpp
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BBox.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BBox.cpp 2013-02-23 23:40:51 UTC (rev 54802)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BBox.cpp 2013-02-24 02:32:56 UTC (rev 54803)
@@ -81,10 +81,6 @@
return PyUnicode_FromFormat("BBox - address: %p", self->bb);
}
-static PyMethodDef BPy_BBox_methods[] = {
- {NULL, NULL, 0, NULL}
-};
-
/*-----------------------BPy_BBox type definition ------------------------------*/
PyTypeObject BBox_Type = {
@@ -115,7 +111,7 @@
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
- BPy_BBox_methods, /* tp_methods */
+ 0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp 2013-02-23 23:40:51 UTC (rev 54802)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp 2013-02-24 02:32:56 UTC (rev 54803)
@@ -48,9 +48,9 @@
if (PyType_Ready(&BinaryPredicate0D_Type) < 0)
return -1;
-
Py_INCREF(&BinaryPredicate0D_Type);
PyModule_AddObject(module, "BinaryPredicate0D", (PyObject *)&BinaryPredicate0D_Type);
+
return 0;
}
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp 2013-02-23 23:40:51 UTC (rev 54802)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp 2013-02-24 02:32:56 UTC (rev 54803)
@@ -56,32 +56,32 @@
return -1;
Py_INCREF(&BinaryPredicate1D_Type);
PyModule_AddObject(module, "BinaryPredicate1D", (PyObject *)&BinaryPredicate1D_Type);
-
+
if (PyType_Ready(&FalseBP1D_Type) < 0)
return -1;
Py_INCREF(&FalseBP1D_Type);
PyModule_AddObject(module, "FalseBP1D", (PyObject *)&FalseBP1D_Type);
-
+
if (PyType_Ready(&Length2DBP1D_Type) < 0)
return -1;
Py_INCREF(&Length2DBP1D_Type);
PyModule_AddObject(module, "Length2DBP1D", (PyObject *)&Length2DBP1D_Type);
-
+
if (PyType_Ready(&SameShapeIdBP1D_Type) < 0)
return -1;
Py_INCREF(&SameShapeIdBP1D_Type);
PyModule_AddObject(module, "SameShapeIdBP1D", (PyObject *)&SameShapeIdBP1D_Type);
-
+
if (PyType_Ready(&TrueBP1D_Type) < 0)
return -1;
Py_INCREF(&TrueBP1D_Type);
PyModule_AddObject(module, "TrueBP1D", (PyObject *)&TrueBP1D_Type);
-
+
if (PyType_Ready(&ViewMapGradientNormBP1D_Type) < 0)
return -1;
Py_INCREF(&ViewMapGradientNormBP1D_Type);
PyModule_AddObject(module, "ViewMapGradientNormBP1D", (PyObject *)&ViewMapGradientNormBP1D_Type);
-
+
return 0;
}
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp 2013-02-23 23:40:51 UTC (rev 54802)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp 2013-02-24 02:32:56 UTC (rev 54803)
@@ -72,61 +72,71 @@
extern "C" {
#endif
-
///////////////////////////////////////////////////////////////////////////////////////////
//==============================
// C++ => Python
//==============================
-
-PyObject * PyBool_from_bool( bool b ){
- return PyBool_FromLong( b ? 1 : 0);
+PyObject *PyBool_from_bool(bool b)
+{
+ return PyBool_FromLong(b ? 1 : 0);
}
-
-PyObject * Vector_from_Vec2f( Vec2f& vec ) {
+PyObject *Vector_from_Vec2f(Vec2f& vec)
+{
float vec_data[2]; // because vec->_coord is protected
-
- vec_data[0] = vec.x(); vec_data[1] = vec.y();
- return Vector_CreatePyObject( vec_data, 2, Py_NEW, NULL);
+ vec_data[0] = vec.x();
+ vec_data[1] = vec.y();
+ return Vector_CreatePyObject(vec_data, 2, Py_NEW, NULL);
}
-PyObject * Vector_from_Vec3f( Vec3f& vec ) {
+PyObject *Vector_from_Vec3f(Vec3f& vec)
+{
float vec_data[3]; // because vec->_coord is protected
-
- vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z();
- return Vector_CreatePyObject( vec_data, 3, Py_NEW, NULL);
+ vec_data[0] = vec.x();
+ vec_data[1] = vec.y();
+ vec_data[2] = vec.z();
+ return Vector_CreatePyObject(vec_data, 3, Py_NEW, NULL);
}
-PyObject * Vector_from_Vec3r( Vec3r& vec ) {
+PyObject *Vector_from_Vec3r(Vec3r& vec)
+{
float vec_data[3]; // because vec->_coord is protected
-
- vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z();
- return Vector_CreatePyObject( vec_data, 3, Py_NEW, NULL);
+ vec_data[0] = vec.x();
+ vec_data[1] = vec.y();
+ vec_data[2] = vec.z();
+ return Vector_CreatePyObject(vec_data, 3, Py_NEW, NULL);
}
-PyObject * BPy_Id_from_Id( Id& id ) {
- PyObject *py_id = Id_Type.tp_new( &Id_Type, 0, 0 );
- ((BPy_Id *) py_id)->id = new Id( id.getFirst(), id.getSecond() );
-
+PyObject *BPy_Id_from_Id(Id& id)
+{
+ PyObject *py_id = Id_Type.tp_new(&Id_Type, 0, 0);
+ ((BPy_Id *)py_id)->id = new Id(id.getFirst(), id.getSecond());
return py_id;
}
-PyObject * Any_BPy_Interface0D_from_Interface0D( Interface0D& if0D ) {
+PyObject *Any_BPy_Interface0D_from_Interface0D(Interface0D& if0D)
+{
if (typeid(if0D) == typeid(CurvePoint)) {
return BPy_CurvePoint_from_CurvePoint(dynamic_cast<CurvePoint&>(if0D));
- } else if (typeid(if0D) == typeid(StrokeVertex)) {
+ }
+ else if (typeid(if0D) == typeid(StrokeVertex)) {
return BPy_StrokeVertex_from_StrokeVertex(dynamic_cast<StrokeVertex&>(if0D));
- } else if (typeid(if0D) == typeid(SVertex)) {
+ }
+ else if (typeid(if0D) == typeid(SVertex)) {
return BPy_SVertex_from_SVertex(dynamic_cast<SVertex&>(if0D));
- } else if (typeid(if0D) == typeid(ViewVertex)) {
+ }
+ else if (typeid(if0D) == typeid(ViewVertex)) {
return BPy_ViewVertex_from_ViewVertex(dynamic_cast<ViewVertex&>(if0D));
- } else if (typeid(if0D) == typeid(NonTVertex)) {
+ }
+ else if (typeid(if0D) == typeid(NonTVertex)) {
return BPy_NonTVertex_from_NonTVertex(dynamic_cast<NonTVertex&>(if0D));
- } else if (typeid(if0D) == typeid(TVertex)) {
+ }
+ else if (typeid(if0D) == typeid(TVertex)) {
return BPy_TVertex_from_TVertex(dynamic_cast<TVertex&>(if0D));
- } else if (typeid(if0D) == typeid(Interface0D)) {
+ }
+ else if (typeid(if0D) == typeid(Interface0D)) {
return BPy_Interface0D_from_Interface0D(if0D);
}
string msg("unexpected type: " + if0D.getExactTypeName());
@@ -134,259 +144,267 @@
return NULL;
}
-PyObject * Any_BPy_Interface1D_from_Interface1D( Interface1D& if1D ) {
+PyObject *Any_BPy_Interface1D_from_Interface1D(Interface1D& if1D)
+{
if (typeid(if1D) == typeid(ViewEdge)) {
return BPy_ViewEdge_from_ViewEdge(dynamic_cast<ViewEdge&>(if1D));
- } else if (typeid(if1D) == typeid(Chain)) {
+ }
+ else if (typeid(if1D) == typeid(Chain)) {
return BPy_Chain_from_Chain(dynamic_cast<Chain&>(if1D));
- } else if (typeid(if1D) == typeid(Stroke)) {
+ }
+ else if (typeid(if1D) == typeid(Stroke)) {
return BPy_Stroke_from_Stroke(dynamic_cast<Stroke&>(if1D));
- } else if (typeid(if1D) == typeid(FEdgeSharp)) {
+ }
+ else if (typeid(if1D) == typeid(FEdgeSharp)) {
return BPy_FEdgeSharp_from_FEdgeSharp(dynamic_cast<FEdgeSharp&>(if1D));
- } else if (typeid(if1D) == typeid(FEdgeSmooth)) {
+ }
+ else if (typeid(if1D) == typeid(FEdgeSmooth)) {
return BPy_FEdgeSmooth_from_FEdgeSmooth(dynamic_cast<FEdgeSmooth&>(if1D));
- } else if (typeid(if1D) == typeid(FEdge)) {
+ }
+ else if (typeid(if1D) == typeid(FEdge)) {
return BPy_FEdge_from_FEdge(dynamic_cast<FEdge&>(if1D));
- } else if (typeid(if1D) == typeid(Interface1D)) {
- return BPy_Interface1D_from_Interface1D( if1D );
}
+ else if (typeid(if1D) == typeid(Interface1D)) {
+ return BPy_Interface1D_from_Interface1D(if1D);
+ }
string msg("unexpected type: " + if1D.getExactTypeName());
PyErr_SetString(PyExc_TypeError, msg.c_str());
return NULL;
}
-PyObject * Any_BPy_FEdge_from_FEdge( FEdge& fe ) {
+PyObject *Any_BPy_FEdge_from_FEdge(FEdge& fe)
+{
if (typeid(fe) == typeid(FEdgeSharp)) {
- return BPy_FEdgeSharp_from_FEdgeSharp( dynamic_cast<FEdgeSharp&>(fe) );
- } else if (typeid(fe) == typeid(FEdgeSmooth)) {
- return BPy_FEdgeSmooth_from_FEdgeSmooth( dynamic_cast<FEdgeSmooth&>(fe) );
- } else if (typeid(fe) == typeid(FEdge)) {
- return BPy_FEdge_from_FEdge( fe );
+ return BPy_FEdgeSharp_from_FEdgeSharp(dynamic_cast<FEdgeSharp&>(fe));
}
+ else if (typeid(fe) == typeid(FEdgeSmooth)) {
+ return BPy_FEdgeSmooth_from_FEdgeSmooth(dynamic_cast<FEdgeSmooth&>(fe));
+ }
+ else if (typeid(fe) == typeid(FEdge)) {
+ return BPy_FEdge_from_FEdge(fe);
+ }
string msg("unexpected type: " + fe.getExactTypeName());
PyErr_SetString(PyExc_TypeError, msg.c_str());
return NULL;
}
-PyObject * Any_BPy_ViewVertex_from_ViewVertex( ViewVertex& vv ) {
+PyObject *Any_BPy_ViewVertex_from_ViewVertex(ViewVertex& vv)
+{
if (typeid(vv) == typeid(NonTVertex)) {
- return BPy_NonTVertex_from_NonTVertex( dynamic_cast<NonTVertex&>(vv) );
- } else if (typeid(vv) == typeid(TVertex)) {
- return BPy_TVertex_from_TVertex( dynamic_cast<TVertex&>(vv) );
- } else if (typeid(vv) == typeid(ViewVertex)) {
- return BPy_ViewVertex_from_ViewVertex( vv );
+ return BPy_NonTVertex_from_NonTVertex(dynamic_cast<NonTVertex&>(vv));
}
+ else if (typeid(vv) == typeid(TVertex)) {
+ return BPy_TVertex_from_TVertex(dynamic_cast<TVertex&>(vv));
+ }
+ else if (typeid(vv) == typeid(ViewVertex)) {
+ return BPy_ViewVertex_from_ViewVertex(vv);
+ }
string msg("unexpected type: " + vv.getExactTypeName());
PyErr_SetString(PyExc_TypeError, msg.c_str());
return NULL;
}
-PyObject * BPy_Interface0D_from_Interface0D( Interface0D& if0D ) {
- PyObject *py_if0D = Interface0D_Type.tp_new( &Interface0D_Type, 0, 0 );
- ((BPy_Interface0D *) py_if0D)->if0D = &if0D;
- ((BPy_Interface0D *) py_if0D)->borrowed = 1;
-
+PyObject *BPy_Interface0D_from_Interface0D(Interface0D& if0D)
+{
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list