Add `MaybePartial<Curve>::surface`

This commit is contained in:
Hanno Braun 2022-11-03 15:00:56 +01:00
parent 5fec6dec06
commit f3ef0042c2
1 changed files with 8 additions and 0 deletions

View File

@ -122,6 +122,14 @@ impl MaybePartial<Curve> {
}
}
/// Access the surface
pub fn surface(&self) -> Option<Handle<Surface>> {
match self {
MaybePartial::Full(full) => Some(full.surface().clone()),
MaybePartial::Partial(partial) => partial.surface(),
}
}
/// Access the global form
pub fn global_form(&self) -> Option<MaybePartial<GlobalCurve>> {
match self {