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

Linux Cross Reference
Tina4/src/tools/gstat/gstat_view.c

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

  1 /**@(#)
  2 **/
  3 #include <stdio.h>
  4 #include <tina/sys.h>
  5 #include <tina/math.h>
  6 #include <tina/mathfuncs.h>
  7 #include <tina/vision.h>
  8 #include <tina/visionfuncs.h>
  9 #include <tina/tv.h>
 10 #include <tina/tvfuncs.h>
 11 #include <tina/draw.h>
 12 #include <tina/drawfuncs.h>
 13 
 14 static Bool new_size;
 15 
 16 State  *gstat_get();
 17 
 18 Tv     *tv_create();
 19 
 20 
 21 Bool    state_set_new_size(Bool flag)
 22 {
 23     new_size = flag;
 24 }
 25 
 26 Bool    state_new_size(void)
 27 {
 28     return (new_size);
 29 }
 30 
 31 void    gstat_format(void)
 32 {
 33     State  *state = gstat_get();
 34 
 35     state_format(state);
 36 }
 37 
 38 void    gstat_cov_format(void)
 39 {
 40     State  *state = gstat_get();
 41 
 42     state_cov_format(state);
 43 }
 44 
 45 void    gstat_fulldraw(Tv * tv)
 46 {
 47     State  *state = gstat_get();
 48 
 49     if (state_new_size())
 50         tv_init(tv);
 51 
 52     (void) tv_set_zoomlevel(tv, ZOOM3);
 53     state_draw(tv, state);
 54 }
 55 
 56 void    gstat_skeldraw(Tv * tv)
 57 {
 58     State  *state = gstat_get();
 59 
 60     state_draw(tv, state);
 61 }
 62 
 63 void    gstat_init(Tv * tv)
 64 {
 65     Vec3    centre = {Vec3_id};
 66     Vec3    aim = {Vec3_id};
 67     Vec3    down = {Vec3_id};
 68     float   radius, pscale;
 69     State  *state = gstat_get();
 70 
 71     if (state == NULL)
 72         return;
 73 
 74     (void) tv_set_zoomlevel(tv, ZOOM3);
 75     state_hull(state, &centre, &radius);
 76     pscale = 3.0;
 77     aim = vec3_ez();
 78     down = vec3_ey();
 79     tv_camera3(tv, centre, radius, pscale, aim, down);
 80     tv_repaint(tv);
 81 }
 82 
 83 Tv     *gstat_tv_make(void)
 84 {
 85     Tv     *tv;
 86 
 87     tv = tv_create("geomstat");
 88     (void) tv_set_fulldraw(tv, gstat_fulldraw);
 89     (void) tv_set_skeldraw(tv, gstat_skeldraw);
 90     tv_set_init(tv, gstat_init);
 91     return (tv);
 92 }
 93 

~ [ 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.