KiCad PCB EDA Suite
pns_arc.cpp
Go to the documentation of this file.
1 /*
2  * KiRouter - a push-and-(sometimes-)shove PCB router
3  *
4  * Copyright (C) 2019 CERN
5  * Author: Seth Hillbrand <hillbrand@ucdavis.edu>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include "pns_arc.h"
22 #include "pns_node.h"
23 #include "pns_router.h"
24 #include "pns_utils.h"
25 #include "pns_via.h"
26 
27 #include <geometry/shape_rect.h>
28 
29 namespace PNS {
30 
31 
32 const SHAPE_LINE_CHAIN ARC::Hull( int aClearance, int aWalkaroundThickness ) const
33 {
34  return ArcHull( m_arc, aClearance, aWalkaroundThickness );
35 }
36 
37 
38 ARC* ARC::Clone() const
39 {
40  ARC* a = new ARC( m_arc, m_net );
41 
42  return a;
43 }
44 
45 
46 OPT_BOX2I ARC::ChangedArea( const ARC* aOther ) const
47 {
48  BOX2I tmp = Shape()->BBox();
49  tmp.Merge( aOther->Shape()->BBox() );
50  return tmp;
51 }
52 
53 }
ARC()
Definition: pns_arc.h:40
virtual const BOX2I BBox(int aClearance=0) const =0
Function BBox()
SHAPE_ARC m_arc
Definition: pns_arc.h:113
OPT_BOX2I ChangedArea(const ARC *aOther) const
Definition: pns_arc.cpp:46
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
Definition: box2.h:385
int m_net
Definition: pns_item.h:256
const SHAPE * Shape() const override
Function Shape()
Definition: pns_arc.h:75
const SHAPE_LINE_CHAIN Hull(int aClearance, int aWalkaroundThickness) const override
Definition: pns_arc.cpp:32
const SHAPE_LINE_CHAIN ArcHull(const SHAPE_ARC &aSeg, int aClearance, int aWalkaroundThickness)
Various utility functions.
Definition: pns_utils.cpp:55
SHAPE_LINE_CHAIN.
ARC * Clone() const override
Function Clone()
Definition: pns_arc.cpp:38
OPT< BOX2I > OPT_BOX2I
Definition: box2.h:524
Push and Shove diff pair dimensions (gap) settings dialog.