mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 13:50:33 +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;
|
return shape;
|
||||||
}, py::arg("name"), "sets 'name' property to all solids of 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)
|
if (auto name = OCCGeometry::global_shape_properties[self.TShape()].name)
|
||||||
return *name;
|
return *name;
|
||||||
else
|
else
|
||||||
return string();
|
return nullopt;
|
||||||
}, [](const TopoDS_Shape & self, optional<string> name) {
|
}, [](const TopoDS_Shape & self, optional<string> name) {
|
||||||
OCCGeometry::global_shape_properties[self.TShape()].name = name;
|
OCCGeometry::global_shape_properties[self.TShape()].name = name;
|
||||||
}, "'name' of shape")
|
}, "'name' of shape")
|
||||||
|
Loading…
Reference in New Issue
Block a user