mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
Merge branch 'shape_name_return_optional' into 'master'
shape.name return optional<string> See merge request jschoeberl/netgen!469
This commit is contained in:
commit
86fd2983c7
@ -719,11 +719,11 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
||||
return shape;
|
||||
}, py::arg("name"), "sets 'name' property to all solids of shape")
|
||||
|
||||
.def_property("name", [](const TopoDS_Shape & self) {
|
||||
.def_property("name", [](const TopoDS_Shape & self) -> optional<string> {
|
||||
if (auto name = OCCGeometry::global_shape_properties[self.TShape()].name)
|
||||
return *name;
|
||||
else
|
||||
return string();
|
||||
return nullopt;
|
||||
}, [](const TopoDS_Shape & self, optional<string> name) {
|
||||
OCCGeometry::global_shape_properties[self.TShape()].name = name;
|
||||
}, "'name' of shape")
|
||||
|
Loading…
Reference in New Issue
Block a user