From e4f7d0f068e0fddf789e086693b2a1ec9615d59a Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Wed, 28 Oct 2020 17:54:27 +0100 Subject: [PATCH] Sketcher: SketchGeometryExtension separation to interface --- src/Mod/Sketcher/App/SketchGeometryExtension.h | 15 ++++++++++++--- .../Sketcher/App/SketchGeometryExtensionPyImp.cpp | 2 -- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchGeometryExtension.h b/src/Mod/Sketcher/App/SketchGeometryExtension.h index 747d1990c5..774816c588 100644 --- a/src/Mod/Sketcher/App/SketchGeometryExtension.h +++ b/src/Mod/Sketcher/App/SketchGeometryExtension.h @@ -29,7 +29,16 @@ namespace Sketcher { -class SketcherExport SketchGeometryExtension : public Part::GeometryExtension +class ISketchGeometryExtension +{ + +public: + // Identification information + virtual long getId() const = 0; + virtual void setId(long id) = 0; +}; + +class SketcherExport SketchGeometryExtension : public Part::GeometryExtension, ISketchGeometryExtension { TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: @@ -46,8 +55,8 @@ public: virtual PyObject *getPyObject(void) override; - long getId() const {return Id;} - void setId(long id) {Id = id;} + virtual long getId() const override {return Id;} + virtual void setId(long id) override {Id = id;} private: SketchGeometryExtension(const SketchGeometryExtension&) = default; diff --git a/src/Mod/Sketcher/App/SketchGeometryExtensionPyImp.cpp b/src/Mod/Sketcher/App/SketchGeometryExtensionPyImp.cpp index 9b9832b63f..8e7bcaa6e8 100644 --- a/src/Mod/Sketcher/App/SketchGeometryExtensionPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchGeometryExtensionPyImp.cpp @@ -89,8 +89,6 @@ void SketchGeometryExtensionPy::setId(Py::Long Id) this->getSketchGeometryExtensionPtr()->setId(long(Id)); } - - PyObject *SketchGeometryExtensionPy::getCustomAttributes(const char* /*attr*/) const { return 0;