FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
CHECDB_Visual.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright (c) 2019 FrontISTR Commons
3 * This software is released under the MIT License, see LICENSE.txt
4 *****************************************************************************/
5/*
6 CHECDB_Visual Ver. 3.6
7*/
8
9#ifndef CHECDB_VisualH
10#define CHECDB_VisualH
11
12#include "CHECDataBlock.h"
13
14// parameters for screen
16 public:
17 // screen
18
19 int x_resolution; // default:512
20 int y_resolution; // default:512
21 int num_of_lights; // default:1
22 double* position_of_lights; // (default:NULL--not specified)
23 double viewpoint[3];
24 bool fg_viewpoint; // (inner use, default:false);
25 double look_at_point[3];
26 bool fg_look_at_point; // (inner use, default:false);
27 double up_direction[3]; // default:{0,0,1}
28 double ambient_coef; // default:0.3
29 double diffuse_coef; // default:0.7
30 double specular_coef; // default:0.6
32 enum {
37 };
38 int interval_mapping_num; // (default:0)
39 double* interval_mapping; // (default:NULL -- not specified)
40
42 enum {
43 rotate_style_none = 0, // default ( inner use )
48 };
49 int num_of_frame; // default:8
50 int color_mapping_bar_on; // default:0
51 int scale_marking_on; // default:0
52 int num_of_scales; // default:3
53 double font_size; // default:1
54 double font_color[3]; // default:{1,1,1}
55 double background_color[3]; // default:{0,0,0}
56
58 enum {
62 };
63 int fixed_range_on; // default:0
64 double range_value[2];
65 bool fg_range_value; // (inner use, default:false)
66
67 public:
68 // methods
70 virtual ~CVis_ViewParams();
71 virtual void Init();
72 virtual void Write(class CHECData* hecd);
73 static void WriteVisParam(class CHECData* hecd, const char* name,
74 const char* fmt, ...);
75 static void WriteVisPArry(class CHECData* hecd, const char* name, char type,
76 int n, void* p); // for array
77
78 template <class T>
79 static int ReadVisValueT(char* s, int n, T* value, const char* fmt);
80 static int ReadVisValue(char* s, int n, int* value);
81 static int ReadVisValue(char* s, int n, double* value);
82 static int ReadVisValue(
83 char* s, int n, char* value); // n:sizeof(value), return:strlen(value)
84 template <class T>
85 static T* ReadVisPArry(char* s, int& n, const char* fmt);
86
87 virtual bool ReadData(const char* line);
88 virtual bool Read(class CHECData* hecd);
89};
90
91//-----------------------------------------------------------------------------
92
93class CVis_PSR : public CVis_ViewParams {
94 public:
95 // common ------------------------------------------------
96
98 enum {
99 surface_style_boundary = 1, // default
102 };
104 enum {
105 display_method_color = 1, // default
110 };
112 char color_subcomp_name[4]; // "norm", "x"(default), "y" or "z"
113 int color_comp; // default:0
114 int color_subcomp; // default:1
115 int iso_number; // default:5
116 double specified_color; // effective if display_method == 4
117 int deform_display_on; // 1:on, 0:off, default:0
119 int deform_comp; // default:0
121 bool fg_deform_scale; // is deform_scale set? (inner use) default:false
123 enum {
124 initial_style_none = 0, // default
129 };
131 enum {
136 deform_style_dot_mesh // default
137 };
138 double initial_line_color[3]; // default:{0,0,1}
139 double deform_line_color[3]; // default:{0,0,1}
140 char output_type[3]; // "AVS"(default), "BMP"
141
142 // for surface_style == surface_style_equivalent ---------
143
144 char data_comp_name[100];
145 char data_subcomp_name[4]; // "norm", "x"(default), "y" or "z"
146 int data_comp; // default:0
147 int data_subcomp; // default:1
148 double iso_value;
149
150 // for surface_style == surface_style_user ---------------
151
153 enum {
158 method_quadric // default
159 };
160 double point[3]; // default:{0,0,0}
161 double radius; // default:1.0
162 double length; // (default:1.0)
163 double coef[10]; // (default:0.0)
164
165 // rendering parameters(output_type == "BMP") ------------
166 // parameters defined in CVis_ScreenParams and followings
167
168 double isoline_color[3];
169 bool fg_isoline_color; // (inner use, default:false )
170 int boundary_line_on; // default:0
171
172 public:
173 // methods
174 CVis_PSR();
175 virtual ~CVis_PSR();
176 virtual void Init();
177 virtual void Write(class CHECData* hecd);
178 virtual bool ReadData(const char* line);
179};
180
181//-----------------------------------------------------------------------------
182
183class CVis_PVR : public CVis_ViewParams {
184 public:
185 // for dividing ------------------------------------------
186
187 int maximum_refinement; // default:100
189 bool fg_n_voxel_x; // (inner use, default:false)
191 bool fg_n_voxel_y; // (inner use, default:false)
193 bool fg_n_voxel_z; // (inner use, default:false)
194 char voxel_filename[100]; // default:""
195 int x_specified_level; // default:100
196 int y_specified_level; // default:100
197 int z_specified_level; // default:100
198
199 // for opacity
200
201 int transfer_function_type; // default:1
202 double opa_value; // default:0.02
203 int num_of_features; // (default:0)
204 double* fea_point; // (default:NULL (no set))
205 char name_lookup[100]; // (default:"" (no set))
206
207 // parameters defined in CVis_ViewParams and followings
208
209 int histogram_on; // default:0
210 double display_range[6]; // (default:0)
211 bool fg_display_range; // (inner use, default:false)
212
213 public:
214 // methods
215 CVis_PVR();
216 virtual ~CVis_PVR();
217 virtual void Init();
218 virtual void Write(class CHECData* hecd);
219 virtual bool ReadData(const char* line);
220};
221
222//-----------------------------------------------------------------------------
223// CHECDB_Visual
224//-----------------------------------------------------------------------------
225
227 public:
231
233 std::vector<CVis_PSR*> psr; // psr.size() == surface_num
234
235 CVis_PVR* pvr; // single instance
236
238 virtual ~CHECDB_Visual();
239 virtual void Clear();
240 virtual void Write(class CHECData* hecd);
241 virtual bool Read(class CHECData* hecd, char* header_line);
242};
243
244#endif
int visual_interval_step
virtual ~CHECDB_Visual()
virtual void Write(class CHECData *hecd)
CVis_PVR * pvr
virtual void Clear()
virtual bool Read(class CHECData *hecd, char *header_line)
std::vector< CVis_PSR * > psr
char deform_comp_name[100]
double radius
int data_subcomp
double length
int deform_display_on
virtual ~CVis_PSR()
int display_method
char data_subcomp_name[4]
@ deform_style_fill
@ deform_style_none
@ deform_style_mesh
@ deform_style_dot_mesh
@ deform_style_shading
int color_comp
virtual bool ReadData(const char *line)
int surface_style
Definition: CHECDB_Visual.h:97
double iso_value
char color_comp_name[100]
char color_subcomp_name[4]
double deform_line_color[3]
double deform_scale
bool fg_isoline_color
int iso_number
int initial_style
double initial_line_color[3]
double specified_color
int deform_comp
int color_subcomp
double isoline_color[3]
bool fg_deform_scale
int boundary_line_on
virtual void Init()
@ surface_style_user
@ surface_style_equivalent
@ surface_style_boundary
Definition: CHECDB_Visual.h:99
char output_type[3]
@ display_method_mono_tone
@ display_method_color
@ display_method_color_and_boundary
@ display_method_contour
@ display_method_boundary
double coef[10]
@ initial_style_none
@ initial_style_shading
@ initial_style_mesh
@ initial_style_dot_mesh
@ initial_style_fill
virtual void Write(class CHECData *hecd)
int deform_style
double point[3]
char data_comp_name[100]
@ method_hyperbola
@ method_ellipsoid
int transfer_function_type
bool fg_n_voxel_z
double opa_value
double * fea_point
bool fg_n_voxel_x
int maximum_refinement
int z_specified_level
int histogram_on
virtual void Init()
virtual ~CVis_PVR()
double display_range[6]
virtual void Write(class CHECData *hecd)
bool fg_display_range
char voxel_filename[100]
int num_of_features
bool fg_n_voxel_y
virtual bool ReadData(const char *line)
int x_specified_level
int y_specified_level
char name_lookup[100]
@ color_mapping_style_automatic
Definition: CHECDB_Visual.h:36
@ color_mapping_style_clipped_linear
Definition: CHECDB_Visual.h:34
@ color_mapping_style_nonlinear
Definition: CHECDB_Visual.h:35
virtual bool Read(class CHECData *hecd)
double up_direction[3]
Definition: CHECDB_Visual.h:27
virtual bool ReadData(const char *line)
double range_value[2]
Definition: CHECDB_Visual.h:64
double specular_coef
Definition: CHECDB_Visual.h:30
static void WriteVisParam(class CHECData *hecd, const char *name, const char *fmt,...)
@ color_system_type_block_white
Definition: CHECDB_Visual.h:61
double * position_of_lights
Definition: CHECDB_Visual.h:22
static T * ReadVisPArry(char *s, int &n, const char *fmt)
virtual void Write(class CHECData *hecd)
static void WriteVisPArry(class CHECData *hecd, const char *name, char type, int n, void *p)
virtual void Init()
double font_color[3]
Definition: CHECDB_Visual.h:54
static int ReadVisValueT(char *s, int n, T *value, const char *fmt)
double look_at_point[3]
Definition: CHECDB_Visual.h:25
double * interval_mapping
Definition: CHECDB_Visual.h:39
virtual ~CVis_ViewParams()
double background_color[3]
Definition: CHECDB_Visual.h:55
static int ReadVisValue(char *s, int n, int *value)
double viewpoint[3]
Definition: CHECDB_Visual.h:23