Merge branch 'listofshapes_property_setter' into 'master'

Add properties .name and .maxh to ListOfShapes

See merge request jschoeberl/netgen!404
This commit is contained in:
Joachim Schöberl 2021-09-01 13:13:02 +00:00
commit 6fa47a2a6e

View File

@ -1422,6 +1422,28 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
} }
return CastShape(maxshape); return CastShape(maxshape);
}) })
.def_property("name", [](ListOfShapes& shapes)
{
throw Exception("Cannot get property of ListOfShapes, get the property from individual shapes!");
},
[](ListOfShapes& shapes, std::string name)
{
for(auto& shape : shapes)
{
OCCGeometry::global_shape_properties[shape.TShape()].name = name;
}
})
.def_property("maxh", [](ListOfShapes& shapes)
{
throw Exception("Cannot get property of ListOfShapes, get the property from individual shapes!");
},
[](ListOfShapes& shapes, double maxh)
{
for(auto& shape : shapes)
{
OCCGeometry::global_shape_properties[shape.TShape()].maxh = maxh;
}
})
; ;