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
28 /* prototypes for polygon editing routines
31 #ifndef __POLYGON_INCLUDED__
32 #define __POLYGON_INCLUDED__
36 Cardinal
GetLowestDistancePolygonPoint (PolygonTypePtr
,
37 LocationType
, LocationType
);
38 Boolean
RemoveExcessPolygonPoints (LayerTypePtr
, PolygonTypePtr
);
39 void GoToPreviousPoint (void);
40 void ClosePolygon (void);
41 void CopyAttachedPolygonToLayer (void);
42 int PolygonHoles (PolygonType
*ptr
, const BoxType
*range
,
43 int (*callback
) (PLINE
*, void *user_data
),
45 int PlowsPolygon (DataType
*, int, void *, void *,
46 int (*callback
) (DataTypePtr
, LayerTypePtr
, PolygonTypePtr
, int, void *, void *));
47 void ComputeNoHoles (PolygonType
*poly
);
48 POLYAREA
* ContourToPoly (PLINE
*);
49 POLYAREA
* RectPoly (LocationType x1
, LocationType x2
, LocationType y1
, LocationType y2
);
50 POLYAREA
* CirclePoly(LocationType x
, LocationType y
, BDimension radius
);
51 POLYAREA
* OctagonPoly(LocationType x
, LocationType y
, BDimension radius
);
52 POLYAREA
* LinePoly(LineType
*l
, BDimension thick
);
53 POLYAREA
* ArcPoly(ArcType
*l
, BDimension thick
);
54 POLYAREA
* PinPoly(PinType
*l
, BDimension thick
, BDimension clear
);
55 POLYAREA
* BoxPolyBloated (BoxType
*box
, BDimension radius
);
56 void frac_circle (PLINE
*, LocationType
, LocationType
, Vector
, int);
57 int InitClip(DataType
*d
, LayerType
*l
, PolygonType
*p
);
58 void RestoreToPolygon(DataType
*, int, void *, void *);
59 void ClearFromPolygon(DataType
*, int, void *, void *);
61 Boolean
IsPointInPolygon (LocationType
, LocationType
, BDimension
, PolygonTypePtr
);
62 Boolean
IsPointInPolygonIgnoreHoles (LocationType
, LocationType
, PolygonTypePtr
);
63 Boolean
IsRectangleInPolygon (LocationType
, LocationType
, LocationType
,
64 LocationType
, PolygonTypePtr
);
65 Boolean
isects (POLYAREA
*, PolygonTypePtr
, Boolean
);
66 Boolean
MorphPolygon (LayerTypePtr
, PolygonTypePtr
);
67 void NoHolesPolygonDicer (PolygonType
*p
, const BoxType
*clip
,
68 void (*emit
) (PLINE
*, void *), void *user_data
);