reactive_graph_std_flow_model/component/
flow_3d.rs

1use crate::NAMESPACE_FLOW;
2use reactive_graph_graph::component_model;
3use reactive_graph_graph::component_ty;
4use reactive_graph_graph::properties;
5
6properties!(
7    Flow3DProperties,
8    (FLOW_3D_X, "f3dx", 0.0),
9    (FLOW_3D_Y, "f3dy", 0.0),
10    (FLOW_3D_Z, "f3dz", 0.0),
11    (FLOW_3D_W, "f2dw", 10.0),
12    (FLOW_3D_H, "f2dh", 10.0),
13    (FLOW_3D_D, "f2dd", 10.0)
14);
15
16component_ty!(COMPONENT_FLOW_3D, NAMESPACE_FLOW, COMPONENT_NAME_FLOW_3D, "flow_3d");
17
18component_model!(
19    Flow3D,
20    data f3dx f64,
21    data f3dy f64,
22    data f3dz f64,
23    data f3dw f64,
24    data f3dh f64,
25    data f3dd f64,
26);
27
28pub trait Flow3DElement: Flow3D {
29    fn get_x(&self) -> Option<f64> {
30        self.get_f3dx()
31    }
32
33    fn get_y(&self) -> Option<f64> {
34        self.get_f3dy()
35    }
36
37    fn get_z(&self) -> Option<f64> {
38        self.get_f3dz()
39    }
40
41    fn get_width(&self) -> Option<f64> {
42        self.get_f3dw()
43    }
44
45    fn get_height(&self) -> Option<f64> {
46        self.get_f3dh()
47    }
48
49    fn get_depth(&self) -> Option<f64> {
50        self.get_f3dd()
51    }
52}