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

Linux Cross Reference
Tina6/tina-libs/tina/geometry/geomGen_label.c

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

  1 /**********
  2  * 
  3  * This file is part of the TINA Open Source Image Analysis Environment
  4  * henceforth known as TINA
  5  *
  6  * TINA is free software; you can redistribute it and/or modify
  7  * it under the terms of the GNU General Public License as 
  8  * published by the Free Software Foundation.
  9  *
 10  * TINA is distributed in the hope that it will be useful,
 11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  * GNU General Public License for more details.
 14  *
 15  * You should have received a copy of the GNU General Public License
 16  * along with TINA; if not, write to the Free Software Foundation, Inc., 
 17  * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18  *
 19  * ANY users of TINA who require exemption from the existing licence must
 20  * negotiate a new licence with Dr. Neil.A.Thacker, the sole agent for
 21  * the University of Manchester.
 22  *
 23  **********
 24  * 
 25  * Program :    TINA
 26  * File    :  $Source: /home/tina/cvs/tina-libs/tina/geometry/geomGen_label.c,v $
 27  * Date    :  $Date: 2008/12/07 04:33:58 $
 28  * Version :  $Revision: 1.2 $
 29  * CVS Id  :  $Id: geomGen_label.c,v 1.2 2008/12/07 04:33:58 paul Exp $
 30  *
 31  * Notes :
 32  *
 33  *********
 34 */
 35 
 36 
 37 #include "geomGen_label.h"
 38 
 39 #if HAVE_CONFIG_H
 40   #include <config.h>
 41 #endif
 42 
 43 #include <tina/sys/sysDef.h>
 44 #include <tina/sys/sysPro.h>
 45 #include <tina/math/mathDef.h>
 46 #include <tina/math/mathPro.h>
 47 #include <tina/geometry/geomDef.h>
 48 #include <tina/geometry/geom_PointDef.h>
 49 #include <tina/geometry/geom_LineDef.h>
 50 #include <tina/geometry/geom_CurveDef.h>
 51 
 52 
 53 int     geom_label_get(void *p, int type)
 54 {
 55     switch (type)
 56     {
 57         case SCALAR:
 58         return (((Scalar *) p)->label);
 59     case POINT2:
 60         return (((Point2 *) p)->label);
 61     case LINE2:
 62         return (((Line2 *) p)->label);
 63     case CONIC2:
 64         return (((Conic *) p)->label);
 65     case POINT3:
 66         return (((Point3 *) p)->label);
 67     case LINE3:
 68         return (((Line3 *) p)->label);
 69     case CONIC3:
 70         {
 71             Conic3 *con3 = p;
 72 
 73             if (con3->conic == NULL)
 74                 return (0);
 75             return (con3->conic->label);
 76         }
 77     case PLANE:
 78         return (((Plane *) p)->label);
 79     case TRANSF3:
 80         return (((Transf3 *) p)->label);
 81     }
 82     return (0);
 83 }
 84 
 85 static void geom_set_by_label(void *geom, int type, Pair * label_store)
 86 {
 87     if (label_store->to2 != NULL)
 88         return;
 89 
 90     /*if ((int) (label_store->to1) == geom_label_get(geom, type))*/ 
 91     if ((long int) (label_store->to1) == geom_label_get(geom, type)) /*JD, 2015.01.27*/
 92     {
 93         label_store->to2 = geom;
 94         label_store->type2 = type;
 95     }
 96 }
 97 
 98 void   *geom_getbylabel(List * geom, int label, int *type)
 99 {
100     Pair    label_store = {Pair_id};
101 
102     /*label_store.to1 = (void *) label;*/
103     label_store.to1 = (void *) (long int)label; /*JD, 2015.01.27*/
104 
105 /* removed as unused for compatability with Windows 95
106     label_store.type1 = INT;
107 */
108     label_store.to2 = NULL;
109     label_store.type2 = 0;
110 
111     reclist_list_apply(geom, geom_set_by_label, 0, (void *) &label_store);
112     *type = label_store.type2;
113     return (label_store.to2);
114 }
115 

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