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

Linux Cross Reference
Tina4/src/draw/paint/tv_geom.c

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

  1 /**@(#)
  2 **/
  3 #include <tina/sys.h>
  4 #include <tina/math.h>
  5 #include <tina/vision.h>
  6 #include <tina/tv.h>
  7 #include <tina/tvfuncs.h>
  8 #include <tina/graphic.h>
  9 #include <tina/draw.h>
 10 #include <tina/drawfuncs.h>
 11 
 12 void    geom_draw(Tv * tv, void *geom, int type)
 13 {
 14     switch (type)
 15     {
 16         case POINT2:
 17         point2_draw(tv, (Point2 *) geom);
 18         break;
 19     case LINE2:
 20         line2_draw(tv, (Line2 *) geom);
 21         break;
 22     case CONIC2:
 23         conic2_draw(tv, (Conic *) geom);
 24         break;
 25     case POINT3:
 26         point3_draw(tv, (Point3 *) geom);
 27         break;
 28     case LINE3:
 29         line3_draw(tv, (Line3 *) geom);
 30         break;
 31     case CONIC3:
 32         conic3_draw(tv, (Conic3 *) geom);
 33         break;
 34     case PLANE:
 35         plane_draw(tv, (Plane *) geom);
 36         break;
 37     }
 38 }
 39 
 40 void    geom_col_draw(Tv * tv, void *geom, int type)
 41 {
 42     void *prop_get();
 43     Graphic *gr;
 44     tv_save_draw(tv);
 45     switch (type)
 46     {
 47     case POINT2:
 48         if ((gr = (Graphic *)prop_get(((Point2 *)geom)->props,GRAPHIC) )!=NULL)
 49            tv_set_color(tv,gr->colour);
 50         else
 51            tv_set_color(tv, blue);
 52         point2_draw(tv, (Point2 *) geom);
 53         break;
 54     case LINE2:
 55         if ((gr = (Graphic *)prop_get(((Line2 *)geom)->props,GRAPHIC) )!=NULL)
 56            tv_set_color(tv,gr->colour);
 57         else
 58            tv_set_color(tv, baby_blue);
 59         line2_draw(tv, (Line2 *) geom);
 60         break;
 61     case CONIC2:
 62         if ((gr = (Graphic *)prop_get(((Conic *)geom)->props,GRAPHIC) )!=NULL)
 63            tv_set_color(tv,gr->colour);
 64         else
 65            tv_set_color(tv, cyan);
 66         conic2_draw_col(tv, (Conic *) geom);
 67         break;
 68     case POINT3:
 69         if ((gr = (Graphic *)prop_get(((Point3 *)geom)->props,GRAPHIC) )!=NULL)
 70            tv_set_color(tv,gr->colour);
 71         else
 72            tv_set_color(tv, blue);
 73         point3_draw(tv, (Point3 *) geom);
 74         break;
 75     case LINE3:
 76         if ((gr = (Graphic *)prop_get(((Line3 *)geom)->props,GRAPHIC) )!=NULL)
 77            tv_set_color(tv,gr->colour);
 78         else
 79            tv_set_color(tv, baby_blue);
 80         line3_draw(tv, (Line3 *) geom);
 81         break;
 82     case CONIC3:
 83         if ((gr = (Graphic *)prop_get(((Conic3 *)geom)->conic->props,GRAPHIC) )!=NULL)
 84            tv_set_color(tv,gr->colour);
 85         else
 86            tv_set_color(tv, cyan);
 87         conic3_draw_col(tv, (Conic3 *) geom);
 88         break;
 89     case PLANE:
 90         if ((gr = (Graphic *)prop_get(((Plane *)geom)->props,GRAPHIC) )!=NULL)
 91            tv_set_color(tv,gr->colour);
 92         else
 93            tv_set_color(tv, magenta);
 94         plane_draw(tv, (Plane *) geom);
 95         break;
 96     }
 97     tv_reset_draw(tv);
 98 }
 99 
100 void    geom_draw_directed(Tv * tv, void *geom, int type, int direction)
101 {
102     switch (type)
103     {
104         case POINT2:
105         point2_draw(tv, (Point2 *) geom);
106         break;
107     case LINE2:
108         line2_draw(tv, (Line2 *) geom);
109         break;
110     case CONIC2:
111         conic2_draw(tv, (Conic *) geom);
112         break;
113     case POINT3:
114         point3_draw(tv, (Point3 *) geom);
115         break;
116     case LINE3:
117         line3_draw_directed(tv, (Line3 *) geom, direction);
118         break;
119     case CONIC3:
120         conic3_draw(tv, (Conic3 *) geom);
121         break;
122     case PLANE:
123         plane_draw(tv, (Plane *) geom);
124         break;
125     }
126 }
127 

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