mirror of
				https://github.com/hannobraun/Fornjot
				synced 2025-10-30 19:58:31 +00:00 
			
		
		
		
	Prepare to refer to operations via handles
This commit is contained in:
		
							parent
							
								
									464fcdf664
								
							
						
					
					
						commit
						b368105d34
					
				| @ -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> { | ||||||
|  | |||||||
| @ -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() | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user