diff --git a/src/App/ApplicationPy.cpp b/src/App/ApplicationPy.cpp index 33ad33c5ad..42d8942b33 100644 --- a/src/App/ApplicationPy.cpp +++ b/src/App/ApplicationPy.cpp @@ -1042,7 +1042,7 @@ PyObject* Application::sCheckLinkDepth(PyObject* /*self*/, PyObject* args) PY_TRY { return Py::new_reference_to( - Py::Int(GetApplication().checkLinkDepth(depth, MessageOption::Throw))); + Py::Long(GetApplication().checkLinkDepth(depth, MessageOption::Throw))); } PY_CATCH; } @@ -1132,7 +1132,7 @@ PyObject* Application::sSetActiveTransaction(PyObject* /*self*/, PyObject* args) PY_TRY { - Py::Int ret(GetApplication().setActiveTransaction(name, Base::asBoolean(persist))); + Py::Long ret(GetApplication().setActiveTransaction(name, Base::asBoolean(persist))); return Py::new_reference_to(ret); } PY_CATCH; @@ -1153,7 +1153,7 @@ PyObject* Application::sGetActiveTransaction(PyObject* /*self*/, PyObject* args) } Py::Tuple ret(2); ret.setItem(0, Py::String(name)); - ret.setItem(1, Py::Int(id)); + ret.setItem(1, Py::Long(id)); return Py::new_reference_to(ret); } PY_CATCH; diff --git a/src/App/ComplexGeoDataPy.xml b/src/App/ComplexGeoDataPy.xml index 7b094cb3dd..00fb61f10b 100644 --- a/src/App/ComplexGeoDataPy.xml +++ b/src/App/ComplexGeoDataPy.xml @@ -117,7 +117,7 @@ Geometry Tag - + @@ -129,7 +129,7 @@ Get the current element map size - + diff --git a/src/App/ComplexGeoDataPyImp.cpp b/src/App/ComplexGeoDataPyImp.cpp index 878876d9c4..768229a569 100644 --- a/src/App/ComplexGeoDataPyImp.cpp +++ b/src/App/ComplexGeoDataPyImp.cpp @@ -110,9 +110,9 @@ PyObject* ComplexGeoDataPy::getFacesFromSubElement(PyObject* args) Py::List facet; for (const auto& it : facets) { Py::Tuple f(3); - f.setItem(0, Py::Int(int(it.I1))); - f.setItem(1, Py::Int(int(it.I2))); - f.setItem(2, Py::Int(int(it.I3))); + f.setItem(0, Py::Long(int(it.I1))); + f.setItem(1, Py::Long(int(it.I2))); + f.setItem(2, Py::Long(int(it.I3))); facet.append(f); } tuple.setItem(1, facet); @@ -147,8 +147,8 @@ PyObject* ComplexGeoDataPy::getLinesFromSubElement(PyObject* args) Py::List line; for (const auto& it : lines) { Py::Tuple l(2); - l.setItem(0, Py::Int((int)it.I1)); - l.setItem(1, Py::Int((int)it.I2)); + l.setItem(0, Py::Long((int)it.I1)); + l.setItem(1, Py::Long((int)it.I2)); line.append(l); } tuple.setItem(1, line); @@ -213,8 +213,8 @@ PyObject* ComplexGeoDataPy::getLines(PyObject* args) Py::List line; for (const auto& it : lines) { Py::Tuple l(2); - l.setItem(0, Py::Int((int)it.I1)); - l.setItem(1, Py::Int((int)it.I2)); + l.setItem(0, Py::Long((int)it.I1)); + l.setItem(1, Py::Long((int)it.I2)); line.append(l); } tuple.setItem(1, line); @@ -247,9 +247,9 @@ PyObject* ComplexGeoDataPy::getFaces(PyObject* args) Py::List facet; for (const auto& it : facets) { Py::Tuple f(3); - f.setItem(0, Py::Int((int)it.I1)); - f.setItem(1, Py::Int((int)it.I2)); - f.setItem(2, Py::Int((int)it.I3)); + f.setItem(0, Py::Long((int)it.I1)); + f.setItem(1, Py::Long((int)it.I2)); + f.setItem(2, Py::Long((int)it.I3)); facet.append(f); } tuple.setItem(1, facet); @@ -509,9 +509,9 @@ Py::Dict ComplexGeoDataPy::getElementReverseMap() const return ret; } -Py::Int ComplexGeoDataPy::getElementMapSize() const +Py::Long ComplexGeoDataPy::getElementMapSize() const { - return Py::Int((long)getComplexGeoDataPtr()->getElementMapSize()); + return Py::Long((long)getComplexGeoDataPtr()->getElementMapSize()); } void ComplexGeoDataPy::setHasher(Py::Object obj) @@ -575,12 +575,12 @@ Py::String ComplexGeoDataPy::getElementMapVersion() const } -Py::Int ComplexGeoDataPy::getTag() const +Py::Long ComplexGeoDataPy::getTag() const { - return Py::Int(getComplexGeoDataPtr()->Tag); + return Py::Long(getComplexGeoDataPtr()->Tag); } -void ComplexGeoDataPy::setTag(Py::Int tag) +void ComplexGeoDataPy::setTag(Py::Long tag) { getComplexGeoDataPtr()->Tag = tag; } diff --git a/src/App/DocumentObjectPy.xml b/src/App/DocumentObjectPy.xml index cb93c974db..ea63126b17 100644 --- a/src/App/DocumentObjectPy.xml +++ b/src/App/DocumentObjectPy.xml @@ -305,7 +305,7 @@ or None if the GUI is not up The unique identifier (among its document) of this object - + diff --git a/src/App/DocumentObjectPyImp.cpp b/src/App/DocumentObjectPyImp.cpp index c6e2e32b20..5ca4a9185b 100644 --- a/src/App/DocumentObjectPyImp.cpp +++ b/src/App/DocumentObjectPyImp.cpp @@ -898,9 +898,9 @@ int DocumentObjectPy::setCustomAttributes(const char*, PyObject*) return 0; } -Py::Int DocumentObjectPy::getID() const +Py::Long DocumentObjectPy::getID() const { - return Py::Int(getDocumentObjectPtr()->getID()); + return Py::Long(getDocumentObjectPtr()->getID()); } Py::Boolean DocumentObjectPy::getRemoving() const diff --git a/src/App/DocumentPy.xml b/src/App/DocumentPy.xml index 2e929d7ac1..55fcc7ef13 100644 --- a/src/App/DocumentPy.xml +++ b/src/App/DocumentPy.xml @@ -313,25 +313,25 @@ sort: whether to topologically sort the return list The Undo mode of the Document (0 = no Undo, 1 = Undo/Redo) - + The size of the Undo stack in byte - + Number of possible Undos - + Number of possible Redos - + diff --git a/src/App/DocumentPyImp.cpp b/src/App/DocumentPyImp.cpp index c10db56c8c..22918cd8a5 100644 --- a/src/App/DocumentPyImp.cpp +++ b/src/App/DocumentPyImp.cpp @@ -388,7 +388,7 @@ PyObject* DocumentPy::addObject(PyObject* args, PyObject* kwd) pyvp = Py::Object(view); } if (pyvp.isNone()) { - pyvp = Py::Int(1); + pyvp = Py::Long(1); } // 'pyvp' is the python class with the implementation for ViewProvider if (pyvp.hasAttr("__vobject__")) { @@ -695,7 +695,7 @@ PyObject* DocumentPy::recompute(PyObject* args) return nullptr; } - return Py::new_reference_to(Py::Int(objectCount)); + return Py::new_reference_to(Py::Long(objectCount)); } PY_CATCH; } @@ -890,30 +890,30 @@ Py::List DocumentPy::getRootObjectsIgnoreLinks() const return res; } -Py::Int DocumentPy::getUndoMode() const +Py::Long DocumentPy::getUndoMode() const { - return Py::Int(getDocumentPtr()->getUndoMode()); + return Py::Long(getDocumentPtr()->getUndoMode()); } -void DocumentPy::setUndoMode(Py::Int arg) +void DocumentPy::setUndoMode(Py::Long arg) { getDocumentPtr()->setUndoMode(arg); } -Py::Int DocumentPy::getUndoRedoMemSize() const +Py::Long DocumentPy::getUndoRedoMemSize() const { - return Py::Int((long)getDocumentPtr()->getUndoMemSize()); + return Py::Long((long)getDocumentPtr()->getUndoMemSize()); } -Py::Int DocumentPy::getUndoCount() const +Py::Long DocumentPy::getUndoCount() const { - return Py::Int((long)getDocumentPtr()->getAvailableUndos()); + return Py::Long((long)getDocumentPtr()->getAvailableUndos()); } -Py::Int DocumentPy::getRedoCount() const +Py::Long DocumentPy::getRedoCount() const { - return Py::Int((long)getDocumentPtr()->getAvailableRedos()); + return Py::Long((long)getDocumentPtr()->getAvailableRedos()); } Py::List DocumentPy::getUndoNames() const diff --git a/src/App/FeaturePython.cpp b/src/App/FeaturePython.cpp index fdb7640821..c4188223c9 100644 --- a/src/App/FeaturePython.cpp +++ b/src/App/FeaturePython.cpp @@ -278,14 +278,14 @@ bool FeaturePythonImp::getSubObject(DocumentObject*& ret, subname = ""; } args.setItem(1, Py::String(subname)); - args.setItem(2, Py::Int(pyObj ? 2 : 1)); + args.setItem(2, Py::Long(pyObj ? 2 : 1)); Base::MatrixPy* pyMat = new Base::MatrixPy(new Base::Matrix4D); if (_mat) { *pyMat->getMatrixPtr() = *_mat; } args.setItem(3, Py::asObject(pyMat)); args.setItem(4, Py::Boolean(transform)); - args.setItem(5, Py::Int(depth)); + args.setItem(5, Py::Long(depth)); Py::Object res(Base::pyCall(py_getSubObject.ptr(), args.ptr())); if (res.isNone()) { @@ -343,7 +343,7 @@ bool FeaturePythonImp::getSubObjects(std::vector& ret, int reason) try { Py::Tuple args(2); args.setItem(0, Py::Object(object->getPyObject(), true)); - args.setItem(1, Py::Int(reason)); + args.setItem(1, Py::Long(reason)); Py::Object res(Base::pyCall(py_getSubObjects.ptr(), args.ptr())); if (!res.isTrue()) { return true; @@ -390,7 +390,7 @@ bool FeaturePythonImp::getLinkedObject(DocumentObject*& ret, } args.setItem(2, Py::asObject(pyMat)); args.setItem(3, Py::Boolean(transform)); - args.setItem(4, Py::Int(depth)); + args.setItem(4, Py::Long(depth)); Py::Object res(Base::pyCall(py_getLinkedObject.ptr(), args.ptr())); if (!res.isTrue()) { @@ -466,7 +466,7 @@ int FeaturePythonImp::isElementVisible(const char* element) const Py::Tuple args(2); args.setItem(0, Py::Object(object->getPyObject(), true)); args.setItem(1, Py::String(element ? element : "")); - return Py::Int(Base::pyCall(py_isElementVisible.ptr(), args.ptr())); + return Py::Long(Base::pyCall(py_isElementVisible.ptr(), args.ptr())); } catch (Py::Exception&) { if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) { @@ -488,7 +488,7 @@ int FeaturePythonImp::setElementVisible(const char* element, bool visible) args.setItem(0, Py::Object(object->getPyObject(), true)); args.setItem(1, Py::String(element ? element : "")); args.setItem(2, Py::Boolean(visible)); - return Py::Int(Base::pyCall(py_setElementVisible.ptr(), args.ptr())); + return Py::Long(Base::pyCall(py_setElementVisible.ptr(), args.ptr())); } catch (Py::Exception&) { if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) { @@ -568,7 +568,7 @@ int FeaturePythonImp::canLoadPartial() const try { Py::Tuple args(1); args.setItem(0, Py::Object(object->getPyObject(), true)); - Py::Int ret(Base::pyCall(py_canLoadPartial.ptr(), args.ptr())); + Py::Long ret(Base::pyCall(py_canLoadPartial.ptr(), args.ptr())); return ret; } catch (Py::Exception&) { diff --git a/src/App/Link.cpp b/src/App/Link.cpp index 658668775e..5703c39f00 100644 --- a/src/App/Link.cpp +++ b/src/App/Link.cpp @@ -409,7 +409,7 @@ App::DocumentObjectExecReturn* LinkBaseExtension::extensionExecute() else { const auto& elements = _getElementListValue(); for (int i = 0; i < _getElementCountValue(); ++i) { - args.setItem(2, Py::Int(i)); + args.setItem(2, Py::Long(i)); if (i < (int)elements.size()) { args.setItem(3, Py::asObject(elements[i]->getPyObject())); } diff --git a/src/App/LinkBaseExtensionPyImp.cpp b/src/App/LinkBaseExtensionPyImp.cpp index 5cf44fea82..16b900fae5 100644 --- a/src/App/LinkBaseExtensionPyImp.cpp +++ b/src/App/LinkBaseExtensionPyImp.cpp @@ -258,7 +258,7 @@ PyObject* LinkBaseExtensionPy::setLink(PyObject* _args) PyObject *key, *value; Py_ssize_t pos = 0; while (PyDict_Next(pcObj, &pos, &key, &value)) { - parseLink(ext, Py::Int(key), value); + parseLink(ext, Py::Long(key), value); } } else if (PySequence_Check(pcObj)) { diff --git a/src/App/ObjectIdentifier.cpp b/src/App/ObjectIdentifier.cpp index fd4d2871d3..28637d638a 100644 --- a/src/App/ObjectIdentifier.cpp +++ b/src/App/ObjectIdentifier.cpp @@ -692,7 +692,7 @@ Py::Object ObjectIdentifier::Component::get(const Py::Object& pyobj) const } else if (isArray()) { if (pyobj.isMapping()) { - res = Py::Mapping(pyobj).getItem(Py::Int(begin)); + res = Py::Mapping(pyobj).getItem(Py::Long(begin)); } else { res = Py::Sequence(pyobj).getItem(begin); @@ -703,9 +703,9 @@ Py::Object ObjectIdentifier::Component::get(const Py::Object& pyobj) const } else { assert(isRange()); - Py::Object slice(PySlice_New(Py::Int(begin).ptr(), - end != INT_MAX ? Py::Int(end).ptr() : nullptr, - step != 1 ? Py::Int(step).ptr() : nullptr), + Py::Object slice(PySlice_New(Py::Long(begin).ptr(), + end != INT_MAX ? Py::Long(end).ptr() : nullptr, + step != 1 ? Py::Long(step).ptr() : nullptr), true); PyObject* r = PyObject_GetItem(pyobj.ptr(), slice.ptr()); if (!r) { @@ -731,7 +731,7 @@ void ObjectIdentifier::Component::set(Py::Object& pyobj, const Py::Object& value } else if (isArray()) { if (pyobj.isMapping()) { - Py::Mapping(pyobj).setItem(Py::Int(begin), value); + Py::Mapping(pyobj).setItem(Py::Long(begin), value); } else { Py::Sequence(pyobj).setItem(begin, value); @@ -742,9 +742,9 @@ void ObjectIdentifier::Component::set(Py::Object& pyobj, const Py::Object& value } else { assert(isRange()); - Py::Object slice(PySlice_New(Py::Int(begin).ptr(), - end != INT_MAX ? Py::Int(end).ptr() : nullptr, - step != 1 ? Py::Int(step).ptr() : nullptr), + Py::Object slice(PySlice_New(Py::Long(begin).ptr(), + end != INT_MAX ? Py::Long(end).ptr() : nullptr, + step != 1 ? Py::Long(step).ptr() : nullptr), true); if (PyObject_SetItem(pyobj.ptr(), slice.ptr(), value.ptr()) < 0) { Base::PyException::ThrowException(); @@ -759,7 +759,7 @@ void ObjectIdentifier::Component::del(Py::Object& pyobj) const } else if (isArray()) { if (pyobj.isMapping()) { - Py::Mapping(pyobj).delItem(Py::Int(begin)); + Py::Mapping(pyobj).delItem(Py::Long(begin)); } else { PySequence_DelItem(pyobj.ptr(), begin); @@ -770,9 +770,9 @@ void ObjectIdentifier::Component::del(Py::Object& pyobj) const } else { assert(isRange()); - Py::Object slice(PySlice_New(Py::Int(begin).ptr(), - end != INT_MAX ? Py::Int(end).ptr() : nullptr, - step != 1 ? Py::Int(step).ptr() : nullptr), + Py::Object slice(PySlice_New(Py::Long(begin).ptr(), + end != INT_MAX ? Py::Long(end).ptr() : nullptr, + step != 1 ? Py::Long(step).ptr() : nullptr), true); if (PyObject_DelItem(pyobj.ptr(), slice.ptr()) < 0) { Base::PyException::ThrowException(); diff --git a/src/App/PropertyContainerPyImp.cpp b/src/App/PropertyContainerPyImp.cpp index 31913df300..6cff166d53 100644 --- a/src/App/PropertyContainerPyImp.cpp +++ b/src/App/PropertyContainerPyImp.cpp @@ -284,7 +284,7 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject* args) status.set(it->second, value); } else if (item.isNumeric()) { - int v = Py::Int(item); + int v = Py::Long(item); if (v < 0) { value = false; v = -v; @@ -345,7 +345,7 @@ PyObject* PropertyContainerPy::getPropertyStatus(PyObject* args) } } if (!found) { - ret.append(Py::Int(static_cast(i))); + ret.append(Py::Long(static_cast(i))); } } } diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index 148c846708..9eb638ad91 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -491,7 +491,7 @@ void PropertyEnumeration::setPyObject(PyObject* value) if (seq.size() == 2) { Py::Object v(seq[0].ptr()); if (!v.isString() && v.isSequence()) { - idx = Py::Int(seq[1].ptr()); + idx = Py::Long(seq[1].ptr()); seq = v; } } @@ -608,7 +608,7 @@ bool PropertyEnumeration::getPyPathValue(const ObjectIdentifier& path, Py::Objec else { Py::Tuple tuple(2); tuple.setItem(0, res); - tuple.setItem(1, Py::Int(getValue())); + tuple.setItem(1, Py::Long(getValue())); r = tuple; } } @@ -617,7 +617,7 @@ bool PropertyEnumeration::getPyPathValue(const ObjectIdentifier& path, Py::Objec r = Py::String(v ? v : ""); } else { - r = Py::Int(getValue()); + r = Py::Long(getValue()); } return true; } diff --git a/src/App/StringHasherPy.xml b/src/App/StringHasherPy.xml index ff7d8e1dbf..dc37148184 100644 --- a/src/App/StringHasherPy.xml +++ b/src/App/StringHasherPy.xml @@ -40,13 +40,13 @@ base64: indicate if the input 'txt' is base64 encoded binary data Return count of used hashes - + Return the size of the hashes - + @@ -58,7 +58,7 @@ base64: indicate if the input 'txt' is base64 encoded binary data Data length exceed this threshold will be hashed before storing - + diff --git a/src/App/StringIDPy.xml b/src/App/StringIDPy.xml index de77d7c97a..acee95d628 100644 --- a/src/App/StringIDPy.xml +++ b/src/App/StringIDPy.xml @@ -24,7 +24,7 @@ Return the integer value of this ID - + @@ -54,7 +54,7 @@ Geometry index. Only meaningful for geometry element name - + private: friend class StringID; diff --git a/src/Base/MatrixPyImp.cpp b/src/Base/MatrixPyImp.cpp index fbd21b4688..029f57af2c 100644 --- a/src/Base/MatrixPyImp.cpp +++ b/src/Base/MatrixPyImp.cpp @@ -212,7 +212,7 @@ PyObject* MatrixPy::number_power_handler(PyObject* self, PyObject* other, PyObje Base::Matrix4D a = static_cast(self)->value(); - long b = Py::Int(other); + long b = Py::Long(other); if (b == 0) { return new MatrixPy(Matrix4D()); } @@ -363,7 +363,7 @@ PyObject* MatrixPy::hasScale(PyObject* args) ScaleType type = getMatrixPtr()->hasScale(tol); Py::Module mod("FreeCAD"); return Py::new_reference_to( - mod.callMemberFunction("ScaleType", Py::TupleN(Py::Int(static_cast(type))))); + mod.callMemberFunction("ScaleType", Py::TupleN(Py::Long(static_cast(type))))); } PyObject* MatrixPy::decompose(PyObject* args) diff --git a/src/Base/PersistencePy.xml b/src/Base/PersistencePy.xml index 4638e43e01..d8ffbd55cf 100644 --- a/src/Base/PersistencePy.xml +++ b/src/Base/PersistencePy.xml @@ -26,7 +26,7 @@ Class to dump and restore the content of an object. Memory size of the object in bytes. - + diff --git a/src/Base/PersistencePyImp.cpp b/src/Base/PersistencePyImp.cpp index 3c9f72d323..7e98b25631 100644 --- a/src/Base/PersistencePyImp.cpp +++ b/src/Base/PersistencePyImp.cpp @@ -52,9 +52,9 @@ Py::String PersistencePy::getContent() const return {writer.getString()}; } -Py::Int PersistencePy::getMemSize() const +Py::Long PersistencePy::getMemSize() const { - return Py::Int((long)getPersistencePtr()->getMemSize()); + return Py::Long((long)getPersistencePtr()->getMemSize()); } PyObject* PersistencePy::dumpContent(PyObject* args, PyObject* kwds) diff --git a/src/Base/QuantityPyImp.cpp b/src/Base/QuantityPyImp.cpp index 5cf7514852..85078c38f6 100644 --- a/src/Base/QuantityPyImp.cpp +++ b/src/Base/QuantityPyImp.cpp @@ -641,9 +641,9 @@ Py::Dict QuantityPy::getFormat() const QuantityFormat fmt = getQuantityPtr()->getFormat(); Py::Dict dict; - dict.setItem("Precision", Py::Int(fmt.precision)); + dict.setItem("Precision", Py::Long(fmt.precision)); dict.setItem("NumberFormat", Py::Char(fmt.toFormat())); - dict.setItem("Denominator", Py::Int(fmt.denominator)); + dict.setItem("Denominator", Py::Long(fmt.denominator)); return dict; } @@ -652,14 +652,14 @@ void QuantityPy::setFormat(Py::Dict arg) QuantityFormat fmt = getQuantityPtr()->getFormat(); if (arg.hasKey("Precision")) { - Py::Int prec(arg.getItem("Precision")); + Py::Long prec(arg.getItem("Precision")); fmt.precision = static_cast(prec); } if (arg.hasKey("NumberFormat")) { Py::Object item = arg.getItem("NumberFormat"); if (item.isNumeric()) { - int format = static_cast(Py::Int(item)); + int format = static_cast(Py::Long(item)); if (format < 0 || format > QuantityFormat::Scientific) { throw Py::ValueError("Invalid format value"); } @@ -681,7 +681,7 @@ void QuantityPy::setFormat(Py::Dict arg) } if (arg.hasKey("Denominator")) { - Py::Int denom(arg.getItem("Denominator")); + Py::Long denom(arg.getItem("Denominator")); int fracInch = static_cast(denom); // check that the value is positive and a power of 2 if (fracInch <= 0) { diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index 6e9c9da4bf..c2ac117e14 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -1560,7 +1560,7 @@ void PythonGroupCommand::activated(int iMsg) if (cmd.hasAttr("Activated")) { Py::Callable call(cmd.getAttr("Activated")); Py::Tuple args(1); - args.setItem(0, Py::Int(iMsg)); + args.setItem(0, Py::Long(iMsg)); Py::Object ret = call.apply(args); } // If the command group doesn't implement the 'Activated' method then invoke the command directly @@ -1640,7 +1640,7 @@ Action * PythonGroupCommand::createAction() if (cmd.hasAttr("GetDefaultCommand")) { Py::Callable call2(cmd.getAttr("GetDefaultCommand")); - Py::Int def(call2.apply(args)); + Py::Long def(call2.apply(args)); defaultId = static_cast(def); } diff --git a/src/Gui/DocumentPy.xml b/src/Gui/DocumentPy.xml index da3a79186c..2823a7acc4 100644 --- a/src/Gui/DocumentPy.xml +++ b/src/Gui/DocumentPy.xml @@ -15,106 +15,106 @@ - show(objName) -> None + show(objName) -> None -Show an object. +Show an object. -objName : str +objName : str Name of the `Gui.ViewProvider` to show. - hide(objName) -> None + hide(objName) -> None -Hide an object. +Hide an object. -objName : str +objName : str Name of the `Gui.ViewProvider` to hide. - setPos(objName, matrix) -> None + setPos(objName, matrix) -> None -Set the position of an object. +Set the position of an object. -objName : str - Name of the `Gui.ViewProvider`. +objName : str + Name of the `Gui.ViewProvider`. -matrix : Base.Matrix +matrix : Base.Matrix Transformation to apply on the object. - setEdit(obj, mod=0, subName) -> bool + setEdit(obj, mod=0, subName) -> bool -Set an object in edit mode. +Set an object in edit mode. -obj : str, App.DocumentObject, Gui.ViewPrivider +obj : str, App.DocumentObject, Gui.ViewPrivider Object to set in edit mode. -mod : int +mod : int Edit mode. -subName : str +subName : str Subelement name. Optional. - getInEdit() -> Gui.ViewProviderDocumentObject or None + getInEdit() -> Gui.ViewProviderDocumentObject or None Returns the current object in edit mode or None if there is no such object. - resetEdit() -> None + resetEdit() -> None End the current editing. - addAnnotation(annoName, fileName, modName) -> None + addAnnotation(annoName, fileName, modName) -> None -Add an Inventor object from a file. +Add an Inventor object from a file. -annoName : str +annoName : str Annotation name. -fileName : str +fileName : str File name. -modName : str +modName : str Display mode name. Optional. - update() -> None + update() -> None Update the view representations of all objects. - getObject(objName) -> object or None + getObject(objName) -> object or None -Return the object with the given name. If no one exists, return None. +Return the object with the given name. If no one exists, return None. -ObjName : str +ObjName : str Object name. - activeObject() -> object or None + activeObject() -> object or None The active object of the document. Deprecated, use ActiveObject. - activeView() -> object or None + activeView() -> object or None The active view of the document. Deprecated, use ActiveView. @@ -131,76 +131,76 @@ type : str - mdiViewsOfType(type) -> list of MDIView + mdiViewsOfType(type) -> list of MDIView -Return a list of mdi views of a given type. +Return a list of mdi views of a given type. -type : str +type : str Type name. - save() -> bool + save() -> bool Attempts to save the document - saveAs() -> bool + saveAs() -> bool Attempts to save the document under a new name - sendMsgToViews(msg) -> None + sendMsgToViews(msg) -> None -Send a message to all views of the document. +Send a message to all views of the document. msg : str - mergeProject(fileName) -> None + mergeProject(fileName) -> None -Merges this document with another project file. +Merges this document with another project file. -fileName : str +fileName : str File name. - toggleTreeItem(obj, mod=0, subName) -> None + toggleTreeItem(obj, mod=0, subName) -> None -Change TreeItem of a document object. +Change TreeItem of a document object. obj : App.DocumentObject -mod : int +mod : int Item mode. 0: Toggle, 1: Collapse, 2: Expand, 3: Expand path. -subName : str +subName : str Subelement name. Optional. - scrollToTreeItem(obj) -> None + scrollToTreeItem(obj) -> None -Scroll the tree view to the item of a view object. +Scroll the tree view to the item of a view object. obj : Gui.ViewProviderDocumentObject - toggleInSceneGraph(obj) -> None + toggleInSceneGraph(obj) -> None -Add or remove view object from scene graph of all views depending -on its canAddToSceneGraph(). +Add or remove view object from scene graph of all views depending +on its canAddToSceneGraph(). obj : Gui.ViewProvider @@ -233,7 +233,7 @@ obj : Gui.ViewProvider Current edit mode. Only meaningful when there is a current object in edit. - + diff --git a/src/Gui/DocumentPyImp.cpp b/src/Gui/DocumentPyImp.cpp index ed89f6c7e2..d982541749 100644 --- a/src/Gui/DocumentPyImp.cpp +++ b/src/Gui/DocumentPyImp.cpp @@ -494,7 +494,7 @@ Py::Object DocumentPy::getInEditInfo() const { return Py::None(); return Py::TupleN(Py::Object(vp->getObject()->getPyObject(),true), - Py::String(subname),Py::String(subelement),Py::Int(mode)); + Py::String(subname),Py::String(subelement),Py::Long(mode)); } void DocumentPy::setInEditInfo(Py::Object arg) @@ -509,12 +509,12 @@ void DocumentPy::setInEditInfo(Py::Object arg) pyobj)->getViewProviderDocumentObjectPtr(),subname); } -Py::Int DocumentPy::getEditMode() const +Py::Long DocumentPy::getEditMode() const { int mode = -1; getDocumentPtr()->getInEdit(nullptr,nullptr,&mode); - return Py::Int(mode); + return Py::Long(mode); } Py::Boolean DocumentPy::getTransacting() const diff --git a/src/Gui/LinkViewPy.xml b/src/Gui/LinkViewPy.xml index 9341090f85..cf00ba3eac 100644 --- a/src/Gui/LinkViewPy.xml +++ b/src/Gui/LinkViewPy.xml @@ -154,7 +154,7 @@ Return a tuple(path,detail) for the coin3D SoPath and SoDetail of the element Set the element size to create an array of linked object - + diff --git a/src/Gui/LinkViewPyImp.cpp b/src/Gui/LinkViewPyImp.cpp index c7cccdd198..efc738216f 100644 --- a/src/Gui/LinkViewPyImp.cpp +++ b/src/Gui/LinkViewPyImp.cpp @@ -83,7 +83,7 @@ PyObject* LinkViewPy::setMaterial(PyObject *args) { Py_ssize_t pos = 0; std::map materials; while(PyDict_Next(pyObj, &pos, &key, &value)) { - Py::Int idx(key); + Py::Long idx(key); if(value == Py_None) materials[(int)idx] = nullptr; else if(!PyObject_TypeCheck(value,&App::MaterialPy::Type)) { @@ -135,7 +135,7 @@ PyObject* LinkViewPy::setTransform(PyObject *args) { Py_ssize_t pos = 0; std::map mat; while(PyDict_Next(pyObj, &pos, &key, &value)) { - Py::Int idx(key); + Py::Long idx(key); if(!PyObject_TypeCheck(value,&Base::MatrixPy::Type)) { PyErr_SetString(PyExc_TypeError, "exepcting a type of Matrix"); return nullptr; @@ -384,11 +384,11 @@ PyObject* LinkViewPy::getChildren(PyObject *args) { return Py::new_reference_to(ret); } -Py::Int LinkViewPy::getCount() const { - return Py::Int(getLinkViewPtr()->getSize()); +Py::Long LinkViewPy::getCount() const { + return Py::Long(getLinkViewPtr()->getSize()); } -void LinkViewPy::setCount(Py::Int count) { +void LinkViewPy::setCount(Py::Long count) { try { getLinkViewPtr()->setSize((int)count); } catch (const Base::Exception& e) { diff --git a/src/Gui/PythonConsolePy.cpp b/src/Gui/PythonConsolePy.cpp index 7d81406ef1..08b1f415a6 100644 --- a/src/Gui/PythonConsolePy.cpp +++ b/src/Gui/PythonConsolePy.cpp @@ -50,7 +50,7 @@ Py::Object PythonStdout::getattr(const char *name) { if (strcmp(name, "softspace") == 0) { int i=0; - return Py::Int(i); + return Py::Long(i); } return getattr_methods(name); } @@ -114,7 +114,7 @@ Py::Object PythonStderr::getattr(const char *name) { if (strcmp(name, "softspace") == 0) { int i=0; - return Py::Int(i); + return Py::Long(i); } return getattr_methods(name); } @@ -175,7 +175,7 @@ Py::Object OutputStdout::getattr(const char *name) { if (strcmp(name, "softspace") == 0) { int i=0; - return Py::Int(i); + return Py::Long(i); } return getattr_methods(name); } @@ -236,7 +236,7 @@ Py::Object OutputStderr::getattr(const char *name) { if (strcmp(name, "softspace") == 0) { int i=0; - return Py::Int(i); + return Py::Long(i); } return getattr_methods(name); } diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index d5e623c273..a3877b0f76 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -1282,8 +1282,8 @@ Py::Object View3DInventorPy::getCursorPos() auto viewer = getView3DInventorPtr()->getViewer(); SbVec2s vec = viewer->fromQPoint(pos); Py::Tuple tuple(2); - tuple.setItem(0, Py::Int(vec[0])); - tuple.setItem(1, Py::Int(vec[1])); + tuple.setItem(0, Py::Long(vec[0])); + tuple.setItem(1, Py::Long(vec[1])); return tuple; } catch (const Py::Exception&) { @@ -1300,13 +1300,13 @@ Py::Object View3DInventorPy::getObjectInfo(const Py::Tuple& args) try { //Note: For gcc (4.2) we need the 'const' keyword to avoid the compiler error: - //conversion from 'Py::seqref' to non-scalar type 'Py::Int' requested + //conversion from 'Py::seqref' to non-scalar type 'Py::Long' requested //We should report this problem to the PyCXX project as in the documentation an //example without the 'const' keyword is used. - //Or we can also write Py::Int x(tuple[0]); + //Or we can also write Py::Long x(tuple[0]); const Py::Tuple tuple(object); - Py::Int x(tuple[0]); - Py::Int y(tuple[1]); + Py::Long x(tuple[0]); + Py::Long y(tuple[1]); // As this method could be called during a SoHandleEventAction scene // graph traversal we must not use a second SoHandleEventAction as @@ -1406,13 +1406,13 @@ Py::Object View3DInventorPy::getObjectsInfo(const Py::Tuple& args) try { //Note: For gcc (4.2) we need the 'const' keyword to avoid the compiler error: - //conversion from 'Py::seqref' to non-scalar type 'Py::Int' requested + //conversion from 'Py::seqref' to non-scalar type 'Py::Long' requested //We should report this problem to the PyCXX project as in the documentation an //example without the 'const' keyword is used. - //Or we can also write Py::Int x(tuple[0]); + //Or we can also write Py::Long x(tuple[0]); const Py::Tuple tuple(object); - Py::Int x(tuple[0]); - Py::Int y(tuple[1]); + Py::Long x(tuple[0]); + Py::Long y(tuple[1]); // As this method could be called during a SoHandleEventAction scene // graph traversal we must not use a second SoHandleEventAction as @@ -1562,8 +1562,8 @@ Py::Object View3DInventorPy::getSize() try { SbVec2s size = getView3DInventorPtr()->getViewer()->getSoRenderManager()->getSize(); Py::Tuple tuple(2); - tuple.setItem(0, Py::Int(size[0])); - tuple.setItem(1, Py::Int(size[1])); + tuple.setItem(0, Py::Long(size[0])); + tuple.setItem(1, Py::Long(size[1])); return tuple; } catch (const Py::Exception&) { @@ -1577,8 +1577,8 @@ Py::Object View3DInventorPy::getPointOnFocalPlane(const Py::Tuple& args) if (!PyArg_ParseTuple(args.ptr(), "hh", &x, &y)) { PyErr_Clear(); Py::Tuple t(args[0]); - x = (int)Py::Int(t[0]); - y = (int)Py::Int(t[1]); + x = (int)Py::Long(t[0]); + y = (int)Py::Long(t[1]); } try { SbVec3f pt = getView3DInventorPtr()->getViewer()->getPointOnFocalPlane(SbVec2s(x,y)); @@ -1612,8 +1612,8 @@ Py::Object View3DInventorPy::getPointOnViewport(const Py::Tuple& args) try { SbVec2s pt = getView3DInventorPtr()->getViewer()->getPointOnViewport(SbVec3f(vx,vy,vz)); Py::Tuple tuple(2); - tuple.setItem(0, Py::Int(pt[0])); - tuple.setItem(1, Py::Int(pt[1])); + tuple.setItem(0, Py::Long(pt[0])); + tuple.setItem(1, Py::Long(pt[1])); return tuple; } @@ -1631,8 +1631,8 @@ Py::Object View3DInventorPy::projectPointToLine(const Py::Tuple& args) if (!PyArg_ParseTuple(args.ptr(), "hh", &x, &y)) { PyErr_Clear(); Py::Tuple t(args[0]); - x = (int)Py::Int(t[0]); - y = (int)Py::Int(t[1]); + x = (int)Py::Long(t[0]); + y = (int)Py::Long(t[1]); } try { SbVec3f pt1, pt2; @@ -1691,8 +1691,8 @@ void View3DInventorPy::eventCallback(void * ud, SoEventCallback * n) dict.setItem("Time", Py::String(std::string(e->getTime().formatDate("%Y-%m-%d %H:%M:%S").getString()))); SbVec2s p = n->getEvent()->getPosition(); Py::Tuple pos(2); - pos.setItem(0, Py::Int(p[0])); - pos.setItem(1, Py::Int(p[1])); + pos.setItem(0, Py::Long(p[0])); + pos.setItem(1, Py::Long(p[1])); // Position dict.setItem("Position", pos); // Shift, Ctrl, Alt down @@ -2565,7 +2565,7 @@ Py::Object View3DInventorPy::setCornerCrossSize(const Py::Tuple& args) Py::Object View3DInventorPy::getCornerCrossSize() { int size = getView3DInventorPtr()->getViewer()->getFeedbackSize(); - return Py::Int(size); + return Py::Long(size); } Py::Object View3DInventorPy::cast_to_base() diff --git a/src/Gui/View3DViewerPy.cpp b/src/Gui/View3DViewerPy.cpp index 318a1e77b6..839fd54d8e 100644 --- a/src/Gui/View3DViewerPy.cpp +++ b/src/Gui/View3DViewerPy.cpp @@ -277,8 +277,8 @@ Py::Object View3DInventorViewerPy::seekToPoint(const Py::Tuple& args) _viewer->seekToPoint(hitpoint); } else { - Py::Int x(tuple[0]); - Py::Int y(tuple[1]); + Py::Long x(tuple[0]); + Py::Long y(tuple[1]); SbVec2s hitpoint ((long)x,(long)y); _viewer->seekToPoint(hitpoint); @@ -344,8 +344,8 @@ Py::Object View3DInventorViewerPy::getPointOnFocalPlane(const Py::Tuple& args) if (!PyArg_ParseTuple(args.ptr(), "hh", &x, &y)) { PyErr_Clear(); Py::Tuple t(args[0]); - x = (int)Py::Int(t[0]); - y = (int)Py::Int(t[1]); + x = (int)Py::Long(t[0]); + y = (int)Py::Long(t[1]); } try { SbVec3f pt = _viewer->getPointOnFocalPlane(SbVec2s(x,y)); diff --git a/src/Gui/ViewProviderFeaturePython.cpp b/src/Gui/ViewProviderFeaturePython.cpp index 8996bfe23c..7b24735582 100644 --- a/src/Gui/ViewProviderFeaturePython.cpp +++ b/src/Gui/ViewProviderFeaturePython.cpp @@ -356,7 +356,7 @@ ViewProviderFeaturePythonImp::setEdit(int ModNum) try { if (has__object__) { Py::Tuple args(1); - args.setItem(0, Py::Int(ModNum)); + args.setItem(0, Py::Long(ModNum)); Py::Object ret(Base::pyCall(py_setEdit.ptr(),args.ptr())); if (ret.isNone()) return NotImplemented; @@ -367,7 +367,7 @@ ViewProviderFeaturePythonImp::setEdit(int ModNum) else { Py::Tuple args(2); args.setItem(0, Py::Object(object->getPyObject(), true)); - args.setItem(1, Py::Int(ModNum)); + args.setItem(1, Py::Long(ModNum)); Py::Object ret(Base::pyCall(py_setEdit.ptr(),args.ptr())); if (ret.isNone()) return NotImplemented; @@ -397,7 +397,7 @@ ViewProviderFeaturePythonImp::unsetEdit(int ModNum) try { if (has__object__) { Py::Tuple args(1); - args.setItem(0, Py::Int(ModNum)); + args.setItem(0, Py::Long(ModNum)); Py::Object ret(Base::pyCall(py_unsetEdit.ptr(),args.ptr())); if (ret.isNone()) return NotImplemented; @@ -408,7 +408,7 @@ ViewProviderFeaturePythonImp::unsetEdit(int ModNum) else { Py::Tuple args(2); args.setItem(0, Py::Object(object->getPyObject(), true)); - args.setItem(1, Py::Int(ModNum)); + args.setItem(1, Py::Long(ModNum)); Py::Object ret(Base::pyCall(py_unsetEdit.ptr(),args.ptr())); if (ret.isNone()) return NotImplemented; @@ -439,7 +439,7 @@ ViewProviderFeaturePythonImp::setEditViewer(View3DInventorViewer *viewer, int Mo Py::Tuple args(3); args.setItem(0, Py::Object(object->getPyObject(),true)); args.setItem(1, Py::Object(viewer->getPyObject(),true)); - args.setItem(2, Py::Int(ModNum)); + args.setItem(2, Py::Long(ModNum)); Py::Object ret(Base::pyCall(py_setEditViewer.ptr(),args.ptr())); return ret.isTrue()?Accepted:Rejected; } @@ -681,7 +681,7 @@ void ViewProviderFeaturePythonImp::finishRestoring() Py::Object vp = Proxy.getValue(); if (vp.isNone()) { object->show(); - Proxy.setValue(Py::Int(1)); + Proxy.setValue(Py::Long(1)); } else { _FC_PY_CALL_CHECK(finishRestoring,return); Base::pyCall(py_finishRestoring.ptr()); diff --git a/src/Gui/ViewProviderPy.xml b/src/Gui/ViewProviderPy.xml index 8ce41e4deb..5a8c92359f 100644 --- a/src/Gui/ViewProviderPy.xml +++ b/src/Gui/ViewProviderPy.xml @@ -15,274 +15,274 @@ - addProperty(type, name, group, doc, attr=0, ro=False, hd=False) -> ViewProvider + addProperty(type, name, group, doc, attr=0, ro=False, hd=False) -> ViewProvider -Add a generic property. +Add a generic property. -type : str +type : str Property type. -name : str +name : str Property name. Optional. -group : str +group : str Property group. Optional. -attr : int +attr : int Property attributes. -ro : bool +ro : bool Read only property. -hd : bool +hd : bool Hidden property. - removeProperty(name) -> bool + removeProperty(name) -> bool Remove a generic property. -Only user-defined properties can be removed, not built-in ones. +Only user-defined properties can be removed, not built-in ones. -name : str +name : str Property name. - supportedProperties() -> list + supportedProperties() -> list A list of supported property types. - show() -> None + show() -> None Show the object. - show() -> None + show() -> None Hide the object. - isVisible() -> bool + isVisible() -> bool Check if the object is visible. - canDragObject(obj=None) -> bool + canDragObject(obj=None) -> bool Check whether the child object can be removed by dragging. -If 'obj' is not given, check without filter by any particular object. +If 'obj' is not given, check without filter by any particular object. -obj : App.DocumentObject +obj : App.DocumentObject Object to be dragged. - dragObject(obj) -> None + dragObject(obj) -> None -Remove a child object by dropping. +Remove a child object by dropping. -obj : App.DocumentObject +obj : App.DocumentObject Object to be dragged. - canDropObject(obj=None, owner=None, subname, elem=None) -> bool + canDropObject(obj=None, owner=None, subname, elem=None) -> bool Check whether the child object can be added by dropping. -If 'obj' is not given, check without filter by any particular object. +If 'obj' is not given, check without filter by any particular object. -obj : App.DocumentObject +obj : App.DocumentObject Object to be dropped. -owner : App.DocumentObject +owner : App.DocumentObject Parent object of the dropping object. -subname : str +subname : str Subname reference to the dropping object. Optional. -elem : sequence of str +elem : sequence of str Non-objects subelements selected when the object is being dropped. - dropObject(obj, owner=None, subname, elem=None) -> str + dropObject(obj, owner=None, subname, elem=None) -> str -Add a child object by dropping. +Add a child object by dropping. -obj : App.DocumentObject +obj : App.DocumentObject Object to be dropped. -owner : App.DocumentObject +owner : App.DocumentObject Parent object of the dropping object. -subname : str +subname : str Subname reference to the dropping object. Optional. -elem : sequence of str +elem : sequence of str Non-objects subelements selected when the object is being dropped. - canDragAndDropObject(obj) -> bool + canDragAndDropObject(obj) -> bool Check whether the child object can be removed from -other parent and added here by drag and drop. +other parent and added here by drag and drop. -obj : App.DocumentObject +obj : App.DocumentObject Object to be dragged and dropped. - replaceObject(oldObj, newObj) -> int + replaceObject(oldObj, newObj) -> int Replace a child object. -Returns 1 if succeeded, 0 if not found, -1 if not supported. +Returns 1 if succeeded, 0 if not found, -1 if not supported. -oldObj : App.DocumentObject +oldObj : App.DocumentObject Old object. -newObj : App.DocumentObject +newObj : App.DocumentObject New object. - doubleClicked() -> bool + doubleClicked() -> bool Trigger double clicking the corresponding tree item of this view object. - addDisplayMode(obj, mode) -> None + addDisplayMode(obj, mode) -> None -Add a new display mode to the view provider. +Add a new display mode to the view provider. -obj : coin.SoNode +obj : coin.SoNode Display mode. -mode : str +mode : str Name of the display mode. - listDisplayModes() -> list + listDisplayModes() -> list Show a list of all display modes. - toString() -> str + toString() -> str Return a string representation of the Inventor node. - setTransformation(trans) -> None + setTransformation(trans) -> None -Set a transformation on the Inventor node. +Set a transformation on the Inventor node. trans : Base.Placement, Base.Matrix - claimChildren() -> list + claimChildren() -> list Returns list of objects that are to be grouped in tree under this object. - claimChildrenRecursive() -> list + claimChildrenRecursive() -> list Returns list of objects that are to be grouped in tree under this object recursively. - partialRender(sub=None, clear=False) -> int + partialRender(sub=None, clear=False) -> int -Render only part of the object. +Render only part of the object. -sub: None, str, sequence of str +sub: None, str, sequence of str Refer to the subelement. If it is None then reset the partial rendering. -clear: bool +clear: bool True to add, or False to remove the subelement(s) for rendering. - getElementColors(elementName) -> dict + getElementColors(elementName) -> dict Get a dictionary of the form {elementName : (r,g,b,a)}. -If no element name is given a dictionary with all the elements is returned. +If no element name is given a dictionary with all the elements is returned. -elementName : str +elementName : str Name of the element. Optional. - setElementColors(colors) -> None + setElementColors(colors) -> None -Set element colors. +Set element colors. -colors: dict +colors: dict Color dictionary of the form {elementName:(r,g,b,a)}. - getElementPicked(pickPoint) -> str + getElementPicked(pickPoint) -> str -Return the picked subelement. +Return the picked subelement. pickPoint : coin.SoPickedPoint - getDetailPath(subelement, path, append=True) -> coin.SoDetail or None + getDetailPath(subelement, path, append=True) -> coin.SoDetail or None -Return Coin detail and path of an subelement. +Return Coin detail and path of an subelement. -subname: str +subname: str Dot separated string reference to the sub element. -pPath: coin.SoPath +pPath: coin.SoPath Output coin path leading to the returned element detail. -append: bool +append: bool If True, path will be first appended with the root node and the mode switch node of this view provider. - signalChangeIcon() -> None + signalChangeIcon() -> None Trigger icon changed signal. - getBoundingBox(subName, transform=True, view) -> Base.BoundBox + getBoundingBox(subName, transform=True, view) -> Base.BoundBox -Obtain the bounding box of this view object. +Obtain the bounding box of this view object. -subName : str +subName : str Name referring a sub-object. Optional. -transform: bool +transform: bool Whether to apply the transformation matrix of this view provider. -view: View3DInventorPy +view: View3DInventorPy Default to active view. Optional. @@ -314,7 +314,7 @@ view: View3DInventorPy Get/Set the default display mode in turns of coin node index. - + diff --git a/src/Gui/ViewProviderPyImp.cpp b/src/Gui/ViewProviderPyImp.cpp index dabd1bb97b..30178bf008 100644 --- a/src/Gui/ViewProviderPyImp.cpp +++ b/src/Gui/ViewProviderPyImp.cpp @@ -304,7 +304,7 @@ PyObject* ViewProviderPy::replaceObject(PyObject *args) int ret = getViewProviderPtr()->replaceObject( static_cast(oldObj)->getDocumentObjectPtr(), static_cast(newObj)->getDocumentObjectPtr()); - return Py::new_reference_to(Py::Int(ret)); + return Py::new_reference_to(Py::Long(ret)); } PY_CATCH; } @@ -456,7 +456,7 @@ PyObject* ViewProviderPy::partialRender(PyObject* args) } } - Py::Int ret(getViewProviderPtr()->partialRender(values, Base::asBoolean(clear))); + Py::Long ret(getViewProviderPtr()->partialRender(values, Base::asBoolean(clear))); return Py::new_reference_to(ret); } @@ -677,12 +677,12 @@ Py::Object ViewProviderPy::getIcon() const return wrap.fromQIcon(new QIcon(icon)); } -Py::Int ViewProviderPy::getDefaultMode() const +Py::Long ViewProviderPy::getDefaultMode() const { - return Py::Int((long)getViewProviderPtr()->getDefaultMode()); + return Py::Long((long)getViewProviderPtr()->getDefaultMode()); } -void ViewProviderPy::setDefaultMode(Py::Int arg) +void ViewProviderPy::setDefaultMode(Py::Long arg) { return getViewProviderPtr()->setDefaultMode(arg); } diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp index 8b9821e067..20c0450759 100644 --- a/src/Gui/WidgetFactory.cpp +++ b/src/Gui/WidgetFactory.cpp @@ -584,7 +584,7 @@ Py::Object PyResource::value(const Py::Tuple& args) item = Py::Long(static_cast(v.toUInt())); break; case QMetaType::Int: - item = Py::Int(v.toInt()); + item = Py::Long(v.toInt()); break; default: item = Py::String(""); diff --git a/src/Mod/CAM/App/AreaPyImp.cpp b/src/Mod/CAM/App/AreaPyImp.cpp index 0775160615..8f5b9dc860 100644 --- a/src/Mod/CAM/App/AreaPyImp.cpp +++ b/src/Mod/CAM/App/AreaPyImp.cpp @@ -666,7 +666,7 @@ Py::List AreaPy::getShapes() const Area* area = getAreaPtr(); const std::list& shapes = area->getChildren(); for (auto& s : shapes) { - ret.append(Py::TupleN(Part::shape2pyshape(s.shape), Py::Int(s.op))); + ret.append(Py::TupleN(Part::shape2pyshape(s.shape), Py::Long(s.op))); } return ret; } diff --git a/src/Mod/CAM/App/VoronoiCellPy.xml b/src/Mod/CAM/App/VoronoiCellPy.xml index 71c5df4b30..45643bd857 100644 --- a/src/Mod/CAM/App/VoronoiCellPy.xml +++ b/src/Mod/CAM/App/VoronoiCellPy.xml @@ -39,7 +39,7 @@ Returns the cell's category as an integer - + diff --git a/src/Mod/CAM/App/VoronoiCellPyImp.cpp b/src/Mod/CAM/App/VoronoiCellPyImp.cpp index 3d34e3950e..8999a1b0ff 100644 --- a/src/Mod/CAM/App/VoronoiCellPyImp.cpp +++ b/src/Mod/CAM/App/VoronoiCellPyImp.cpp @@ -134,10 +134,10 @@ Py::Long VoronoiCellPy::getSourceIndex() const return Py::Long(index); } -Py::Int VoronoiCellPy::getSourceCategory() const +Py::Long VoronoiCellPy::getSourceCategory() const { VoronoiCell* c = getVoronoiCellFromPy(this); - return Py::Int(c->ptr->source_category()); + return Py::Long(c->ptr->source_category()); } Py::String VoronoiCellPy::getSourceCategoryName() const diff --git a/src/Mod/Material/App/Array2DPy.xml b/src/Mod/Material/App/Array2DPy.xml index c4d066b17b..c9beb5580d 100644 --- a/src/Mod/Material/App/Array2DPy.xml +++ b/src/Mod/Material/App/Array2DPy.xml @@ -25,13 +25,13 @@ The number of rows in the array. - + The number of columns in the array. - + diff --git a/src/Mod/Material/App/Array2DPyImp.cpp b/src/Mod/Material/App/Array2DPyImp.cpp index 8f286d6f4a..3b576be1ca 100644 --- a/src/Mod/Material/App/Array2DPyImp.cpp +++ b/src/Mod/Material/App/Array2DPyImp.cpp @@ -81,14 +81,14 @@ Py::List Array2DPy::getArray() const return list; } -Py::Int Array2DPy::getRows() const +Py::Long Array2DPy::getRows() const { - return Py::Int(getMaterial2DArrayPtr()->rows()); + return Py::Long(getMaterial2DArrayPtr()->rows()); } -Py::Int Array2DPy::getColumns() const +Py::Long Array2DPy::getColumns() const { - return Py::Int(getMaterial2DArrayPtr()->columns()); + return Py::Long(getMaterial2DArrayPtr()->columns()); } PyObject* Array2DPy::getRow(PyObject* args) diff --git a/src/Mod/Material/App/Array3DPy.xml b/src/Mod/Material/App/Array3DPy.xml index b6d55f42ed..435c61e06a 100644 --- a/src/Mod/Material/App/Array3DPy.xml +++ b/src/Mod/Material/App/Array3DPy.xml @@ -25,13 +25,13 @@ The number of columns in the array. - + The depth of the array (3rd dimension). - + diff --git a/src/Mod/Material/App/Array3DPyImp.cpp b/src/Mod/Material/App/Array3DPyImp.cpp index c1a956da5b..bb6e57ee43 100644 --- a/src/Mod/Material/App/Array3DPyImp.cpp +++ b/src/Mod/Material/App/Array3DPyImp.cpp @@ -83,14 +83,14 @@ Py::List Array3DPy::getArray() const return list; } -Py::Int Array3DPy::getColumns() const +Py::Long Array3DPy::getColumns() const { - return Py::Int(getMaterial3DArrayPtr()->columns()); + return Py::Long(getMaterial3DArrayPtr()->columns()); } -Py::Int Array3DPy::getDepth() const +Py::Long Array3DPy::getDepth() const { - return Py::Int(getMaterial3DArrayPtr()->depth()); + return Py::Long(getMaterial3DArrayPtr()->depth()); } PyObject* Array3DPy::getRows(PyObject* args) diff --git a/src/Mod/Part/App/AppPartPy.cpp b/src/Mod/Part/App/AppPartPy.cpp index 05cf1dc500..ae1a188980 100644 --- a/src/Mod/Part/App/AppPartPy.cpp +++ b/src/Mod/Part/App/AppPartPy.cpp @@ -1054,7 +1054,7 @@ private: if (!PyLong_Check(value)) { throw Py::ValueError(err); } - int order = Py::Int(value); + int order = Py::Long(value); params.orders[s] = static_cast(order); return; }); @@ -1131,7 +1131,7 @@ private: if (!PyLong_Check(value)) { throw Py::ValueError(err); } - int order = Py::Int(value); + int order = Py::Long(value); params.orders[s] = static_cast(order); return; }); diff --git a/src/Mod/Part/App/PartFeaturePyImp.cpp b/src/Mod/Part/App/PartFeaturePyImp.cpp index 5d02cc1df0..5aec0fc606 100644 --- a/src/Mod/Part/App/PartFeaturePyImp.cpp +++ b/src/Mod/Part/App/PartFeaturePyImp.cpp @@ -65,7 +65,7 @@ PyObject *PartFeaturePy::getElementHistory(PyObject *args, PyObject *kwds) { } else ret.setItem(0, Py::Object(history.obj->getPyObject(), true)); } else - ret.setItem(0, Py::Int(history.tag)); + ret.setItem(0, Py::Long(history.tag)); tmp.clear(); ret.setItem(1, Py::String(history.element.appendToBuffer(tmp))); Py::List intermedates; diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index 80131c668e..b20571b5af 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -1889,7 +1889,7 @@ PyObject* TopoShapePy::countElement(PyObject *args) return nullptr; PY_TRY { - return Py::new_reference_to(Py::Int((long)getTopoShapePtr()->countSubShapes(input))); + return Py::new_reference_to(Py::Long((long)getTopoShapePtr()->countSubShapes(input))); } PY_CATCH_OCC } @@ -2362,10 +2362,10 @@ PyObject* TopoShapePy::findSubShape(PyObject* args) for (auto& s : getPyShapes(pyobj)) { int index = getTopoShapePtr()->findShape(s.getShape()); if (index > 0) { - res.append(Py::TupleN(Py::String(s.shapeName()), Py::Int(index))); + res.append(Py::TupleN(Py::String(s.shapeName()), Py::Long(index))); } else { - res.append(Py::TupleN(Py::Object(), Py::Int(0))); + res.append(Py::TupleN(Py::Object(), Py::Long(0))); } } if (PySequence_Check(pyobj)) { @@ -2652,7 +2652,7 @@ PyObject* TopoShapePy::getElementHistory(PyObject* args) Py_Return; } Py::Tuple ret(3); - ret.setItem(0, Py::Int(tag)); + ret.setItem(0, Py::Long(tag)); std::string tmp; ret.setItem(1, Py::String(original.appendToBuffer(tmp))); Py::List pyHistory; diff --git a/src/Mod/Sandbox/Gui/AppSandboxGui.cpp b/src/Mod/Sandbox/Gui/AppSandboxGui.cpp index 210dada07f..07ed012b1a 100644 --- a/src/Mod/Sandbox/Gui/AppSandboxGui.cpp +++ b/src/Mod/Sandbox/Gui/AppSandboxGui.cpp @@ -114,7 +114,7 @@ private: args.setItem(3,vector.apply(xyz)); args.setItem(4,Py::Float(radius)); - args.setItem(5,Py::Int((int)0)); + args.setItem(5,Py::Long((int)0)); Py::Tuple ret(method.apply(args)); Py::Object S1(ret.getItem(0)); Py::Object S2(ret.getItem(1)); @@ -154,7 +154,7 @@ private: args.setItem(2,Py::Vector(l2)); args.setItem(3,Py::Vector(Base::Vector3d(0,0,1))); args.setItem(4,Py::Float(radius)); - //args.setItem(5,Py::Int((int)0)); + //args.setItem(5,Py::Long((int)0)); args.setItem(5,Py::Long((long)1)); Py::Tuple ret(method.apply(args)); Py::Vector S1(ret.getItem(0)); diff --git a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp index 1344f15bb6..eaf4156d1a 100644 --- a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp @@ -2462,7 +2462,7 @@ Py::List SketchObjectPy::getConflictingConstraints() const Py::List conflicting; for (auto cid : conflictinglist) { - conflicting.append(Py::Int(cid)); + conflicting.append(Py::Long(cid)); } return conflicting; @@ -2475,7 +2475,7 @@ Py::List SketchObjectPy::getRedundantConstraints() const Py::List redundant; for (auto cid : redundantlist) { - redundant.append(Py::Int(cid)); + redundant.append(Py::Long(cid)); } return redundant; @@ -2488,7 +2488,7 @@ Py::List SketchObjectPy::getPartiallyRedundantConstraints() const Py::List redundant; for (auto cid : redundantlist) { - redundant.append(Py::Int(cid)); + redundant.append(Py::Long(cid)); } return redundant; @@ -2501,7 +2501,7 @@ Py::List SketchObjectPy::getMalformedConstraints() const Py::List malformed; for (auto cid : malformedlist) { - malformed.append(Py::Int(cid)); + malformed.append(Py::Long(cid)); } return malformed; diff --git a/src/Mod/Sketcher/App/SketchPyImp.cpp b/src/Mod/Sketcher/App/SketchPyImp.cpp index 98d85b5e45..a0cc748e31 100644 --- a/src/Mod/Sketcher/App/SketchPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchPyImp.cpp @@ -178,7 +178,7 @@ PyObject* SketchPy::moveGeometry(PyObject* args) Py::Long SketchPy::getConstraint() const { - // return Py::Int(); + // return Py::Long(); throw Py::AttributeError("Not yet implemented"); }