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 || show_bending_moment_z || show_force_shear_z ||
60  show_bending_moment_y || show_torsion_moment;
61  }
62 
64  double image_width = 1024;
65 
66  double NODE_RADIUS = 5e-3;
67  double BEAM_PINNED_RADIUS = 10e-3;
68  double EDGE_WIDTH = 5e-3;
69  unsigned int PIN_SPHERE_DIVS = 8; // long and latitude sphere divisions
70  unsigned int NODE_SPHERE_DIVS = 5; // long and latitude sphere divisions
71 
75 
76  double deformed_scale_factor_for_bbox = 0;
77 
82 
86 
87  double labels_size = 15.0;
88 
90  double margin_left = 0, margin_right = 0, margin_top = 0, margin_bottom = 0;
91 
92  //--- color params ---
93  double elements_original_alpha = 1, elements_deformed_alpha = 1;
94  double nodes_original_alpha = 1, nodes_deformed_alpha = 1;
95  double constraints_original_alpha = 1,
97  double loads_original_alpha = 1, loads_deformed_alpha = 1;
98 
99 }; // end of DrawStructureOptions
100 
102 {
103  DrawElementExtraParams() = default;
104 
107  size_t element_index = 0;
108  double color_alpha = 1;
109  const StaticSolveProblemInfo* solver_info = nullptr;
110  num_t deformed_scale_factor = 1;
111 };
112 
114 {
115  num_t min_x = 0, max_x = 0, min_y = 0, max_y = 0;
116  double width = 0, height = 0;
117  double scaleFactor = 1;
118 };
119 
120 } // namespace openbeam
Definition: DrawStructureOptions.h:102
bool draw_original_position
If false, draw the final deformed position.
Definition: DrawStructureOptions.h:106
Definition: DrawStructureOptions.h:34
double image_width
Default: 1024px (Height is automatically determined)
Definition: DrawStructureOptions.h:64
double deformed_scale_auto_max_image_ratio
Definition: DrawStructureOptions.h:81
double nodes_deformed_alpha
[0,1]
Definition: DrawStructureOptions.h:94
double deformed_scale_factor
Definition: DrawStructureOptions.h:74
bool show_elements_deformed
Draw final deformed elements.
Definition: DrawStructureOptions.h:44
double node_loads_max_relative_size
Definition: DrawStructureOptions.h:85
double margin_left
In structure units.
Definition: DrawStructureOptions.h:90
double elements_deformed_alpha
[0,1]
Definition: DrawStructureOptions.h:93
double loads_deformed_alpha
[0,1]
Definition: DrawStructureOptions.h:97
bool show_elements_original
Draw original undeformed elements.
Definition: DrawStructureOptions.h:43
double constraints_deformed_alpha
[0,1]
Definition: DrawStructureOptions.h:96
Definition: DrawStructureOptions.h:114
Definition: CFiniteElementProblem.h:107