Sketcher: remove Py2 code from Sketcher wb
This commit is contained in:
@@ -227,13 +227,8 @@ PyObject* SketchObjectPy::delGeometries(PyObject *args)
|
||||
std::vector<int> geoIdList;
|
||||
Py::Sequence list(pcObj);
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
if (PyLong_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
|
||||
#else
|
||||
if (PyInt_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
|
||||
#endif
|
||||
}
|
||||
|
||||
if(this->getSketchObjectPtr()->delGeometries(geoIdList)) {
|
||||
@@ -1139,13 +1134,8 @@ PyObject* SketchObjectPy::addSymmetric(PyObject *args)
|
||||
std::vector<int> geoIdList;
|
||||
Py::Sequence list(pcObj);
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
if (PyLong_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
|
||||
#else
|
||||
if (PyInt_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
|
||||
#endif
|
||||
}
|
||||
|
||||
int ret = this->getSketchObjectPtr()->addSymmetric(geoIdList,refGeoId,(Sketcher::PointPos) refPosId) + 1;
|
||||
@@ -1183,13 +1173,8 @@ PyObject* SketchObjectPy::addCopy(PyObject *args)
|
||||
std::vector<int> geoIdList;
|
||||
Py::Sequence list(pcObj);
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
if (PyLong_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
|
||||
#else
|
||||
if (PyInt_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
|
||||
#endif
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -1232,13 +1217,8 @@ PyObject* SketchObjectPy::addMove(PyObject *args)
|
||||
std::vector<int> geoIdList;
|
||||
Py::Sequence list(pcObj);
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
if (PyLong_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
|
||||
#else
|
||||
if (PyInt_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
|
||||
#endif
|
||||
}
|
||||
|
||||
this->getSketchObjectPtr()->addCopy(geoIdList, vect, true);
|
||||
@@ -1270,13 +1250,8 @@ PyObject* SketchObjectPy::addRectangularArray(PyObject *args)
|
||||
std::vector<int> geoIdList;
|
||||
Py::Sequence list(pcObj);
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
if (PyLong_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
|
||||
#else
|
||||
if (PyInt_Check((*it).ptr()))
|
||||
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
|
||||
#endif
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user