From fd42f24d379619724d1c6e0ae2aa24ffd122275d Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 6 Aug 2019 20:03:17 +0200 Subject: [PATCH] remove any again --- libsrc/include/mystdlib.h | 1 - libsrc/meshing/meshtype.hpp | 2 +- libsrc/stlgeom/python_stl.cpp | 6 ++---- libsrc/stlgeom/stlgeom.cpp | 4 ---- libsrc/stlgeom/stlgeom.hpp | 13 ++++++------- libsrc/stlgeom/stltool.hpp | 2 +- 6 files changed, 10 insertions(+), 18 deletions(-) diff --git a/libsrc/include/mystdlib.h b/libsrc/include/mystdlib.h index a58f93f0..b55ba3da 100644 --- a/libsrc/include/mystdlib.h +++ b/libsrc/include/mystdlib.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 107c86ad..6cd08323 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -1270,7 +1270,7 @@ namespace netgen /// bool autozrefine = false; - any geometrySpecificParameters; + Flags geometrySpecificParameters; /// MeshingParameters (); /// diff --git a/libsrc/stlgeom/python_stl.cpp b/libsrc/stlgeom/python_stl.cpp index 33df2fc8..2b88a155 100644 --- a/libsrc/stlgeom/python_stl.cpp +++ b/libsrc/stlgeom/python_stl.cpp @@ -194,8 +194,8 @@ DLL_HEADER void ExportSTL(py::module & m) MeshingParameters* pars, py::kwargs kwargs) { MeshingParameters mp; + STLParameters stlparam; { py::gil_scoped_acquire aq; - STLParameters stlparam; if(pars) { try @@ -203,20 +203,18 @@ DLL_HEADER void ExportSTL(py::module & m) auto mp_flags = any_cast(pars->geometrySpecificParameters); auto mp_kwargs = CreateDictFromFlags(mp_flags); CreateSTLParametersFromKwargs(stlparam, mp_kwargs); - pars->geometrySpecificParameters.reset(); } catch(std::bad_any_cast) {} mp = *pars; } CreateSTLParametersFromKwargs(stlparam, kwargs); CreateMPfromKwargs(mp, kwargs); // this will throw if any kwargs are not passed - mp.geometrySpecificParameters = stlparam; } auto mesh = make_shared(); mesh->SetGeometry(geo); ng_geometry = geo; SetGlobalMesh(mesh); - geo->GenerateMesh(mesh,mp); + STLMeshingDummy(geo.get(), mesh, mp, stlparam); return mesh; }, py::arg("mp") = nullptr, py::call_guard(), diff --git a/libsrc/stlgeom/stlgeom.cpp b/libsrc/stlgeom/stlgeom.cpp index 464a3a33..16f6659b 100644 --- a/libsrc/stlgeom/stlgeom.cpp +++ b/libsrc/stlgeom/stlgeom.cpp @@ -99,10 +99,6 @@ extern STLParameters stlparam; int STLGeometry :: GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam) { STLParameters stlpar = stlparam; - if(mparam.geometrySpecificParameters.has_value() && mparam.geometrySpecificParameters.type().name() == typeid(STLParameters).name()) - { - stlpar = any_cast(mparam.geometrySpecificParameters); - } return STLMeshingDummy (this, mesh, mparam, stlpar); } diff --git a/libsrc/stlgeom/stlgeom.hpp b/libsrc/stlgeom/stlgeom.hpp index 5027dc31..7f31c151 100644 --- a/libsrc/stlgeom/stlgeom.hpp +++ b/libsrc/stlgeom/stlgeom.hpp @@ -184,14 +184,14 @@ namespace netgen STLGeometry(); virtual ~STLGeometry(); - void DoArchive(Archive& ar) + void DoArchive(Archive& ar) override { STLTopology::DoArchive(ar); } void Clear(); - virtual void Save (string filename) const; + virtual void Save (string filename) const override; DLL_HEADER void STLInfo(double* data); @@ -330,8 +330,8 @@ namespace netgen /// ///ReadTriangle->STLTriangle, initialise some important variables, always after load!!! - virtual void InitSTLGeometry (const NgArray & readtrigs); - virtual void TopologyChanged(); //do some things, if topology changed! + virtual void InitSTLGeometry (const NgArray & readtrigs) override; + virtual void TopologyChanged() override; //do some things, if topology changed! int CheckGeometryOverlapping(); //get NO edges per point @@ -457,10 +457,9 @@ namespace netgen friend class MeshingSTLSurface; - - virtual int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam); + int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam) override; - virtual const Refinement & GetRefinement () const; + virtual const Refinement & GetRefinement () const override; }; diff --git a/libsrc/stlgeom/stltool.hpp b/libsrc/stlgeom/stltool.hpp index bcd145e1..ce485a70 100644 --- a/libsrc/stlgeom/stltool.hpp +++ b/libsrc/stlgeom/stltool.hpp @@ -230,7 +230,7 @@ DLL_HEADER extern STLDoctorParams stldoctor; // TODO change enable flag to optional parameters -class STLParameters +class DLL_HEADER STLParameters { public: /// angle for edge detection