mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +05:00
remove last placement init which is deprecated in pybind11
This commit is contained in:
parent
c900e0380b
commit
ed024bb66a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user