Prepare to refer to operations via handles

This commit is contained in:
Hanno Braun 2024-12-13 20:02:22 +01:00
parent 464fcdf664
commit b368105d34
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ impl Operation for Vertex {
} }
} }
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)] #[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub struct Triangle { pub struct Triangle {
pub vertices: [Vertex; 3], pub vertices: [Vertex; 3],
} }
@ -60,7 +60,7 @@ impl Operation for Triangle {
fn vertices(&self, _: &mut Vec<Vertex>) {} fn vertices(&self, _: &mut Vec<Vertex>) {}
fn triangles(&self, triangles: &mut Vec<Triangle>) { fn triangles(&self, triangles: &mut Vec<Triangle>) {
triangles.push(*self) triangles.push(self.clone())
} }
fn children(&self) -> Vec<HandleAny> { fn children(&self) -> Vec<HandleAny> {

View File

@ -37,7 +37,7 @@ impl Shape {
let triangle = triangle.into(); let triangle = triangle.into();
self.operations.push(OperationInSequence { self.operations.push(OperationInSequence {
operation: HandleAny::new(triangle), operation: HandleAny::new(triangle.clone()),
previous: self previous: self
.operations .operations
.last() .last()