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

Linux Cross Reference
Tina6/tina-tools/tinatool/draw/drawPaint_geom.c

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

  1 /**********
  2  *
  3  * Copyright (c) 2003, Division of Imaging Science and Biomedical Engineering,
  4  * University of Manchester, UK.  All rights reserved.
  5  * 
  6  * Redistribution and use in source and binary forms, with or without modification, 
  7  * are permitted provided that the following conditions are met:
  8  * 
  9  *   . Redistributions of source code must retain the above copyright notice, 
 10  *     this list of conditions and the following disclaimer.
 11  *    
 12  *   . Redistributions in binary form must reproduce the above copyright notice,
 13  *     this list of conditions and the following disclaimer in the documentation 
 14  *     and/or other materials provided with the distribution.
 15  * 
 16  *   . Neither the name of the University of Manchester nor the names of its
 17  *     contributors may be used to endorse or promote products derived from this 
 18  *     software without specific prior written permission.
 19  * 
 20  * 
 21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 31  * POSSIBILITY OF SUCH DAMAGE.
 32  *
 33  **********
 34  *
 35  * Program :    TINA
 36  * File    :  $Source: /home/tina/cvs/tina-tools/tinatool/draw/drawPaint_geom.c,v $
 37  * Date    :  $Date: 2003/10/01 16:02:47 $
 38  * Version :  $Revision: 1.2 $
 39  * CVS Id  :  $Id: drawPaint_geom.c,v 1.2 2003/10/01 16:02:47 tony Exp $
 40  *
 41  * Author  : Legacy TINA
 42  *
 43  * Notes :
 44  *
 45  *********
 46 */
 47 
 48 #include "drawPaint_geom.h"
 49 
 50 #if HAVE_CONFIG_H
 51   #include <config.h>
 52 #endif
 53 
 54 #include <tina/sys/sysDef.h>
 55 #include <tina/math/mathDef.h>
 56 #include <tina/geometry/geomDef.h>
 57 #include <tinatool/draw/draw_TvDef.h>
 58 #include <tinatool/draw/draw_TvPro.h>
 59 #include <tinatool/draw/draw_PaintDef.h>
 60 #include <tinatool/draw/draw_PaintPro.h>
 61 
 62 void    geom_draw(Tv * tv, void *geom, int type)
 63 {
 64     switch (type)
 65     {
 66         case POINT2:
 67         point2_draw(tv, (Point2 *) geom);
 68         break;
 69     case LINE2:
 70         line2_draw(tv, (Line2 *) geom);
 71         break;
 72     case CONIC2:
 73         conic2_draw(tv, (Conic *) geom);
 74         break;
 75     case POINT3:
 76         point3_draw(tv, (Point3 *) geom);
 77         break;
 78     case LINE3:
 79         line3_draw(tv, (Line3 *) geom);
 80         break;
 81     case CONIC3:
 82         conic3_draw(tv, (Conic3 *) geom);
 83         break;
 84     case PLANE:
 85         plane_draw(tv, (Plane *) geom);
 86         break;
 87     }
 88 }
 89 
 90 void    geom_col_draw(Tv * tv, void *geom, int type)
 91 {
 92     void *prop_get();
 93     Graphic *gr;
 94     tv_save_draw(tv);
 95     switch (type)
 96     {
 97     case POINT2:
 98         if ((gr = (Graphic *)prop_get(((Point2 *)geom)->props,GRAPHIC) )!=NULL)
 99            tv_set_color(tv,gr->colour);
100         else
101            tv_set_color(tv, blue);
102         point2_draw(tv, (Point2 *) geom);
103         break;
104     case LINE2:
105         if ((gr = (Graphic *)prop_get(((Line2 *)geom)->props,GRAPHIC) )!=NULL)
106            tv_set_color(tv,gr->colour);
107         else
108            tv_set_color(tv, baby_blue);
109         line2_draw(tv, (Line2 *) geom);
110         break;
111     case CONIC2:
112         if ((gr = (Graphic *)prop_get(((Conic *)geom)->props,GRAPHIC) )!=NULL)
113            tv_set_color(tv,gr->colour);
114         else
115            tv_set_color(tv, cyan);
116         conic2_draw_col(tv, (Conic *) geom);
117         break;
118     case POINT3:
119         if ((gr = (Graphic *)prop_get(((Point3 *)geom)->props,GRAPHIC) )!=NULL)
120            tv_set_color(tv,gr->colour);
121         else
122            tv_set_color(tv, blue);
123         point3_draw(tv, (Point3 *) geom);
124         break;
125     case LINE3:
126         if ((gr = (Graphic *)prop_get(((Line3 *)geom)->props,GRAPHIC) )!=NULL)
127            tv_set_color(tv,gr->colour);
128         else
129            tv_set_color(tv, baby_blue);
130         line3_draw(tv, (Line3 *) geom);
131         break;
132     case CONIC3:
133         if ((gr = (Graphic *)prop_get(((Conic3 *)geom)->conic->props,GRAPHIC) )!=NULL)
134            tv_set_color(tv,gr->colour);
135         else
136            tv_set_color(tv, cyan);
137         conic3_draw_col(tv, (Conic3 *) geom);
138         break;
139     case PLANE:
140         if ((gr = (Graphic *)prop_get(((Plane *)geom)->props,GRAPHIC) )!=NULL)
141            tv_set_color(tv,gr->colour);
142         else
143            tv_set_color(tv, magenta);
144         plane_draw(tv, (Plane *) geom);
145         break;
146     }
147     tv_reset_draw(tv);
148 }
149 
150 void    geom_draw_directed(Tv * tv, void *geom, int type, int direction)
151 {
152     switch (type)
153     {
154         case POINT2:
155         point2_draw(tv, (Point2 *) geom);
156         break;
157     case LINE2:
158         line2_draw(tv, (Line2 *) geom);
159         break;
160     case CONIC2:
161         conic2_draw(tv, (Conic *) geom);
162         break;
163     case POINT3:
164         point3_draw(tv, (Point3 *) geom);
165         break;
166     case LINE3:
167         line3_draw_directed(tv, (Line3 *) geom, direction);
168         break;
169     case CONIC3:
170         conic3_draw(tv, (Conic3 *) geom);
171         break;
172     case PLANE:
173         plane_draw(tv, (Plane *) geom);
174         break;
175     }
176 }
177 

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