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

Linux Cross Reference
Tina4/src/tsgen/draw.c

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

  1 #include <stdio.h>
  2 #include <tina/all_tina.h>
  3 
  4 void ts_draw(Tv *tv,void *data)
  5 {
  6   Ts_id* id=(Ts_id*)data;
  7   List *l;
  8   Ddlist *dl;
  9   
 10   if(data)
 11     switch(*id)
 12     {
 13     case List_id:
 14       for(l=(List*)data;l;l=l->next)
 15         ts_draw(tv,l->to);
 16       break;
 17     case Ddlist_id:
 18       for(dl=(Ddlist*)data;dl;dl=dl->next)
 19         ts_draw(tv,dl->to);
 20       break;
 21     case Vec2_id:
 22       tv_dot2(tv,*(Vec2*)data);
 23       break;
 24     case Line2_id:
 25       line2_draw(tv,(Line2*)data);
 26       break;
 27     case Point2_id:
 28       point2_draw(tv,(Point2*)data);
 29       break;
 30     case Conic_id:
 31       conic2_draw(tv,(Conic*)data);
 32       break;
 33     case Point3_id:
 34       point3_draw(tv, (Point3 *)data);
 35       break;
 36     case Line3_id:
 37       line3_draw(tv, (Line3 *)data);
 38       break;
 39     case Conic3_id:
 40       conic3_draw(tv, (Conic3 *)data);
 41       break;
 42     case Plane_id:
 43       plane_draw(tv, (Plane *)data);
 44       break;
 45     case Imrect_id:
 46     {
 47       Imrect *im=data;
 48       if(im->vtype!=ptr_v)
 49         {
 50           tv_imrect2(tv,im);
 51         }
 52       else
 53         {
 54           Imregion *roi=im->region;
 55           int r,c;
 56           for(r=roi->ly; r<roi->uy; r++)
 57             for(c=roi->lx; c<roi->ux; c++)
 58               ts_draw(tv,IM_PTR(im,r,c));
 59         }
 60     }
 61       break;
 62     case Tina_color_id:
 63       tv_set_color(tv,((Tina_color*)data)->pixel);
 64       break;
 65     case Edgel_id:
 66     {
 67       Edgel  *eptr = data;
 68       float x=eptr->pos.el[0];
 69       float y=eptr->pos.el[1];
 70 
 71       switch (eptr->type & EDGE_GET_CONN_MASK)
 72       {
 73       case EDGE_NOLINK:
 74         tv_set_color(tv, salmon);
 75         break;
 76       case EDGE_TERMIN:
 77         tv_set_color(tv, blue);
 78         break;
 79       case EDGE_CONN:
 80         tv_set_color(tv, magenta);
 81         break;
 82       case EDGE_JUNC:
 83         tv_set_color(tv, orange);
 84         break;
 85       case EDGE_ISOLATED:/* corner feature */
 86         tv_set_color(tv, yellow);
 87         break;
 88       }
 89       tv_pixel2(tv, vec2((float) x, (float) y));
 90     }
 91     }
 92 }
 93 
 94 

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