Add basic vector nodes (#1059)

* Add some derives

* Allow node_fn with mutable inputs

* Add basic vector nodes

* Revert elipse tool changes

* Fix the elipse tool again

* Change spacer width

* Bubble serde feature in graph craft

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube 2023-03-02 21:54:23 +00:00 committed by Keavon Chambers
parent 7e37fb41a4
commit a2046a51b1
22 changed files with 707 additions and 151 deletions

View file

@ -33,7 +33,7 @@ impl DocumentNodeMetadata {
}
}
#[derive(Clone, Debug, PartialEq, specta::Type)]
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct DocumentNode {
pub name: String,
@ -122,7 +122,7 @@ impl DocumentNode {
}
}
#[derive(Debug, Clone, PartialEq, Hash, specta::Type)]
#[derive(Debug, Clone, PartialEq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum NodeInput {
Node { node_id: NodeId, output_index: usize, lambda: bool },
@ -165,7 +165,7 @@ impl NodeInput {
}
}
#[derive(Clone, Debug, PartialEq, specta::Type)]
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum DocumentNodeImplementation {
Network(NodeNetwork),
@ -202,7 +202,7 @@ impl NodeOutput {
}
}
#[derive(Clone, Debug, Default, PartialEq, DynAny, specta::Type)]
#[derive(Clone, Debug, Default, PartialEq, DynAny)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct NodeNetwork {
pub inputs: Vec<NodeId>,