diff --git a/src/Mod/Part/App/CMakeLists.txt b/src/Mod/Part/App/CMakeLists.txt index b6b0865d13..d7dc2ffb9b 100644 --- a/src/Mod/Part/App/CMakeLists.txt +++ b/src/Mod/Part/App/CMakeLists.txt @@ -343,6 +343,8 @@ SET(Part_SRCS BSplineCurveBiArcs.cpp CrossSection.cpp CrossSection.h + GeometryExtension.cpp + GeometryExtension.h Geometry.cpp Geometry.h Geometry2d.cpp diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index d03ba92be1..02730bef08 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -180,18 +180,6 @@ const char* gce_ErrorStatusText(gce_ErrorType et) } } - - -// --------------------------------------------------------------- -TYPESYSTEM_SOURCE_ABSTRACT(Part::GeometryExtension,Base::Persistence) - -GeometryExtension::GeometryExtension() -{ -} - -GeometryExtension::~GeometryExtension() -{ -} // --------------------------------------------------------------- TYPESYSTEM_SOURCE_ABSTRACT(Part::Geometry,Base::Persistence) diff --git a/src/Mod/Part/App/Geometry.h b/src/Mod/Part/App/Geometry.h index 58e79d0ef0..c8e4a1d678 100644 --- a/src/Mod/Part/App/Geometry.h +++ b/src/Mod/Part/App/Geometry.h @@ -63,35 +63,10 @@ #include #include -namespace std { -template -std::unique_ptr make_unique(Args&&... args) -{ - return std::unique_ptr(new T(std::forward(args)...)); -} -} - +#include "GeometryExtension.h" namespace Part { -class PartExport GeometryExtension: public Base::Persistence -{ - TYPESYSTEM_HEADER(); -public: - virtual ~GeometryExtension(); - - // Persistence implementer --------------------- - virtual unsigned int getMemSize(void) const = 0; - virtual void Save(Base::Writer &/*writer*/) const = 0; - virtual void Restore(Base::XMLReader &/*reader*/) = 0; - - virtual std::unique_ptr copy(void) const = 0; - - virtual PyObject *getPyObject(void) = 0; -protected: - GeometryExtension(); -}; - class PartExport Geometry: public Base::Persistence { TYPESYSTEM_HEADER(); diff --git a/src/Mod/Part/App/GeometryExtension.cpp b/src/Mod/Part/App/GeometryExtension.cpp new file mode 100644 index 0000000000..8a3a910518 --- /dev/null +++ b/src/Mod/Part/App/GeometryExtension.cpp @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (c) 2019 Abdullah Tahiri * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" + +#include +#include +#include + +#include "GeometryExtension.h" + +using namespace Part; + +TYPESYSTEM_SOURCE_ABSTRACT(Part::GeometryExtension,Base::Persistence) + +GeometryExtension::GeometryExtension() +{ +} + +GeometryExtension::~GeometryExtension() +{ +} diff --git a/src/Mod/Part/App/GeometryExtension.h b/src/Mod/Part/App/GeometryExtension.h new file mode 100644 index 0000000000..f2a20687b9 --- /dev/null +++ b/src/Mod/Part/App/GeometryExtension.h @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (c) 2019 Abdullah Tahiri * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#ifndef PART_GEOMETRYEXTENSION_H +#define PART_GEOMETRYEXTENSION_H + +#include +#include + +namespace std { + template + std::unique_ptr make_unique(Args&&... args) + { + return std::unique_ptr(new T(std::forward(args)...)); + } +} + +namespace Part { + +class PartExport GeometryExtension: public Base::Persistence +{ + TYPESYSTEM_HEADER(); +public: + virtual ~GeometryExtension(); + + // Persistence implementer --------------------- + virtual unsigned int getMemSize(void) const = 0; + virtual void Save(Base::Writer &/*writer*/) const = 0; + virtual void Restore(Base::XMLReader &/*reader*/) = 0; + + virtual std::unique_ptr copy(void) const = 0; + + virtual PyObject *getPyObject(void) = 0; +protected: + GeometryExtension(); +}; + +} + +#endif // PART_GEOMETRYEXTENSION_H diff --git a/src/Mod/Part/App/GeometryExtensionPy.xml b/src/Mod/Part/App/GeometryExtensionPy.xml index b1087dd42d..3b4e08f3e2 100644 --- a/src/Mod/Part/App/GeometryExtensionPy.xml +++ b/src/Mod/Part/App/GeometryExtensionPy.xml @@ -5,7 +5,7 @@ Name="GeometryExtensionPy" Twin="GeometryExtension" TwinPointer="GeometryExtension" - Include="Mod/Part/App/Geometry.h" + Include="Mod/Part/App/GeometryExtension.h" Namespace="Part" FatherInclude="Base/PyObjectBase.h" FatherNamespace="Base" diff --git a/src/Mod/Part/App/GeometryExtensionPyImp.cpp b/src/Mod/Part/App/GeometryExtensionPyImp.cpp index 39db789fad..2c8747c59e 100644 --- a/src/Mod/Part/App/GeometryExtensionPyImp.cpp +++ b/src/Mod/Part/App/GeometryExtensionPyImp.cpp @@ -22,11 +22,8 @@ #include "PreCompiled.h" -//#ifndef _PreComp_ -//# include -//#endif -#include "Geometry.h" // For GeometryExtension +#include "GeometryExtension.h" #include "GeometryExtensionPy.h" #include "GeometryExtensionPy.cpp"