Part: Excise GeometryExtension from Geometry

This commit is contained in:
Abdullah Tahiri
2019-01-24 16:38:17 +01:00
committed by wmayer
parent 9b65a4885d
commit 1e2c627f26
7 changed files with 107 additions and 43 deletions

View File

@@ -343,6 +343,8 @@ SET(Part_SRCS
BSplineCurveBiArcs.cpp
CrossSection.cpp
CrossSection.h
GeometryExtension.cpp
GeometryExtension.h
Geometry.cpp
Geometry.h
Geometry2d.cpp

View File

@@ -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)

View File

@@ -63,35 +63,10 @@
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
namespace std {
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(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<GeometryExtension> copy(void) const = 0;
virtual PyObject *getPyObject(void) = 0;
protected:
GeometryExtension();
};
class PartExport Geometry: public Base::Persistence
{
TYPESYSTEM_HEADER();

View File

@@ -0,0 +1,42 @@
/***************************************************************************
* Copyright (c) 2019 Abdullah Tahiri <abdullah.tahiri.yo@gmail.com> *
* *
* 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 <Base/Writer.h>
#include <Base/Reader.h>
#include <Base/Tools.h>
#include "GeometryExtension.h"
using namespace Part;
TYPESYSTEM_SOURCE_ABSTRACT(Part::GeometryExtension,Base::Persistence)
GeometryExtension::GeometryExtension()
{
}
GeometryExtension::~GeometryExtension()
{
}

View File

@@ -0,0 +1,60 @@
/***************************************************************************
* Copyright (c) 2019 Abdullah Tahiri <abdullah.tahiri.yo@gmail.com> *
* *
* 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 <Base/Persistence.h>
#include <memory>
namespace std {
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(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<GeometryExtension> copy(void) const = 0;
virtual PyObject *getPyObject(void) = 0;
protected:
GeometryExtension();
};
}
#endif // PART_GEOMETRYEXTENSION_H

View File

@@ -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"

View File

@@ -22,11 +22,8 @@
#include "PreCompiled.h"
//#ifndef _PreComp_
//# include <gp_Ax1.hxx>
//#endif
#include "Geometry.h" // For GeometryExtension
#include "GeometryExtension.h"
#include "GeometryExtensionPy.h"
#include "GeometryExtensionPy.cpp"