qvolray
diff src/volray.cc @ 29:93d889a3726a
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 14 Apr 2012 20:52:53 +0300 |
parents | aeef3c2ae472 |
children | 40df2cdc6323 |
line diff
1.1 --- a/src/volray.cc Sat Apr 14 16:35:30 2012 +0300 1.2 +++ b/src/volray.cc Sat Apr 14 20:52:53 2012 +0300 1.3 @@ -19,15 +19,12 @@ 1.4 #define XFER_MAP_SZ 512 1.5 1.6 static void render_volume(); 1.7 -static void draw_slice(); 1.8 -static void draw_xfer_func(); 1.9 1.10 /* 1.11 void keyb(unsigned char key, int x, int y); 1.12 void keyb_up(unsigned char key, int x, int y); 1.13 void mouse(int bn, int state, int x, int y); 1.14 void motion(int x, int y); 1.15 -int parse_args(int argc, char **argv); 1.16 */ 1.17 1.18 static void create_ray_texture(int xsz, int ysz, float vfov, Vector2 *tex_scale); 1.19 @@ -88,10 +85,10 @@ 1.20 return volume; 1.21 } 1.22 1.23 -void volray_setvalue(int which, float val) 1.24 +void volray_setvalue(VolRayOpt which, float val) 1.25 { 1.26 switch(which) { 1.27 - case VOLRAY_ZCURSOR: 1.28 + case VolRayOpt::ZCURSOR: 1.29 cur_z = val; 1.30 if(clip_z) { 1.31 set_uniform_float(vol_sdr, "zclip", cur_z); 1.32 @@ -99,7 +96,7 @@ 1.33 post_redisplay(); 1.34 break; 1.35 1.36 - case VOLRAY_ZCLIP: 1.37 + case VolRayOpt::ZCLIP: 1.38 clip_z = val > 0.5; 1.39 set_uniform_float(vol_sdr, "zclip", clip_z ? cur_z : 0.0); 1.40 post_redisplay(); 1.41 @@ -110,13 +107,13 @@ 1.42 } 1.43 } 1.44 1.45 -float volray_getvalue(int which) 1.46 +float volray_getvalue(VolRayOpt which) 1.47 { 1.48 switch(which) { 1.49 - case VOLRAY_ZCURSOR: 1.50 + case VolRayOpt::ZCURSOR: 1.51 return cur_z; 1.52 1.53 - case VOLRAY_ZCLIP: 1.54 + case VolRayOpt::ZCLIP: 1.55 return clip_z > 0.5 ? 1.0 : 0.0; 1.56 break; 1.57 1.58 @@ -143,8 +140,6 @@ 1.59 1.60 if(volume) { 1.61 render_volume(); 1.62 - //draw_slice(); 1.63 - draw_xfer_func(); 1.64 } 1.65 1.66 assert(glGetError() == GL_NO_ERROR); 1.67 @@ -234,7 +229,7 @@ 1.68 glDisable(GL_TEXTURE_3D); 1.69 } 1.70 1.71 -static void draw_xfer_func(void) 1.72 +void volray_draw_xfer(void) 1.73 { 1.74 glMatrixMode(GL_MODELVIEW); 1.75 glPushMatrix(); 1.76 @@ -396,7 +391,6 @@ 1.77 //} 1.78 } 1.79 1.80 -#if 0 1.81 int parse_args(int argc, char **argv) 1.82 { 1.83 int i; 1.84 @@ -426,21 +420,12 @@ 1.85 return -1; 1.86 } 1.87 } else { 1.88 - if(fname) { 1.89 - fprintf(stderr, "unexpected argument: %s\n", argv[i]); 1.90 - return -1; 1.91 - } 1.92 - fname = argv[i]; 1.93 + fprintf(stderr, "unexpected argument: %s\n", argv[i]); 1.94 } 1.95 } 1.96 1.97 - if(!fname) { 1.98 - fprintf(stderr, "pass the volume descriptor filename\n"); 1.99 - return -1; 1.100 - } 1.101 return 0; 1.102 } 1.103 -#endif 1.104 1.105 1.106 static void create_ray_texture(int xsz, int ysz, float vfov, Vector2 *tex_scale)