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

Linux Cross Reference
Tina4/src/vision/geom/geom_label.c

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

  1 /**@(#)
  2 **/
  3 #include <tina/sys.h>
  4 #include <tina/sysfuncs.h>
  5 #include <tina/math.h>
  6 #include <tina/mathfuncs.h>
  7 #include <tina/vision.h>
  8 #include <tina/visionfuncs.h>
  9 
 10 int     geom_label_get(void *p, int type)
 11 {
 12     switch (type)
 13     {
 14         case SCALAR:
 15         return (((Scalar *) p)->label);
 16     case POINT2:
 17         return (((Point2 *) p)->label);
 18     case LINE2:
 19         return (((Line2 *) p)->label);
 20     case CONIC2:
 21         return (((Conic *) p)->label);
 22     case POINT3:
 23         return (((Point3 *) p)->label);
 24     case LINE3:
 25         return (((Line3 *) p)->label);
 26     case CONIC3:
 27         {
 28             Conic3 *con3 = p;
 29 
 30             if (con3->conic == NULL)
 31                 return (0);
 32             return (con3->conic->label);
 33         }
 34     case PLANE:
 35         return (((Plane *) p)->label);
 36     case TRANSF3:
 37         return (((Transf3 *) p)->label);
 38     }
 39     return (0);
 40 }
 41 
 42 static void geom_set_by_label(void *geom, int type, Pair * label_store)
 43 {
 44     if (label_store->to2 != NULL)
 45         return;
 46 
 47     if ((int) (label_store->to1) == geom_label_get(geom, type))
 48     {
 49         label_store->to2 = geom;
 50         label_store->type2 = type;
 51     }
 52 }
 53 
 54 void   *geom_getbylabel(List * geom, int label, int *type)
 55 {
 56     Pair    label_store = {Pair_id};
 57 
 58     label_store.to1 = (void *) label;
 59 /* removed as unused for compatability with Windows 95
 60     label_store.type1 = INT;
 61 */
 62     label_store.to2 = NULL;
 63     label_store.type2 = 0;
 64 
 65     reclist_list_apply(geom, geom_set_by_label, (int) NULL, (void *) &label_store);
 66     *type = label_store.type2;
 67     return (label_store.to2);
 68 }
 69 

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