mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
shape.name return optional<string>
This commit is contained in:
parent
b6396c15c0
commit
1fbfc440ac
@ -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