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

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

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

  1 /* voi.c
  2  *
  3  * @(#) volume of interest handling functions
  4  *
  5  */
  6 #include <tina/all_tina.h>
  7 #include <tina/brain.h>
  8 #include <tina/brainfuncs.h>
  9 
 10 static Vec3 map(Vec2 p, double *z)
 11 {
 12     return (vec3(vec2_x(p), vec2_y(p), *z));
 13 }
 14 
 15 void str2_draw3(Tv * tv, Tstring * string, double z)
 16 {
 17     draw3_str2(tv, string, map, &z);
 18 }
 19 
 20 void string_sagit_draw3(Tv * tv, Tstring * string, double z)
 21 {
 22     List *ptr;
 23     double ymin = MAXFLOAT;
 24     double ymax = -MAXFLOAT;
 25     double amin = MAXFLOAT;
 26     double amax = -MAXFLOAT;
 27     int x = ims_x_get(), flag = 0;
 28 
 29     if (string == NULL)
 30         return;
 31 
 32     for (ptr = string->start; ptr->next != NULL; ptr = ptr->next)
 33     {
 34         Vec2 p1, p2;
 35         double x1, x2, y;
 36 
 37         DD_GET_POS2(ptr, p1);
 38         DD_GET_POS2(ptr->next, p2);
 39         x1 = vec2_x(p1);
 40         x2 = vec2_y(p2);
 41         y = vec2_y(p1);
 42         amin = MIN(amin, y);
 43         amax = MAX(amax, y);
 44         if ((x1 <= x && x <= x2) || (x2 <= x && x <= x1))
 45         {
 46             flag = 1;
 47             ymin = MIN(ymin, y);
 48             ymax = MAX(ymax, y);
 49         }
 50         if (ptr == string->end)
 51             break;
 52     }
 53     if (flag)
 54         tv_line2(tv, vec2(ymin, z + 0.5), vec2(ymax, z + 0.5));
 55     tv_line2(tv, vec2(0.5 * (amin + amax), z), vec2(0.5 * (amin + amax), z + 1.0));
 56 }
 57 
 58 void string_front_draw3(Tv * tv, Tstring * string, double z)
 59 {
 60     List *ptr;
 61     double xmin = MAXFLOAT;
 62     double xmax = -MAXFLOAT;
 63     double amin = MAXFLOAT;
 64     double amax = -MAXFLOAT;
 65     int y = ims_y_get(), flag = 0;
 66 
 67     if (string == NULL)
 68         return;
 69 
 70     for (ptr = string->start; ptr->next != NULL; ptr = ptr->next)
 71     {
 72         Vec2 p1, p2;
 73         double x, y1, y2;
 74 
 75         DD_GET_POS2(ptr, p1);
 76         DD_GET_POS2(ptr->next, p2);
 77         x = vec2_x(p1);
 78         y1 = vec2_y(p1);
 79         y2 = vec2_y(p2);
 80         amin = MIN(amin, x);
 81         amax = MAX(amax, x);
 82         if ((y1 <= y && y <= y2) || (y2 <= y && y <= y1))
 83         {
 84             flag = 1;
 85             xmin = MIN(xmin, x);
 86             xmax = MAX(xmax, x);
 87         }
 88         if (ptr == string->end)
 89             break;
 90     }
 91     if (flag)
 92         tv_line2(tv, vec2(xmin, z + 0.5), vec2(xmax, z + 0.5));
 93     tv_line2(tv, vec2(0.5 * (amin + amax), z), vec2(0.5 * (amin + amax), z + 1.0));
 94 }
 95 
 96 void string_skeldraw3(Tv * tv, Tstring * string, double z, int space)
 97 {
 98     skeldraw3_str2(tv, string, map, &z, space);
 99 }
100 

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