mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-11 13:28:28 +00:00
Prepare to support nested operations
This commit is contained in:
parent
050b9357c2
commit
d7a183b6fc
@ -92,10 +92,8 @@ impl Renderer {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
|
|
||||||
let vertices =
|
let vertices = Geometry::vertices(&self.device, &selected_operation);
|
||||||
Geometry::vertices(&self.device, selected_operation.as_ref());
|
let triangles = Geometry::triangles(&self.device, &selected_operation);
|
||||||
let triangles =
|
|
||||||
Geometry::triangles(&self.device, selected_operation.as_ref());
|
|
||||||
|
|
||||||
let mut encoder = self
|
let mut encoder = self
|
||||||
.device
|
.device
|
||||||
|
@ -15,12 +15,20 @@ impl OperationView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn operations(&self) -> Vec<(Box<dyn Operation>, bool)> {
|
pub fn operations(&self) -> Vec<(Self, bool)> {
|
||||||
self.operation
|
self.operation
|
||||||
.children()
|
.children()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, op)| (op, Some(i) == self.selected))
|
.map(|(i, op)| {
|
||||||
|
(
|
||||||
|
OperationView {
|
||||||
|
operation: op,
|
||||||
|
selected: None,
|
||||||
|
},
|
||||||
|
Some(i) == self.selected,
|
||||||
|
)
|
||||||
|
})
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +48,7 @@ impl OperationView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn selected(&self) -> Option<Box<dyn Operation>> {
|
pub fn selected(&self) -> Option<Self> {
|
||||||
let selected = self.selected?;
|
let selected = self.selected?;
|
||||||
|
|
||||||
self.operations()
|
self.operations()
|
||||||
|
Loading…
Reference in New Issue
Block a user