-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is also a place holder for now, but will later be expanded to allow 3D modeling.
- Loading branch information
1 parent
9578159
commit e815b34
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,6 @@ members = [ | |
"crates/cadara", | ||
"crates/module", | ||
"crates/workspace", | ||
"crates/modeling-module", | ||
] | ||
resolver = "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "modeling-module" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "AGPL-3.0-only" | ||
publish = false | ||
|
||
[dependencies] | ||
module = { path = "../module" } | ||
uuid = { version = "1.6.1", features = ["v4", "serde"] } | ||
serde = { version = "1.0.195", features = ["derive", "alloc", "rc"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#![warn(clippy::nursery)] | ||
#![warn(clippy::pedantic)] | ||
#![allow(clippy::module_name_repetitions)] | ||
#![allow(clippy::cognitive_complexity)] | ||
|
||
use module::{DataTransaction, Module, ReversibleDataTransaction}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub struct ModelingModule {} | ||
|
||
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] | ||
pub struct DataSection {} | ||
|
||
impl DataTransaction for DataSection { | ||
type Args = (); | ||
|
||
type Error = (); | ||
|
||
type Output = (); | ||
|
||
fn apply(&mut self, _args: Self::Args) -> Result<Self::Output, Self::Error> { | ||
Ok(()) | ||
} | ||
|
||
fn undo_history_name(_args: &Self::Args) -> String { | ||
"nothing".to_string() | ||
} | ||
} | ||
|
||
impl ReversibleDataTransaction for DataSection { | ||
type UndoData = (); | ||
|
||
fn apply(&mut self, _args: Self::Args) -> Result<(Self::Output, Self::UndoData), Self::Error> { | ||
Ok(((), ())) | ||
} | ||
|
||
fn undo(&mut self, _undo_data: Self::UndoData) {} | ||
} | ||
|
||
impl Module for ModelingModule { | ||
type PersistentData = DataSection; | ||
|
||
type PersistentUserData = DataSection; | ||
|
||
type SessionData = DataSection; | ||
|
||
type SharedData = DataSection; | ||
|
||
fn name() -> String { | ||
"Modeling".to_string() | ||
} | ||
|
||
fn uuid() -> uuid::Uuid { | ||
uuid::Uuid::parse_str("04d338d9-b7a9-4f5a-b04d-724466f4058f").expect("static UUID") | ||
} | ||
} |