diff --git a/src/Mod/Part/App/GeometryDefaultExtension.cpp b/src/Mod/Part/App/GeometryDefaultExtension.cpp index 6adbb62bec..426df6de85 100644 --- a/src/Mod/Part/App/GeometryDefaultExtension.cpp +++ b/src/Mod/Part/App/GeometryDefaultExtension.cpp @@ -37,7 +37,7 @@ using namespace Part; //---------- Geometry Extension template -GeometryDefaultExtension::GeometryDefaultExtension(const T& obj):value(obj) +GeometryDefaultExtension::GeometryDefaultExtension(const T& val):value(val) { } diff --git a/src/Mod/Part/App/GeometryDefaultExtension.h b/src/Mod/Part/App/GeometryDefaultExtension.h index 89f567143b..2276035808 100644 --- a/src/Mod/Part/App/GeometryDefaultExtension.h +++ b/src/Mod/Part/App/GeometryDefaultExtension.h @@ -35,9 +35,12 @@ namespace Part { TYPESYSTEM_HEADER(); public: GeometryDefaultExtension() = default; - GeometryDefaultExtension(const T& obj); + GeometryDefaultExtension(const T& val); virtual ~GeometryDefaultExtension() = default; + inline void setValue(const T& val) {value = val;}; + inline const T &getValue() {return value;}; + // Persistence implementer --------------------- virtual unsigned int getMemSize(void) const; virtual void Save(Base::Writer &/*writer*/) const; @@ -47,7 +50,7 @@ namespace Part { virtual PyObject *getPyObject(void); - public: + private: T value; }; diff --git a/src/Mod/Part/App/GeometryIntExtensionPyImp.cpp b/src/Mod/Part/App/GeometryIntExtensionPyImp.cpp index d2d8600219..5bb42f8d9e 100644 --- a/src/Mod/Part/App/GeometryIntExtensionPyImp.cpp +++ b/src/Mod/Part/App/GeometryIntExtensionPyImp.cpp @@ -34,7 +34,7 @@ using namespace Part; std::string GeometryIntExtensionPy::representation(void) const { std::stringstream str; - long id = getGeometryIntExtensionPtr()->value; + long id = getGeometryIntExtensionPtr()->getValue(); str << ""; return str.str(); } @@ -57,7 +57,7 @@ int GeometryIntExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/) PyErr_Clear(); int Id; if (PyArg_ParseTuple(args, "i", &Id)) { - this->getGeometryIntExtensionPtr()->value=Id; + this->getGeometryIntExtensionPtr()->setValue(Id); return 0; } @@ -71,12 +71,12 @@ int GeometryIntExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/) Py::Long GeometryIntExtensionPy::getValue(void) const { - return Py::Long(this->getGeometryIntExtensionPtr()->value); + return Py::Long(this->getGeometryIntExtensionPtr()->getValue()); } void GeometryIntExtensionPy::setValue(Py::Long value) { - this->getGeometryIntExtensionPtr()->value=long(value); + this->getGeometryIntExtensionPtr()->setValue(long(value)); } diff --git a/src/Mod/Part/App/GeometryStringExtensionPyImp.cpp b/src/Mod/Part/App/GeometryStringExtensionPyImp.cpp index f1b39a0f6b..3315c4641a 100644 --- a/src/Mod/Part/App/GeometryStringExtensionPyImp.cpp +++ b/src/Mod/Part/App/GeometryStringExtensionPyImp.cpp @@ -38,7 +38,7 @@ using namespace Part; std::string GeometryStringExtensionPy::representation(void) const { std::stringstream str; - str << "value << ") >"; + str << "getValue() << ") >"; return str.str(); } @@ -60,7 +60,7 @@ int GeometryStringExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/) PyErr_Clear(); char *pstr; if (PyArg_ParseTuple(args, "s", &pstr)) { - this->getGeometryStringExtensionPtr()->value=pstr; + this->getGeometryStringExtensionPtr()->setValue(pstr); return 0; } @@ -74,12 +74,12 @@ int GeometryStringExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/) Py::String GeometryStringExtensionPy::getValue(void) const { - return Py::String(this->getGeometryStringExtensionPtr()->value); + return Py::String(this->getGeometryStringExtensionPtr()->getValue()); } void GeometryStringExtensionPy::setValue(Py::String value) { - this->getGeometryStringExtensionPtr()->value = value.as_std_string(); + this->getGeometryStringExtensionPtr()->setValue(value.as_std_string()); } PyObject *GeometryStringExtensionPy::getCustomAttributes(const char* /*attr*/) const