Introduce POLYGONHOLE_MODE for creating holes in polygons
[geda-pcb/gde.git] / src / polygon.h
blobe29f67fd36ab95f6a00e67ec043d41efa2e6c7ff
1 /*
2 * COPYRIGHT
4 * PCB, interactive printed circuit board design
5 * Copyright (C) 1994,1995,1996 Thomas Nau
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Contact addresses for paper mail and Email:
22 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
23 * Thomas.Nau@rz.uni-ulm.de
25 * RCS: $Id$
28 /* prototypes for polygon editing routines
31 #ifndef __POLYGON_INCLUDED__
32 #define __POLYGON_INCLUDED__
34 #include "global.h"
36 Cardinal polygon_point_idx (PolygonTypePtr polygon, PointTypePtr point);
37 Cardinal polygon_point_contour (PolygonTypePtr polygon, Cardinal point);
38 Cardinal prev_contour_point (PolygonTypePtr polygon, Cardinal point);
39 Cardinal next_contour_point (PolygonTypePtr polygon, Cardinal point);
40 Cardinal GetLowestDistancePolygonPoint (PolygonTypePtr,
41 LocationType, LocationType);
42 bool RemoveExcessPolygonPoints (LayerTypePtr, PolygonTypePtr);
43 void GoToPreviousPoint (void);
44 void ClosePolygon (void);
45 void CopyAttachedPolygonToLayer (void);
46 int PolygonHoles (PolygonType *ptr, const BoxType *range,
47 int (*callback) (PLINE *, void *user_data),
48 void *user_data);
49 int PlowsPolygon (DataType *, int, void *, void *,
50 int (*callback) (DataTypePtr, LayerTypePtr, PolygonTypePtr, int, void *, void *));
51 void ComputeNoHoles (PolygonType *poly);
52 POLYAREA * ContourToPoly (PLINE *);
53 POLYAREA * PolygonToPoly (PolygonType *);
54 POLYAREA * RectPoly (LocationType x1, LocationType x2, LocationType y1, LocationType y2);
55 POLYAREA * CirclePoly(LocationType x, LocationType y, BDimension radius);
56 POLYAREA * OctagonPoly(LocationType x, LocationType y, BDimension radius);
57 POLYAREA * LinePoly(LineType *l, BDimension thick);
58 POLYAREA * ArcPoly(ArcType *l, BDimension thick);
59 POLYAREA * PinPoly(PinType *l, BDimension thick, BDimension clear);
60 POLYAREA * BoxPolyBloated (BoxType *box, BDimension radius);
61 void frac_circle (PLINE *, LocationType, LocationType, Vector, int);
62 int InitClip(DataType *d, LayerType *l, PolygonType *p);
63 void RestoreToPolygon(DataType *, int, void *, void *);
64 void ClearFromPolygon(DataType *, int, void *, void *);
66 bool IsPointInPolygon (LocationType, LocationType, BDimension, PolygonTypePtr);
67 bool IsPointInPolygonIgnoreHoles (LocationType, LocationType, PolygonTypePtr);
68 bool IsRectangleInPolygon (LocationType, LocationType, LocationType,
69 LocationType, PolygonTypePtr);
70 bool isects (POLYAREA *, PolygonTypePtr, bool);
71 bool MorphPolygon (LayerTypePtr, PolygonTypePtr);
72 void NoHolesPolygonDicer (PolygonType *p, const BoxType *clip,
73 void (*emit) (PLINE *, void *), void *user_data);
74 void PolyToPolygonsOnLayer (DataType *, LayerType *, POLYAREA *, FlagType);
75 #endif