~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/covira/vis3d.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* vis3d.c
  2  *
  3  * @(#) vis3d tv functionality
  4  *
  5  */
  6 #include <tina/all_tina.h>
  7 #include <tina/brain.h>
  8 #include <tina/brainfuncs.h>
  9 
 10 static Tv *vis3d_tv = NULL;
 11 Tv *vis3d_tv_get(void)
 12 {
 13     return (vis3d_tv);
 14 }
 15 
 16 void vis3d_tv_set(Tv * tv)
 17 {
 18     vis3d_tv = tv;
 19 }
 20 
 21 static void vis3d_init(Tv * tv)
 22 {
 23     Vec3 aim, centre, down;
 24     double radius, pscale;
 25     Imstack *ims = ims_imstack_get();
 26 
 27     if (ims == NULL)
 28     {
 29         centre = vec3(128.0, 128.0, 0.0);
 30         radius = 128.0;
 31     } else
 32     {
 33         Vec3 l, u;
 34 
 35         l = vec3(ims->lx, ims->ly, ims->lz);
 36         u = vec3(ims->ux, ims->uy, ims->uz);
 37         centre = vec3_midpoint(l, u);
 38         radius = vec3_dist(centre, u);
 39     }
 40     aim = vec3(-2.0, -1.0, 1.0);
 41     down = vec3_ez();
 42     pscale = 5.0;
 43     tv_camera3(tv, centre, radius, pscale, aim, down);
 44 }
 45 
 46 static void vis3d_fulldraw(Tv * tv)
 47 {
 48     /*ims_box_draw3(tv, 1.0);*/
 49     ims_all_strings_draw3(tv);
 50     /*ims_box_draw3(tv, -1.0);*/
 51 }
 52 
 53 static void vis3d_skeldraw(Tv * tv)
 54 {
 55     ims_strings_skeldraw3(tv, 16, 32);
 56 }
 57 
 58 /* Create the vis3d window */
 59 void create_vis3d_display(void)
 60 {
 61     vis3d_tv = display_create("3D", 430, 60, 400, 400);
 62     tv_cmap_create_fn_set(vis3d_tv, tv_grey_cmap_create);
 63     tv_set_init(vis3d_tv, vis3d_init);
 64     tv_set_fulldraw(vis3d_tv, vis3d_fulldraw);
 65     tv_set_skeldraw(vis3d_tv, vis3d_skeldraw);
 66     tv_set_activity(vis3d_tv, ZOOM);
 67     tv_set_zoomlevel(vis3d_tv, ZOOMGR);
 68     tv_set_axis(vis3d_tv, vec3_ez());
 69     tv_set_proj3(vis3d_tv, ORTH);
 70     tv_init(vis3d_tv);
 71 }
 72 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.