Merge branch 'remove_placement_init' into 'master'

remove last placement init which is deprecated in pybind11

See merge request jschoeberl/netgen!194
This commit is contained in:
Joachim Schöberl 2019-08-09 14:24:35 +00:00
commit 41a28666f3

View File

@ -212,7 +212,7 @@ DLL_HEADER void ExportCSG(py::module &m)
py::class_<SplineSurface, shared_ptr<SplineSurface>> (m, "SplineSurface",
"A surface for co dim 2 integrals on the splines")
.def("__init__", FunctionPointer ([](SplineSurface* instance, shared_ptr<SPSolid> base, py::list cuts)
.def(py::init([](shared_ptr<SPSolid> base, py::list cuts)
{
auto primitive = dynamic_cast<OneSurfacePrimitive*> (base->GetSolid()->GetPrimitive());
auto acuts = make_shared<NgArray<shared_ptr<OneSurfacePrimitive>>>();
@ -225,12 +225,11 @@ DLL_HEADER void ExportCSG(py::module &m)
if(sp)
acuts->Append(shared_ptr<OneSurfacePrimitive>(sp));
else
throw NgException("Cut must be SurfacePrimitive in constructor of SplineSurface!");
throw Exception("Cut must be SurfacePrimitive in constructor of SplineSurface!");
}
if(!primitive)
throw NgException("Base is not a SurfacePrimitive in constructor of SplineSurface!");
new (instance) SplineSurface(shared_ptr<OneSurfacePrimitive>(primitive),acuts);
py::object obj = py::cast(instance);
throw Exception("Base is not a SurfacePrimitive in constructor of SplineSurface!");
return make_shared<SplineSurface>(shared_ptr<OneSurfacePrimitive>(primitive),acuts);
}),py::arg("base"), py::arg("cuts")=py::list())
.def("AddPoint", FunctionPointer
([] (SplineSurface & self, double x, double y, double z, bool hpref)