1 /*!
2  * \file src/find.h
3  *
4  * \brief Prototypes for connection search routines.
5  *
6  * <h1><b>Copyright.</b></h1>\n
7  *
8  * PCB, interactive printed circuit board design
9  *
10  * Copyright (C) 1994,1995,1996 Thomas Nau
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License along
23  * with this program; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * Contact addresses for paper mail and Email:
27  * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
28  * Thomas.Nau@rz.uni-ulm.de
29  */
30 
31 #ifndef	PCB_FIND_H
32 #define	PCB_FIND_H
33 
34 #include <stdio.h>		/* needed to define 'FILE *' */
35 #include "global.h"
36 
37 /* ---------------------------------------------------------------------------
38  * some local defines
39  */
40 #define LOOKUP_FIRST	\
41 	(PIN_TYPE | PAD_TYPE)
42 #define LOOKUP_MORE	\
43 	(VIA_TYPE | LINE_TYPE | RATLINE_TYPE | POLYGON_TYPE | ARC_TYPE)
44 #define SILK_TYPE	\
45 	(LINE_TYPE | ARC_TYPE | POLYGON_TYPE)
46 
47 bool LineLineIntersect (LineType *, LineType *);
48 bool LineArcIntersect (LineType *, ArcType *);
49 bool PinLineIntersect (PinType *, LineType *);
50 bool LinePadIntersect (LineType *, PadType *);
51 bool ArcPadIntersect (ArcType *, PadType *);
52 void LookupElementConnections (ElementType *, FILE *);
53 void LookupConnectionsToAllElements (FILE *);
54 void LookupConnection (Coord, Coord, bool, Coord, int, bool AndRats);
55 void LookupUnusedPins (FILE *);
56 void InitConnectionLookup (void);
57 void FreeConnectionLookupMemory (void);
58 void RatFindHook (int, void *, void *, void *, bool, int flag, bool);
59 void LookupConnectionByPin (int , void *);
60 
61 /* remove these prototypes later */
62 bool ListStart(int, void*, void*, void*, int);
63 bool DoIt(int, Coord, bool, bool, bool);
64 void DumpList(void);
65 void start_do_it_and_dump(int, void*, void*, void*, int, bool, Coord, bool);
66 
67 bool IsArcInPolygon (ArcType *, PolygonType *);
68 bool IsLineInPolygon (LineType *, PolygonType *);
69 bool IsPadInPolygon (PadType *, PolygonType *);
70 bool IsPinInPolygon (PinType *, PolygonType *);
71 bool IsPolygonInPolygon (PolygonType *, PolygonType *);
72 
73 #endif
74