FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_vis_ray_trace.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 #ifndef HECMW_VIS_RAY_TRACE_H_INCLUDED
7 #define HECMW_VIS_RAY_TRACE_H_INCLUDED
8 
9 /*
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <math.h>
13 #include <string.h>
14 #include <memory.h>
15 #include <ctype.h>
16 #include "hecmw_vis_resampling.h"
17 #include "hecmw_vis_bmp.h"
18 #include "hecmw_vis_comm_util.h"
19 */
20 #define MASTER_PE 0
21 /*
22 #define CONVERSE_ORDER
23 
24 #include <sys/types.h>
25 #include <sys/timeb.h>
26 #include <time.h>
27 #include "glos.h"
28 #include <GL/gl.h>
29 #include <GL/glu.h>
30 #include <GL/glaux.h>
31  */
32 
33 #define EPSILON 0.00000001
34 #define PI 3.1415926
35 /*#define TABLE_SIZE 100
36 #define VERTEX_PACK 50
37 #define POLYGON_PACK 100
38 #define VERTEX_KIND 27
39 
40 #define HEX_N_NODE 8
41 #define HEX_N_FACE 6
42 #define HEX_NODE_INDEX 255
43 #define HEX_FACE_INDEX 63
44  */
45 #define SQR(x) (x) * (x)
46 #define HASH_TABLE_SIZE 10000
47 /*#define ResSize 1
48 #define PixelSize 1
49  */
50 #define DIGN_PE 2
51 
52 #define BAR_WIDTH 10
53 #define NUM_CONTROL_PVR 51
54 #define MAX_N_NODE 20
55 
56 typedef struct _vr_parameter_struct {
57  int max_level;
58  int xr;
59  int yr;
62  double *light_point;
63 
64  double view_point_d[3];
65  double screen_point[3];
66 
67  double up[3];
68 
69  double k_ads[3];
72 
74 
76 
77  double *interval_point; /* 2:mincolor, maxcolor 3: interval_mapping_num*2
78  (value, mark_value) */
79 
81  /* 1: constant input: value
82 2: first-order derivatives input: none
83  3: feature points input: num_of_featurepoints, point[num]
84  4: feature intervals input: num_of_intervals point[num*2]
85  5: distance inverse
86  6: distance proportional
87  7: look-up table input: name of the look-up table file
88  */
89  double opa_value;
91  double *fea_point;
92  char name_lookup[128];
93 
98  char name_voxelfile[128];
99  double background_color[3];
100  double font_color[3];
102  double font_size;
105  double range_value[2];
109 
112  char color_comp_name[100];
116  int nv_xyz[3];
117  double display_range[6];
120 } Parameter_vr;
121 
122 typedef struct _pvr_link_struct {
124 
131 } PVR_link;
132 
133 typedef struct surface_info_struct {
134  int num;
135  double *surf_data;
136 } Surface_info;
137 
139  double dxyz[3];
140  int leveltot;
142  char **varname;
143  int nxyz[3];
144  double xyz0[3];
147  /* int *rlevel;
148  int *parent;
149  */
150  int r_nxyz[3];
151  double r_dxyz[3];
153  double *var;
154  double *grad_var;
156 } VR_data;
157 
158 typedef struct _tree_pointer_struct {
159  int cell_id[8];
160  int surf_id;
161  int level;
162  double bound_box[6];
168 } Tree_pointer;
169 
171 /*
172 typedef struct _ray_volume_struct {
173  Elem_no elem_id;
174  int face_id;
175  double p[3];
176  struct _ray_volume_struct *next_elem;
177  } Ray_volume;
178 
179 typedef struct _head_ray_volume_struct {
180  int elem_num;
181  Ray_volume *next_elem;
182 } Head_ray_volume;
183  */
184 
185 int find_first_inter(double point_o[3], double view_point_d[3], int r_level[3],
186  double orig_xyz[3], double dxyz[3], double r_dxyz[3],
187  double ray_direction[3], double first_p[3], int ijk[3]);
188 void ray_trace(int remove_0_display_on, int color_mapping_style,
189  double *interval_point, int transfer_function_style,
190  double opa_value, int num_of_features, double *fea_point,
191  double view_point_d[3], int interval_mapping_num,
192  int color_system_type, int num_of_lights, double *light_point,
193  double k_ads[3], double orig_xyz[3], double dxyz[3],
194  double r_dxyz[3], int r_level[3], int *empty_flag, double *var,
195  double *grad_var, double first_p[3], int first_ijk[3],
196  double ray_direction[3], double mincolor, double maxcolor,
197  double accum_rgba[4], double grad_minmax[2],
198  double feap_minmax[2], double feai_minmax[2],
199  double dis_minmax[2], double *opa_table, double tav_length,
200  int time_step, int test_i, int test_j);
201 
202 #endif /* HECMW_VIS_RAY_TRACE_H_INCLUDED */
_data_structured_vr_struct::xyz0
double xyz0[3]
Definition: hecmw_vis_ray_trace.h:144
_data_structured_vr_struct::nxyz
int nxyz[3]
Definition: hecmw_vis_ray_trace.h:143
_data_structured_vr_struct::empty_flag
int * empty_flag
Definition: hecmw_vis_ray_trace.h:152
_tree_pointer_struct::local_child_no
int local_child_no
Definition: hecmw_vis_ray_trace.h:163
_vr_parameter_struct::surface_opacity
double surface_opacity
Definition: hecmw_vis_ray_trace.h:71
_tree_pointer_struct
Definition: hecmw_vis_ray_trace.h:158
_data_structured_vr_struct::leveltot
int leveltot
Definition: hecmw_vis_ray_trace.h:140
_vr_parameter_struct::color_comp_name
char color_comp_name[100]
Definition: hecmw_vis_ray_trace.h:112
_tree_pointer_struct::surf_id
int surf_id
Definition: hecmw_vis_ray_trace.h:160
PVR_link
struct _pvr_link_struct PVR_link
_vr_parameter_struct::num_of_lights
int num_of_lights
Definition: hecmw_vis_ray_trace.h:61
_vr_parameter_struct::color_system_type
int color_system_type
Definition: hecmw_vis_ray_trace.h:101
_vr_parameter_struct::remove_0_display_on
int remove_0_display_on
Definition: hecmw_vis_ray_trace.h:110
Surface_info
struct surface_info_struct Surface_info
_vr_parameter_struct::fixed_scale_mark
int fixed_scale_mark
Definition: hecmw_vis_ray_trace.h:119
_vr_parameter_struct::color_mapping_style
int color_mapping_style
Definition: hecmw_vis_ray_trace.h:73
_tree_pointer_struct::bound_box
double bound_box[6]
Definition: hecmw_vis_ray_trace.h:162
ray_trace
void ray_trace(int remove_0_display_on, int color_mapping_style, double *interval_point, int transfer_function_style, double opa_value, int num_of_features, double *fea_point, double view_point_d[3], int interval_mapping_num, int color_system_type, int num_of_lights, double *light_point, double k_ads[3], double orig_xyz[3], double dxyz[3], double r_dxyz[3], int r_level[3], int *empty_flag, double *var, double *grad_var, double first_p[3], int first_ijk[3], double ray_direction[3], double mincolor, double maxcolor, double accum_rgba[4], double grad_minmax[2], double feap_minmax[2], double feai_minmax[2], double dis_minmax[2], double *opa_table, double tav_length, int time_step, int test_i, int test_j)
Definition: hecmw_vis_ray_trace.c:731
_tree_pointer_struct::local_face_in
int local_face_in
Definition: hecmw_vis_ray_trace.h:164
Parameter_vr
struct _vr_parameter_struct Parameter_vr
_vr_parameter_struct
Definition: hecmw_vis_ray_trace.h:56
_vr_parameter_struct::k_ads
double k_ads[3]
Definition: hecmw_vis_ray_trace.h:69
_vr_parameter_struct::num_of_features
int num_of_features
Definition: hecmw_vis_ray_trace.h:90
VR_data
struct _data_structured_vr_struct VR_data
_data_structured_vr_struct::r_nxyz
int r_nxyz[3]
Definition: hecmw_vis_ray_trace.h:150
_data_structured_vr_struct::varname
char ** varname
Definition: hecmw_vis_ray_trace.h:142
_vr_parameter_struct::name_lookup
char name_lookup[128]
Definition: hecmw_vis_ray_trace.h:92
_vr_parameter_struct::fixed_range_on
int fixed_range_on
Definition: hecmw_vis_ray_trace.h:104
_data_structured_vr_struct::surface
Surface_info * surface
Definition: hecmw_vis_ray_trace.h:155
find_first_inter
int find_first_inter(double point_o[3], double view_point_d[3], int r_level[3], double orig_xyz[3], double dxyz[3], double r_dxyz[3], double ray_direction[3], double first_p[3], int ijk[3])
Definition: hecmw_vis_ray_trace.c:271
_vr_parameter_struct::color_bar_style
int color_bar_style
Definition: hecmw_vis_ray_trace.h:103
_vr_parameter_struct::mark_0_on
int mark_0_on
Definition: hecmw_vis_ray_trace.h:107
_tree_pointer_struct::local_face_out
int local_face_out
Definition: hecmw_vis_ray_trace.h:165
_vr_parameter_struct::background_color
double background_color[3]
Definition: hecmw_vis_ray_trace.h:99
_tree_pointer_struct::level
int level
Definition: hecmw_vis_ray_trace.h:161
_vr_parameter_struct::specified_level
int specified_level[3]
Definition: hecmw_vis_ray_trace.h:111
_data_structured_vr_struct::voxtotadd
int voxtotadd
Definition: hecmw_vis_ray_trace.h:145
_data_structured_vr_struct::voxtotall
int voxtotall
Definition: hecmw_vis_ray_trace.h:146
_vr_parameter_struct::num_of_frames
int num_of_frames
Definition: hecmw_vis_ray_trace.h:97
_vr_parameter_struct::projection_style
int projection_style
Definition: hecmw_vis_ray_trace.h:60
_vr_parameter_struct::display_range
double display_range[6]
Definition: hecmw_vis_ray_trace.h:117
_vr_parameter_struct::font_color
double font_color[3]
Definition: hecmw_vis_ray_trace.h:100
_tree_pointer_struct::cell_id
int cell_id[8]
Definition: hecmw_vis_ray_trace.h:159
_vr_parameter_struct::surface_on
int surface_on
Definition: hecmw_vis_ray_trace.h:70
NUM_CONTROL_PVR
#define NUM_CONTROL_PVR
Definition: hecmw_vis_ray_trace.h:53
surface_info_struct
Definition: hecmw_vis_ray_trace.h:133
_vr_parameter_struct::light_point
double * light_point
Definition: hecmw_vis_ray_trace.h:62
_vr_parameter_struct::num_of_scale
int num_of_scale
Definition: hecmw_vis_ray_trace.h:106
_vr_parameter_struct::font_size
double font_size
Definition: hecmw_vis_ray_trace.h:102
_data_structured_vr_struct
Definition: hecmw_vis_ray_trace.h:138
_vr_parameter_struct::time_mark_on
int time_mark_on
Definition: hecmw_vis_ray_trace.h:118
_vr_parameter_struct::rotate_style
int rotate_style
Definition: hecmw_vis_ray_trace.h:94
_data_structured_vr_struct::grad_var
double * grad_var
Definition: hecmw_vis_ray_trace.h:154
_vr_parameter_struct::color_subcomp_name
char color_subcomp_name[5]
Definition: hecmw_vis_ray_trace.h:114
_data_structured_vr_struct::var
double * var
Definition: hecmw_vis_ray_trace.h:153
_vr_parameter_struct::max_level
int max_level
Definition: hecmw_vis_ray_trace.h:57
_vr_parameter_struct::screen_point
double screen_point[3]
Definition: hecmw_vis_ray_trace.h:65
_data_structured_vr_struct::varnumtot
int varnumtot
Definition: hecmw_vis_ray_trace.h:141
_vr_parameter_struct::histogram_on
int histogram_on
Definition: hecmw_vis_ray_trace.h:108
surface_info_struct::num
int num
Definition: hecmw_vis_ray_trace.h:134
Tree_pointer_ptr
Tree_pointer * Tree_pointer_ptr
Definition: hecmw_vis_ray_trace.h:170
surface_info_struct::surf_data
double * surf_data
Definition: hecmw_vis_ray_trace.h:135
_data_structured_vr_struct::dxyz
double dxyz[3]
Definition: hecmw_vis_ray_trace.h:139
_vr_parameter_struct::transfer_function_style
int transfer_function_style
Definition: hecmw_vis_ray_trace.h:80
_vr_parameter_struct::name_voxelfile
char name_voxelfile[128]
Definition: hecmw_vis_ray_trace.h:98
_tree_pointer_struct::parent
struct _tree_pointer_struct * parent
Definition: hecmw_vis_ray_trace.h:167
_vr_parameter_struct::color_mapping_bar_on
int color_mapping_bar_on
Definition: hecmw_vis_ray_trace.h:95
_vr_parameter_struct::view_point_d
double view_point_d[3]
Definition: hecmw_vis_ray_trace.h:64
_vr_parameter_struct::interval_mapping_num
int interval_mapping_num
Definition: hecmw_vis_ray_trace.h:75
_vr_parameter_struct::opa_value
double opa_value
Definition: hecmw_vis_ray_trace.h:89
_vr_parameter_struct::fea_point
double * fea_point
Definition: hecmw_vis_ray_trace.h:91
_vr_parameter_struct::scale_marking_on
int scale_marking_on
Definition: hecmw_vis_ray_trace.h:96
_vr_parameter_struct::xr
int xr
Definition: hecmw_vis_ray_trace.h:58
_vr_parameter_struct::color_comp
int color_comp
Definition: hecmw_vis_ray_trace.h:113
_vr_parameter_struct::up
double up[3]
Definition: hecmw_vis_ray_trace.h:67
_data_structured_vr_struct::r_dxyz
double r_dxyz[3]
Definition: hecmw_vis_ray_trace.h:151
_vr_parameter_struct::range_value
double range_value[2]
Definition: hecmw_vis_ray_trace.h:105
_vr_parameter_struct::interval_point
double * interval_point
Definition: hecmw_vis_ray_trace.h:77
_vr_parameter_struct::yr
int yr
Definition: hecmw_vis_ray_trace.h:59
_vr_parameter_struct::nv_xyz
int nv_xyz[3]
Definition: hecmw_vis_ray_trace.h:116
Tree_pointer
struct _tree_pointer_struct Tree_pointer
_tree_pointer_struct::child
struct _tree_pointer_struct * child
Definition: hecmw_vis_ray_trace.h:166
_vr_parameter_struct::color_subcomp
int color_subcomp
Definition: hecmw_vis_ray_trace.h:115