/* SccsId = "@(#)define.h 4.3 (TU-Delft) 11/24/92" */
/**********************************************************

Name/Version      : space/4.3

Language          : C
Operating system  : UNIX SYSTEM V
Host machine      : HP9000

Author(s)         : A.J. van Genderen
		  : N.P. van der Meijs
Creation date     : 15-Mar-1988
Modified by       :
Modification date :


        Delft University of Technology
        Department of Electrical Engineering
        Network Theory Section
        Mekelweg 4 - P.O.Box 5031
        2600 GA DELFT
        The Netherlands

        Phone : 015 - 786234

        COPYRIGHT (C) 1988. All rights reserved.
**********************************************************/
/* The next defines should match those in tecc/type.h
 */
#define RESELEM      1
#define TORELEM      2
#define CONTELEM     3
#define SURFCAPELEM  4
#define EDGECAPELEM  5
#define LATCAPELEM   6
#define VDIMELEM     7
#define ESHAPEELEM   8
#define CSHAPEELEM   9
/* #define MESHELEM  7  !!! */

#define SURFACE    1
#define EDGE       2
#define OTHEREDGE  3

#ifdef FAST
#define RecogS(sc) (layCTab || optPrintRecog \
    ? recognizeElements (sc, -1, -1) \
    : keyTab[sc & sBitmask])

#define RecogE(sc, ec) (layCTab || optPrintRecog \
    ? recognizeElements (sc, ec, -1) \
    : keyTab[(sc & sBitmask) + ((ec * (sBitmask + 1)) & eBitmask)])
#else
#define RecogS(sc)     recognizeElements (sc, -1, -1)
#define RecogE(sc, ec) recognizeElements (sc, ec, -1)
#endif

#define Conductor(tile, c) (optRes == FALSE \
    ? tile -> cons[c] != NULL \
    : tile -> rbPoints != NULL && tile -> rbPoints -> cons[c] != NULL)

#define  HasConduc(tile)  (tile -> color & filterBitmask)
#define  HasCore(tile)    (tile -> color & coreBitmask)
#define  CanHaveTor(tile) (tile -> color & torBitmask == torBitmask)
#define  CanHaveEdgeCap(t1, t2) (HasConduc(t1) != HasConduc(t2))
