FrontISTR  5.7.1
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];
121 
122 typedef struct _pvr_link_struct {
124 
132 
133 typedef struct surface_info_struct {
134  int num;
135  double *surf_data;
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;
157 
158 typedef struct _tree_pointer_struct {
159  int cell_id[8];
160  int surf_id;
161  int level;
162  double bound_box[6];
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 */
Tree_pointer * Tree_pointer_ptr
struct surface_info_struct Surface_info
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])
#define NUM_CONTROL_PVR
struct _data_structured_vr_struct VR_data
struct _tree_pointer_struct Tree_pointer
struct _vr_parameter_struct Parameter_vr
struct _pvr_link_struct PVR_link
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)
struct _tree_pointer_struct * parent
struct _tree_pointer_struct * child