From a388a9d72dce4b8c25e8faf176d48b982a0b63d2 Mon Sep 17 00:00:00 2001 From: looooo Date: Wed, 1 Mar 2017 17:10:46 +0100 Subject: [PATCH] py3: Part: App: gathering commits relevant for Mod/Part/App --- src/Mod/Part/App/AppPart.cpp | 26 +++++++++-- src/Mod/Part/App/AttachEnginePyImp.cpp | 18 +++++++- src/Mod/Part/App/BSplineCurvePyImp.cpp | 9 +++- src/Mod/Part/App/BSplineSurfacePyImp.cpp | 17 ++++++- src/Mod/Part/App/BezierCurvePyImp.cpp | 1 - src/Mod/Part/App/BezierSurfacePyImp.cpp | 1 - src/Mod/Part/App/Geom2d/BSplineCurve2dPy.xml | 8 ++-- .../Part/App/Geom2d/BSplineCurve2dPyImp.cpp | 46 +++++++++++++------ src/Mod/Part/App/Geom2d/BezierCurve2dPy.xml | 6 +-- .../Part/App/Geom2d/BezierCurve2dPyImp.cpp | 13 +++--- src/Mod/Part/App/PropertyTopoShape.cpp | 8 ++++ src/Mod/Part/App/TopoShapePyImp.cpp | 14 ++++++ 12 files changed, 130 insertions(+), 37 deletions(-) diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index dea3c3379..f111e19b7 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -163,8 +163,9 @@ public: /// Type structure of LinePyOld PyTypeObject LinePyOld::Type = { - PyObject_HEAD_INIT(&PyType_Type) - 0, /*ob_size*/ + // PyObject_HEAD_INIT(&PyType_Type) + // 0, /*ob_size*/ + PyVarObject_HEAD_INIT(&PyType_Type,0) "Part.Line", /*tp_name*/ sizeof(LinePyOld), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -186,7 +187,11 @@ PyTypeObject LinePyOld::Type = { /* --- Functions to access object as input/output buffer ---------*/ 0, /* tp_as_buffer */ /* --- Flags to define presence of optional/expanded features */ - Py_TPFLAGS_HAVE_CLASS, /*tp_flags */ +#if PY_MAJOR_VERSION >= 3 + Py_TPFLAGS_DEFAULT, /*tp_flags */ +#else + Py_TPFLAGS_HAVE_CLASS, /*tp_flags */ +#endif "", 0, /*tp_traverse */ 0, /*tp_clear */ @@ -214,6 +219,9 @@ PyTypeObject LinePyOld::Type = { 0, /*tp_weaklist */ 0, /*tp_del */ 0 /*tp_version_tag */ +#if PY_MAJOR_VERSION >=3 + ,0 /*tp_finalize */ +#endif }; } @@ -350,7 +358,12 @@ PyMOD_INIT_FUNC(Part) Base::Interpreter().addType(&Part::BRepOffsetAPI_MakePipeShellPy::Type,brepModule,"MakePipeShell"); // Geom2d package - PyObject* geom2dModule = Py_InitModule3("Geom2d", 0, "Geom2d"); +#if PY_MAJOR_VERSION >= 3 + static struct PyModuleDef geom2dDef = {PyModuleDef_HEAD_INIT,"Geom2dD", "Geom2d", -1, 0}; + PyObject* geom2dModule = PyModule_Create(&geom2dDef); +#else + PyObject* geom2dModule = Py_InitModule3("Geom2d", 0, "Geom2d"); +#endif Py_INCREF(geom2dModule); PyModule_AddObject(partModule, "Geom2d", geom2dModule); Base::Interpreter().addType(&Part::Geometry2dPy::Type,geom2dModule,"Geometry2d"); @@ -370,7 +383,9 @@ PyMOD_INIT_FUNC(Part) Base::Interpreter().addType(&Part::Line2dSegmentPy::Type,geom2dModule,"Line2dSegment"); Base::Interpreter().addType(&Part::Line2dPy::Type,geom2dModule,"Line2d"); Base::Interpreter().addType(&Part::OffsetCurve2dPy::Type,geom2dModule,"OffsetCurve2d"); - +#if 0 /* for python3 this isn't working anymore, it's solved by importing the BOPTools + directly. (import BOPTools) */ +// this causes double initialisation of the part modul with python3. try { //import all submodules of BOPTools, to make them easy to browse in Py console. //It's done in this weird manner instead of bt.caMemberFunction("importAll"), @@ -383,6 +398,7 @@ PyMOD_INIT_FUNC(Part) Base::Console().Error("Failed to import BOPTools package:\n"); err.ReportException(); } +#endif Part::TopoShape ::init(); Part::PropertyPartShape ::init(); diff --git a/src/Mod/Part/App/AttachEnginePyImp.cpp b/src/Mod/Part/App/AttachEnginePyImp.cpp index fe2abd3c7..64054f97b 100644 --- a/src/Mod/Part/App/AttachEnginePyImp.cpp +++ b/src/Mod/Part/App/AttachEnginePyImp.cpp @@ -257,8 +257,11 @@ PyObject* AttachEnginePy::getModeInfo(PyObject* args) } Py::Dict ret; ret["ReferenceCombinations"] = pyListOfCombinations; +#if PY_MAJOR_VERSION >= 3 + ret["ModeIndex"] = Py::Long(mmode); +#else ret["ModeIndex"] = Py::Int(mmode); - +#endif try { Py::Module module(PyImport_ImportModule("PartGui"),true); if (!module.hasAttr("AttachEngineResources")) { @@ -269,7 +272,11 @@ PyObject* AttachEnginePy::getModeInfo(PyObject* args) Py::Callable method(submod.getAttr("getModeStrings")); Py::Tuple arg(2); arg.setItem(0, Py::String(this->getAttachEnginePtr()->getTypeId().getName())); +#if PY_MAJOR_VERSION >= 3 + arg.setItem(1, Py::Long(mmode)); +#else arg.setItem(1, Py::Int(mmode)); +#endif Py::List strs = method.apply(arg); assert(strs.size() == 2); ret["UserFriendlyName"] = strs[0]; @@ -342,8 +349,13 @@ PyObject* AttachEnginePy::getRefTypeInfo(PyObject* args) AttachEngine &attacher = *(this->getAttachEnginePtr()); eRefType rt = attacher.getRefTypeByName(typeName); Py::Dict ret; +#if PY_MAJOR_VERSION >= 3 + ret["TypeIndex"] = Py::Long(rt); + ret["Rank"] = Py::Long(AttachEngine::getTypeRank(rt)); +#else ret["TypeIndex"] = Py::Int(rt); ret["Rank"] = Py::Int(AttachEngine::getTypeRank(rt)); +#endif try { Py::Module module(PyImport_ImportModule("PartGui"),true); @@ -354,7 +366,11 @@ PyObject* AttachEnginePy::getRefTypeInfo(PyObject* args) Py::Object submod(module.getAttr("AttachEngineResources")); Py::Callable method(submod.getAttr("getRefTypeUserFriendlyName")); Py::Tuple arg(1); +#if PY_MAJOR_VERSION >= 3 + arg.setItem(0, Py::Long(rt)); +#else arg.setItem(0, Py::Int(rt)); +#endif Py::String st = method.apply(arg); ret["UserFriendlyName"] = st; } catch (Py::Exception& e) { diff --git a/src/Mod/Part/App/BSplineCurvePyImp.cpp b/src/Mod/Part/App/BSplineCurvePyImp.cpp index e248bc2c6..5a8a19bcb 100644 --- a/src/Mod/Part/App/BSplineCurvePyImp.cpp +++ b/src/Mod/Part/App/BSplineCurvePyImp.cpp @@ -225,7 +225,11 @@ PyObject* BSplineCurvePy::insertKnots(PyObject * args) TColStd_Array1OfInteger m(1,mults.size()); index=1; for (Py::Sequence::iterator it = mults.begin(); it != mults.end(); ++it) { +#if PY_MAJOR_VERSION >= 3 Py::Long val(*it); +#else + Py::Int val(*it); +#endif m(index++) = (int)val; } @@ -672,7 +676,6 @@ PyObject* BSplineCurvePy::getMultiplicities(PyObject * args) return 0; } } - Py::Long BSplineCurvePy::getDegree(void) const { Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast @@ -1211,7 +1214,11 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key Py::Sequence multssq(mults); Standard_Integer index = 1; for (Py::Sequence::iterator it = multssq.begin(); it != multssq.end() && index <= occmults.Length(); ++it) { +#if PY_MAJOR_VERSION >= 3 Py::Long mult(*it); +#else + Py::Int mult(*it); +#endif if (index < occmults.Length() || PyObject_Not(periodic)) { sum_of_mults += static_cast(mult); //sum up the mults to compare them against the number of poles later } diff --git a/src/Mod/Part/App/BSplineSurfacePyImp.cpp b/src/Mod/Part/App/BSplineSurfacePyImp.cpp index 91aa0aab8..30dd146b9 100644 --- a/src/Mod/Part/App/BSplineSurfacePyImp.cpp +++ b/src/Mod/Part/App/BSplineSurfacePyImp.cpp @@ -286,7 +286,11 @@ PyObject* BSplineSurfacePy::insertUKnots(PyObject *args) TColStd_Array1OfInteger m(1,mults.size()); index=1; for (Py::Sequence::iterator it = mults.begin(); it != mults.end(); ++it) { +#if PY_MAJOR_VERSION >= 3 Py::Long val(*it); +#else + Py::Int val(*it); +#endif m(index++) = (int)val; } @@ -349,7 +353,11 @@ PyObject* BSplineSurfacePy::insertVKnots(PyObject *args) TColStd_Array1OfInteger m(1,mults.size()); index=1; for (Py::Sequence::iterator it = mults.begin(); it != mults.end(); ++it) { +#if PY_MAJOR_VERSION >= 3 Py::Long val(*it); +#else + Py::Int val(*it); +#endif m(index++) = (int)val; } @@ -1467,7 +1475,11 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k Py::Sequence umultssq(umults); Standard_Integer index = 1; for (Py::Sequence::iterator it = umultssq.begin(); it != umultssq.end() && index <= occumults.Length(); ++it) { +#if PY_MAJOR_VERSION >= 3 Py::Long mult(*it); +#else + Py::Int mult(*it); +#endif if (index < occumults.Length() || PyObject_Not(uperiodic)) { sum_of_umults += static_cast(mult); //sum up the mults to compare them against the number of poles later } @@ -1476,7 +1488,11 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k Py::Sequence vmultssq(vmults); index = 1; for (Py::Sequence::iterator it = vmultssq.begin(); it != vmultssq.end() && index <= occvmults.Length(); ++it) { +#if PY_MAJOR_VERSION >= 3 Py::Long mult(*it); +#else + Py::Int mult(*it); +#endif if (index < occvmults.Length() || PyObject_Not(vperiodic)) { sum_of_vmults += static_cast(mult); //sum up the mults to compare them against the number of poles later } @@ -1536,7 +1552,6 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k return 0; } } - Py::Long BSplineSurfacePy::getUDegree(void) const { Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast diff --git a/src/Mod/Part/App/BezierCurvePyImp.cpp b/src/Mod/Part/App/BezierCurvePyImp.cpp index 68c35d1cb..302468c60 100644 --- a/src/Mod/Part/App/BezierCurvePyImp.cpp +++ b/src/Mod/Part/App/BezierCurvePyImp.cpp @@ -355,7 +355,6 @@ PyObject* BezierCurvePy::getResolution(PyObject* args) return 0; } } - Py::Long BezierCurvePy::getDegree(void) const { Handle_Geom_BezierCurve curve = Handle_Geom_BezierCurve::DownCast diff --git a/src/Mod/Part/App/BezierSurfacePyImp.cpp b/src/Mod/Part/App/BezierSurfacePyImp.cpp index 9d370b483..973ef8dba 100644 --- a/src/Mod/Part/App/BezierSurfacePyImp.cpp +++ b/src/Mod/Part/App/BezierSurfacePyImp.cpp @@ -728,7 +728,6 @@ PyObject* BezierSurfacePy::vIso(PyObject * args) return 0; } } - Py::Long BezierSurfacePy::getUDegree(void) const { Handle_Geom_BezierSurface surf = Handle_Geom_BezierSurface::DownCast diff --git a/src/Mod/Part/App/Geom2d/BSplineCurve2dPy.xml b/src/Mod/Part/App/Geom2d/BSplineCurve2dPy.xml index 33a60260d..162281297 100644 --- a/src/Mod/Part/App/Geom2d/BSplineCurve2dPy.xml +++ b/src/Mod/Part/App/Geom2d/BSplineCurve2dPy.xml @@ -19,21 +19,21 @@ Returns the polynomial degree of this B-Spline curve. - + Returns the value of the maximum polynomial degree of any B-Spline curve curve. This value is 25. - + Returns the number of poles of this B-Spline curve. - + @@ -41,7 +41,7 @@ B-Spline curve curve. This value is 25. Returns the number of knots of this B-Spline curve. - + diff --git a/src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp b/src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp index 7e04fe766..7553844d4 100644 --- a/src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp @@ -214,7 +214,11 @@ PyObject* BSplineCurve2dPy::insertKnots(PyObject * args) TColStd_Array1OfInteger m(1,mults.size()); index=1; for (Py::Sequence::iterator it = mults.begin(); it != mults.end(); ++it) { +#if PY_MAJOR_VERSION >= 3 + Py::Long val(*it); +#else Py::Int val(*it); +#endif m(index++) = (int)val; } @@ -408,7 +412,7 @@ PyObject* BSplineCurve2dPy::getPoles(PyObject * args) try { Handle_Geom2d_BSplineCurve curve = Handle_Geom2d_BSplineCurve::DownCast (getGeometry2dPtr()->handle()); - TColgp_Array1OfPnt2d p(1,curve->NbPoles()); + TColgp_Array1OfPnt2d p(1, (int)curve->NbPoles()); curve->Poles(p); Py::List poles; @@ -645,7 +649,11 @@ PyObject* BSplineCurve2dPy::getMultiplicities(PyObject * args) curve->Multiplicities(m); Py::List mults; for (Standard_Integer i=m.Lower(); i<=m.Upper(); i++) { +#if PY_MAJOR_VERSION >= 3 + mults.append(Py::Long(m(i))); +#else mults.append(Py::Int(m(i))); +#endif } return Py::new_reference_to(mults); } @@ -656,32 +664,32 @@ PyObject* BSplineCurve2dPy::getMultiplicities(PyObject * args) } } -Py::Int BSplineCurve2dPy::getDegree(void) const +Py::Long BSplineCurve2dPy::getDegree(void) const { Handle_Geom2d_BSplineCurve curve = Handle_Geom2d_BSplineCurve::DownCast (getGeometry2dPtr()->handle()); - return Py::Int(curve->Degree()); + return Py::Long(curve->Degree()); } -Py::Int BSplineCurve2dPy::getMaxDegree(void) const +Py::Long BSplineCurve2dPy::getMaxDegree(void) const { Handle_Geom2d_BSplineCurve curve = Handle_Geom2d_BSplineCurve::DownCast (getGeometry2dPtr()->handle()); - return Py::Int(curve->MaxDegree()); + return Py::Long(curve->MaxDegree()); } -Py::Int BSplineCurve2dPy::getNbPoles(void) const +Py::Long BSplineCurve2dPy::getNbPoles(void) const { Handle_Geom2d_BSplineCurve curve = Handle_Geom2d_BSplineCurve::DownCast (getGeometry2dPtr()->handle()); - return Py::Int(curve->NbPoles()); + return Py::Long(curve->NbPoles()); } -Py::Int BSplineCurve2dPy::getNbKnots(void) const +Py::Long BSplineCurve2dPy::getNbKnots(void) const { Handle_Geom2d_BSplineCurve curve = Handle_Geom2d_BSplineCurve::DownCast (getGeometry2dPtr()->handle()); - return Py::Int(curve->NbKnots()); + return Py::Long(curve->NbKnots()); } Py::Object BSplineCurve2dPy::getStartPoint(void) const @@ -716,14 +724,22 @@ Py::Object BSplineCurve2dPy::getFirstUKnotIndex(void) const { Handle_Geom2d_BSplineCurve curve = Handle_Geom2d_BSplineCurve::DownCast (getGeometry2dPtr()->handle()); +#if PY_MAJOR_VERSION >= 3 + return Py::Long(curve->FirstUKnotIndex()); +#else return Py::Int(curve->FirstUKnotIndex()); +#endif } Py::Object BSplineCurve2dPy::getLastUKnotIndex(void) const { Handle_Geom2d_BSplineCurve curve = Handle_Geom2d_BSplineCurve::DownCast (getGeometry2dPtr()->handle()); - return Py::Int(curve->LastUKnotIndex()); +#if PY_MAJOR_VERSION >= 3 + return Py::Long(curve->LastUKnotIndex()); +#else + return Py::Int(curve->FirstUKnotIndex()); +#endif } Py::List BSplineCurve2dPy::getKnotSequence(void) const @@ -733,12 +749,12 @@ Py::List BSplineCurve2dPy::getKnotSequence(void) const Standard_Integer m = 0; if (curve->IsPeriodic()) { // knots=poles+2*degree-mult(1)+2 - m = curve->NbPoles() + 2*curve->Degree() - curve->Multiplicity(1) + 2; + m = (int)(curve->NbPoles() + 2*curve->Degree() - curve->Multiplicity(1) + 2); } else { // knots=poles+degree+1 for (int i=1; i<= curve->NbKnots(); i++) - m += curve->Multiplicity(i); + m += (int)curve->Multiplicity(i); } TColStd_Array1OfReal k(1,m); @@ -1208,9 +1224,13 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k Py::Sequence multssq(mults); Standard_Integer index = 1; for (Py::Sequence::iterator it = multssq.begin(); it != multssq.end() && index <= occmults.Length(); ++it) { +#if PY_MAJOR_VERSION >=3 + Py::Long mult(*it); +#else Py::Int mult(*it); +#endif if (index < occmults.Length() || PyObject_Not(periodic)) { - sum_of_mults += mult; //sum up the mults to compare them against the number of poles later + sum_of_mults += (int)mult; //sum up the mults to compare them against the number of poles later } occmults(index++) = mult; } diff --git a/src/Mod/Part/App/Geom2d/BezierCurve2dPy.xml b/src/Mod/Part/App/Geom2d/BezierCurve2dPy.xml index 0f69c0e05..c0bd222a5 100644 --- a/src/Mod/Part/App/Geom2d/BezierCurve2dPy.xml +++ b/src/Mod/Part/App/Geom2d/BezierCurve2dPy.xml @@ -24,21 +24,21 @@ Returns the polynomial degree of this Bezier curve, which is equal to the number of poles minus 1. - + Returns the value of the maximum polynomial degree of any Bezier curve curve. This value is 25. - + Returns the number of poles of this Bezier curve. - + diff --git a/src/Mod/Part/App/Geom2d/BezierCurve2dPyImp.cpp b/src/Mod/Part/App/Geom2d/BezierCurve2dPyImp.cpp index 15d9605e3..002d139d2 100644 --- a/src/Mod/Part/App/Geom2d/BezierCurve2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/BezierCurve2dPyImp.cpp @@ -362,26 +362,25 @@ PyObject* BezierCurve2dPy::getResolution(PyObject* args) return 0; } } - -Py::Int BezierCurve2dPy::getDegree(void) const +Py::Long BezierCurve2dPy::getDegree(void) const { Handle_Geom2d_BezierCurve curve = Handle_Geom2d_BezierCurve::DownCast (getGeometry2dPtr()->handle()); - return Py::Int(curve->Degree()); + return Py::Long(curve->Degree()); } -Py::Int BezierCurve2dPy::getMaxDegree(void) const +Py::Long BezierCurve2dPy::getMaxDegree(void) const { Handle_Geom2d_BezierCurve curve = Handle_Geom2d_BezierCurve::DownCast (getGeometry2dPtr()->handle()); - return Py::Int(curve->MaxDegree()); + return Py::Long(curve->MaxDegree()); } -Py::Int BezierCurve2dPy::getNbPoles(void) const +Py::Long BezierCurve2dPy::getNbPoles(void) const { Handle_Geom2d_BezierCurve curve = Handle_Geom2d_BezierCurve::DownCast (getGeometry2dPtr()->handle()); - return Py::Int(curve->NbPoles()); + return Py::Long(curve->NbPoles()); } Py::Object BezierCurve2dPy::getStartPoint(void) const diff --git a/src/Mod/Part/App/PropertyTopoShape.cpp b/src/Mod/Part/App/PropertyTopoShape.cpp index d323ad69b..726e0a69e 100644 --- a/src/Mod/Part/App/PropertyTopoShape.cpp +++ b/src/Mod/Part/App/PropertyTopoShape.cpp @@ -501,7 +501,11 @@ PyObject *PropertyFilletEdges::getPyObject(void) int index = 0; for (it = _lValueList.begin(); it != _lValueList.end(); ++it) { Py::Tuple ent(3); +#if PY_MAJOR_VERSION >= 3 ent.setItem(0, Py::Long(it->edgeid)); +#else + ent.setItem(0, Py::Int(it->edgeid)); +#endif ent.setItem(1, Py::Float(it->radius1)); ent.setItem(2, Py::Float(it->radius2)); list[index++] = ent; @@ -518,7 +522,11 @@ void PropertyFilletEdges::setPyObject(PyObject *value) for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { FilletElement fe; Py::Tuple ent(*it); +#if PY_MAJOR_VERSION >= 3 fe.edgeid = (int)Py::Long(ent.getItem(0)); +#else + fe.edgeid = (int)Py::Int(ent.getItem(0)); +#endif fe.radius1 = (double)Py::Float(ent.getItem(1)); fe.radius2 = (double)Py::Float(ent.getItem(2)); values.push_back(fe); diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index 882005f55..274f1e19b 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -1870,9 +1870,15 @@ PyObject* TopoShapePy::makeShapeFromMesh(PyObject *args) for (Py::Sequence::iterator it = facets.begin(); it != facets.end(); ++it) { Data::ComplexGeoData::Facet face; Py::Tuple f(*it); +#if PY_MAJOR_VERSION >= 3 face.I1 = (int)Py::Long(f[0]); face.I2 = (int)Py::Long(f[1]); face.I3 = (int)Py::Long(f[2]); +#else + face.I1 = (int)Py::Int(f[0]); + face.I2 = (int)Py::Int(f[1]); + face.I3 = (int)Py::Int(f[2]); +#endif Facets.push_back(face); } @@ -2290,11 +2296,19 @@ PyObject* TopoShapePy::proximity(PyObject *args) for (BRepExtrema_OverlappedSubShapes::Iterator anIt1 (proximity.OverlapSubShapes1()); anIt1.More(); anIt1.Next()) { //PyList_Append(overlappss1, new TopoShapeFacePy(new TopoShape(proximity.GetSubShape1 (anIt1.Key())))); +#if PY_MAJOR_VERSION >= 3 + PyList_Append(overlappssindex1,PyLong_FromLong(anIt1.Key()+1)); +#else PyList_Append(overlappssindex1,PyInt_FromLong(anIt1.Key()+1)); +#endif } for (BRepExtrema_OverlappedSubShapes::Iterator anIt2 (proximity.OverlapSubShapes2()); anIt2.More(); anIt2.Next()) { //PyList_Append(overlappss2, new TopoShapeFacePy(new TopoShape(proximity.GetSubShape2 (anIt2.Key())))); +#if PY_MAJOR_VERSION >= 3 + PyList_Append(overlappssindex2,PyLong_FromLong(anIt2.Key()+1)); +#else PyList_Append(overlappssindex2,PyInt_FromLong(anIt2.Key()+1)); +#endif } //return Py_BuildValue("OO", overlappss1, overlappss2); //subshapes return Py_BuildValue("OO", overlappssindex1, overlappssindex2); //face indexes