KiCad PCB EDA Suite
pns_utils.h
Go to the documentation of this file.
1 /*
2  * KiRouter - a push-and-(sometimes-)shove PCB router
3  *
4  * Copyright (C) 2013-2014 CERN
5  * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef __PNS_UTILS_H
23 #define __PNS_UTILS_H
24 
25 #include <math/vector2d.h>
26 #include <math/box2.h>
28 #include <geometry/shape_segment.h>
29 #include <geometry/shape_rect.h>
30 #include <geometry/shape_convex.h>
31 
32 namespace PNS {
33 
34 constexpr int HULL_MARGIN = 10;
35 
36 class ITEM;
37 class LINE;
38 
41 const SHAPE_LINE_CHAIN OctagonalHull( const VECTOR2I& aP0, const VECTOR2I& aSize,
42  int aClearance, int aChamfer );
43 
44 const SHAPE_LINE_CHAIN SegmentHull( const SHAPE_SEGMENT& aSeg, int aClearance,
45  int aWalkaroundThickness );
46 
55 const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int aClearance );
56 
58 
59 OPT_BOX2I ChangedArea( const ITEM* aItemA, const ITEM* aItemB );
60 OPT_BOX2I ChangedArea( const LINE& aLineA, const LINE& aLineB );
61 
62 #if 0
63 void DrawDebugPoint( VECTOR2I aP, int aColor );
64 void DrawDebugBox( BOX2I aB, int aColor );
65 void DrawDebugSeg( SEG aS, int aColor );
66 void DrawDebugDirs( VECTOR2D aP, int aMask, int aColor );
67 #endif
68 
69 }
70 
71 #endif // __PNS_UTILS_H
Class ITEM.
Definition: pns_item.h:53
constexpr int HULL_MARGIN
Definition: pns_utils.h:34
Class SHAPE_CONVEX.
Definition: shape_convex.h:42
OPT_BOX2I ChangedArea(const ITEM *aItemA, const ITEM *aItemB)
Definition: pns_utils.cpp:231
const SHAPE_LINE_CHAIN SegmentHull(const SHAPE_SEGMENT &aSeg, int aClearance, int aWalkaroundThickness)
Definition: pns_utils.cpp:53
const SHAPE_LINE_CHAIN ConvexHull(const SHAPE_CONVEX &convex, int aClearance)
Function ConvexHull()
Definition: pns_utils.cpp:101
const SHAPE_LINE_CHAIN OctagonalHull(const VECTOR2I &aP0, const VECTOR2I &aSize, int aClearance, int aChamfer)
Various utility functions.
Definition: pns_utils.cpp:33
Definition: seg.h:37
Class SHAPE_LINE_CHAIN.
SHAPE_RECT ApproximateSegmentAsRect(const SHAPE_SEGMENT &aSeg)
Definition: pns_utils.cpp:157
Push and Shove diff pair dimensions (gap) settings dialog.