mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 01:48:28 +00:00
Prepare to display all operations
This commit is contained in:
parent
85fe6e959c
commit
81cfbed007
@ -3,6 +3,10 @@ use std::{ops::Deref, rc::Rc};
|
||||
use super::tri_mesh::TriMesh;
|
||||
|
||||
pub trait Operation {
|
||||
type Output
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
fn label(&self) -> &'static str;
|
||||
fn tri_mesh(&self) -> TriMesh;
|
||||
fn children(&self) -> Vec<AnyOp>;
|
||||
@ -63,6 +67,8 @@ impl AnyOp {
|
||||
}
|
||||
|
||||
impl Operation for AnyOp {
|
||||
type Output = Self;
|
||||
|
||||
fn label(&self) -> &'static str {
|
||||
self.inner.label()
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ where
|
||||
}
|
||||
|
||||
impl Operation for Triangle {
|
||||
type Output = Self;
|
||||
|
||||
fn label(&self) -> &'static str {
|
||||
"Triangle"
|
||||
}
|
||||
|
@ -65,6 +65,8 @@ impl Face {
|
||||
}
|
||||
|
||||
impl Operation for Face {
|
||||
type Output = Self;
|
||||
|
||||
fn label(&self) -> &'static str {
|
||||
"Face"
|
||||
}
|
||||
|
@ -88,6 +88,8 @@ impl Solid {
|
||||
}
|
||||
|
||||
impl Operation for Solid {
|
||||
type Output = Self;
|
||||
|
||||
fn label(&self) -> &'static str {
|
||||
"Solid"
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ where
|
||||
}
|
||||
|
||||
impl Operation for Vertex {
|
||||
type Output = Self;
|
||||
|
||||
fn label(&self) -> &'static str {
|
||||
"Vertex"
|
||||
}
|
||||
|
@ -122,6 +122,8 @@ impl OperationView {
|
||||
}
|
||||
|
||||
impl Operation for OperationView {
|
||||
type Output = Self;
|
||||
|
||||
fn label(&self) -> &'static str {
|
||||
self.operation.label()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user