Surface: several improvements

* fix crash because of incomplete inheritance of BlendPoint and BlendCurve -> do not inherit from BaseClass
  as consequebce make destructor non-virtual and remove getPyObject
* pass std::vector by const reference
* remove unneeded includes
* use more suitable Python exception types
* when returning with null from Python handler then set an exception
* harmonize file guards
* several optimizations or simplifications
* use modern C++
* harmonize command name
* fix copyright note
This commit is contained in:
wmayer
2022-08-23 16:46:22 +02:00
parent 3b839551da
commit c2b9eceec1
17 changed files with 99 additions and 145 deletions

View File

@@ -26,7 +26,6 @@
#include <Base/PyObjectBase.h>
#include "Blending/BlendCurvePy.h"
#include "Blending/BlendPoint.h"
#include "Blending/BlendPointPy.h"
#include "Blending/FeatureBlendCurve.h"
#include "FeatureCut.h"
@@ -65,8 +64,6 @@ PyObject *initModule()
/* Python entry */
PyMOD_INIT_FUNC(Surface)
{
try {
Base::Interpreter().runString("import Part");
}
@@ -79,6 +76,7 @@ PyMOD_INIT_FUNC(Surface)
Base::Console().Log("Loading Surface module... done\n");
Base::Interpreter().addType(&Surface::BlendPointPy::Type, mod, "BlendPoint");
Base::Interpreter().addType(&Surface::BlendCurvePy::Type, mod, "BlendCurve");
// Add types to module
Surface::Filling ::init();
Surface::Sewing ::init();
@@ -87,8 +85,6 @@ PyMOD_INIT_FUNC(Surface)
Surface::Extend ::init();
Surface::FeatureBlendCurve ::init();
Surface::Sections ::init();
Surface::BlendPoint ::init();
Surface::BlendCurve ::init();
PyMOD_Return(mod);
}