OpenBeam
C++ library for static analysis of mechanical structures
DrawStructureOptions.h
1 /* +---------------------------------------------------------------------------+
2  | OpenBeam - C++ Finite Element Analysis library |
3  | |
4  | Copyright (C) 2010-2021 Jose Luis Blanco Claraco |
5  | University of Malaga |
6  | |
7  | OpenBeam is free software: you can redistribute it and/or modify |
8  | it under the terms of the GNU General Public License as published by |
9  | the Free Software Foundation, either version 3 of the License, or |
10  | (at your option) any later version. |
11  | |
12  | OpenBeam is distributed in the hope that it will be useful, |
13  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15  | GNU General Public License for more details. |
16  | |
17  | You should have received a copy of the GNU General Public License |
18  | along with OpenBeam. If not, see <http://www.gnu.org/licenses/>. |
19  | |
20  +---------------------------------------------------------------------------+
21  */
22 
23 #pragma once
24 
25 #include <openbeam/types.h>
26 
27 namespace openbeam
28 {
29 struct StaticSolveProblemInfo;
30 
34 {
35  DrawStructureOptions() = default;
36  ~DrawStructureOptions() = default;
37 
38  void loadFromYaml(const mrpt::containers::yaml& d);
39 
40  bool show_nodes_original = true;
41  bool show_nodes_deformed = false;
42  bool show_node_labels = false;
43  bool show_elements_original = true;
44  bool show_elements_deformed = false;
45  bool show_element_labels = true;
46  bool show_loads = true;
47  bool show_constraints = true;
48 
49  // Stress plots:
50  bool show_force_axial = false;
51  bool show_force_shear_y = false;
52  bool show_bending_moment_z = false;
53  bool show_force_shear_z = false;
54  bool show_bending_moment_y = false;
55  bool show_torsion_moment = false;
56 
57  bool show_any_stress() const
58  {
59  return show_force_axial || show_force_shear_y ||
60  show_bending_moment_z || show_force_shear_z ||
61  show_bending_moment_y || show_torsion_moment;
62  }
63 
65  double image_width = 1024;
66 
67  double NODE_RADIUS = 5e-3;
68  double BEAM_PINNED_RADIUS = 10e-3;
69  double EDGE_WIDTH = 5e-3;
70  unsigned int PIN_SPHERE_DIVS = 8; // long and latitude sphere divisions
71  unsigned int NODE_SPHERE_DIVS = 5; // long and latitude sphere divisions
72 
76 
77  double deformed_scale_factor_for_bbox = 0;
78 
83 
87 
88  double labels_size = 15.0;
89 
91  double margin_left = 0, margin_right = 0, margin_top = 0, margin_bottom = 0;
92 
93  //--- color params ---
94  double elements_original_alpha = 1, elements_deformed_alpha = 1;
95  double nodes_original_alpha = 1, nodes_deformed_alpha = 1;
96  double constraints_original_alpha = 1,
98  double loads_original_alpha = 1, loads_deformed_alpha = 1;
99 
100 }; // end of DrawStructureOptions
101 
103 {
104  DrawElementExtraParams() = default;
105 
108  size_t element_index = 0;
109  double color_alpha = 1;
110  const StaticSolveProblemInfo* solver_info = nullptr;
111  num_t deformed_scale_factor = 1;
112 };
113 
115 {
116  num_t min_x = 0, max_x = 0, min_y = 0, max_y = 0;
117  double width = 0, height = 0;
118  double scaleFactor = 1;
119 };
120 
121 } // namespace openbeam
Definition: DrawStructureOptions.h:103
bool draw_original_position
If false, draw the final deformed position.
Definition: DrawStructureOptions.h:107
Definition: DrawStructureOptions.h:34
double image_width
Default: 1024px (Height is automatically determined)
Definition: DrawStructureOptions.h:65
double deformed_scale_auto_max_image_ratio
Definition: DrawStructureOptions.h:82
double nodes_deformed_alpha
[0,1]
Definition: DrawStructureOptions.h:95
double deformed_scale_factor
Definition: DrawStructureOptions.h:75
bool show_elements_deformed
Draw final deformed elements.
Definition: DrawStructureOptions.h:44
double node_loads_max_relative_size
Definition: DrawStructureOptions.h:86
double margin_left
In structure units.
Definition: DrawStructureOptions.h:91
double elements_deformed_alpha
[0,1]
Definition: DrawStructureOptions.h:94
double loads_deformed_alpha
[0,1]
Definition: DrawStructureOptions.h:98
bool show_elements_original
Draw original undeformed elements.
Definition: DrawStructureOptions.h:43
double constraints_deformed_alpha
[0,1]
Definition: DrawStructureOptions.h:97
Definition: DrawStructureOptions.h:115
Definition: CFiniteElementProblem.h:106