stb_parser/st_bridge/stb_model/
stb_members.rs

1use strum_macros::EnumString;
2
3#[derive(Debug)]
4pub struct StbMembers {
5    pub stb_columns: StbColumns,
6    pub stb_posts: StbPosts,
7    pub stb_girders: StbGirders,
8    pub stb_beams: StbBeams,
9    pub stb_braces: StbBraces,
10    pub stb_slabs: StbSlabs,
11    // TODO: implement StbWalls
12    // TODO: implement StbFootings
13    // TODO: implement StbStripFootings
14    // TODO: implement StbPiles
15    // TODO: implement StbFoundationColumns
16    // TODO: implement StbParapets
17    // TODO: implement StbOpens
18}
19
20#[derive(Debug)]
21pub struct StbColumns {
22    pub stb_column_list: Vec<StbColumn>,
23}
24
25/*
26impl StbColumns {
27    pub fn new() -> StbColumns {
28        StbColumns {
29            stb_column_list: Vec::new(),
30        }
31    }
32}
33*/
34
35#[derive(Debug)]
36pub struct StbColumn {
37    pub id: i32,
38    pub name: String,
39    pub id_node_bottom: i32,
40    pub id_node_top: i32,
41    pub rotate: f64,
42    pub id_section: i32,
43    pub kind_structure: ColumnStructureKind,
44    pub offset_x: f64,
45    pub offset_y: f64,
46    pub condition_bottom: JointCondition,
47    pub condition_top: JointCondition,
48}
49
50#[derive(Debug, EnumString)]
51pub enum ColumnStructureKind {
52    #[strum(serialize = "RC")]
53    RC,
54    #[strum(serialize = "S")]
55    S,
56    #[strum(serialize = "SRC")]
57    SRC,
58    #[strum(serialize = "CFT")]
59    CFT,
60    #[strum(serialize = "UNDEFINED")]
61    Undefined,
62}
63
64#[derive(Debug, EnumString)]
65pub enum JointCondition {
66    #[strum(serialize = "FIX")]
67    Fix,
68    #[strum(serialize = "PIN")]
69    Pin,
70}
71
72#[derive(Debug)]
73pub struct StbGirders {
74    pub stb_girder_list: Vec<StbGirder>,
75}
76
77/*
78impl StbGirders {
79    pub fn new() -> StbGirders {
80        StbGirders {
81            stb_girder_list: Vec::new(),
82        }
83    }
84}
85*/
86
87#[derive(Debug)]
88pub struct StbGirder {
89    pub id: i32,
90    pub name: String,
91    pub id_node_start: i32,
92    pub id_node_end: i32,
93    pub rotate: f64,
94    pub id_section: i32,
95    pub kind_structure: GirderStructureKind,
96    pub is_foundation: bool,
97    pub offset: f64,
98    pub level: f64,
99    pub type_haunch_h: Option<HaunchType>,
100}
101
102#[derive(Debug, EnumString)]
103pub enum GirderStructureKind {
104    #[strum(serialize = "RC")]
105    RC,
106    #[strum(serialize = "S")]
107    S,
108    #[strum(serialize = "SRC")]
109    SRC,
110    #[strum(serialize = "UNDEFINED")]
111    Undefined,
112}
113
114#[derive(Debug, EnumString)]
115pub enum HaunchType {
116    #[strum(serialize = "BOTH")]
117    Both,
118    #[strum(serialize = "RIGHT")]
119    Right,
120    #[strum(serialize = "LEFT")]
121    Left,
122}
123
124#[derive(Debug)]
125pub struct StbPosts {
126    pub stb_post_list: Vec<StbPost>,
127}
128
129/*
130impl StbPosts {
131    pub fn new() -> StbPosts {
132        StbPosts {
133            stb_post_list: Vec::new(),
134        }
135    }
136}
137*/
138
139#[derive(Debug)]
140pub struct StbPost {
141    pub id: i32,
142    pub name: String,
143    pub id_node_bottom: i32,
144    pub id_node_top: i32,
145    pub rotate: f64,
146    pub id_section: i32,
147    pub kind_structure: ColumnStructureKind,
148    pub offset_x: f64,
149    pub offset_y: f64,
150    pub offset_bottom_x: f64,
151    pub offset_bottom_y: f64,
152    pub offset_bottom_z: f64,
153    pub offset_top_x: f64,
154    pub offset_top_y: f64,
155    pub offset_top_z: f64,
156    pub condition_bottom: JointCondition,
157    pub condition_top: JointCondition,
158}
159
160#[derive(Debug)]
161pub struct StbBeams {
162    pub stb_beam_list: Vec<StbBeam>,
163}
164
165/*
166impl StbBeams {
167    pub fn new() -> StbBeams {
168        StbBeams {
169            stb_beam_list: Vec::new(),
170        }
171    }
172}
173*/
174
175#[derive(Debug)]
176pub struct StbBeam {
177    pub id: i32,
178    pub name: String,
179    pub id_node_start: i32,
180    pub id_node_end: i32,
181    pub rotate: f64,
182    pub id_section: i32,
183    pub kind_structure: GirderStructureKind,
184    pub is_foundation: bool,
185    pub offset: f64,
186    pub level: f64,
187}
188
189#[derive(Debug)]
190pub struct StbSlabs {
191    pub stb_slab_list: Vec<StbSlab>,
192}
193
194/*
195impl StbSlabs {
196    pub fn new() -> StbSlabs {
197        StbSlabs {
198            stb_slab_list: Vec::new(),
199        }
200    }
201}
202*/
203
204#[derive(Debug)]
205pub struct StbSlab {
206    pub id: i32,
207    pub name: String,
208    pub id_section: i32,
209    pub kind_structure: SlabStructureKind,
210    pub kind_slab: SlabKind,
211    pub level: f64,
212    pub is_foundation: bool,
213}
214
215#[derive(Debug, EnumString)]
216pub enum SlabStructureKind {
217    #[strum(serialize = "RC")]
218    RC,
219    #[strum(serialize = "DECK")]
220    Deck,
221    #[strum(serialize = "PRECAST")]
222    Precast,
223}
224
225#[derive(Debug, EnumString)]
226pub enum SlabKind {
227    #[strum(serialize = "NORMAL")]
228    Normal,
229    #[strum(serialize = "CANTI")]
230    Canti,
231}
232
233#[derive(Debug)]
234pub struct StbBraces {
235    pub stb_brace_list: Vec<StbBrace>,
236}
237
238/*
239impl StbBraces {
240    pub fn new() -> StbBraces {
241        StbBraces {
242            stb_brace_list: Vec::new(),
243        }
244    }
245}
246*/
247
248#[derive(Debug)]
249pub struct StbBrace {
250    pub id: i32,
251    pub name: String,
252    pub id_node_start: i32,
253    pub id_node_end: i32,
254    pub rotate: f64,
255    pub id_section: i32,
256    pub kind_structure: BraceStructureKind,
257    pub offset_start_x: f64,
258    pub offset_start_y: f64,
259    pub offset_start_z: f64,
260    pub offset_end_x: f64,
261    pub offset_end_y: f64,
262    pub offset_end_z: f64,
263    pub condition_start: JointCondition,
264    pub condition_end: JointCondition,
265}
266
267#[derive(Debug, EnumString)]
268pub enum BraceStructureKind {
269    #[strum(serialize = "RC")]
270    RC,
271    #[strum(serialize = "S")]
272    S,
273    #[strum(serialize = "SRC")]
274    SRC,
275}