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_utils.h"
24 
25 namespace PNS {
26 
27 
28 const SHAPE_LINE_CHAIN ARC::Hull( int aClearance, int aWalkaroundThickness, int aLayer ) const
29 {
30  return ArcHull( m_arc, aClearance, aWalkaroundThickness );
31 }
32 
33 
34 ARC* ARC::Clone() const
35 {
36  ARC* a = new ARC( m_arc, m_net );
37 
38  a->m_layers = m_layers;
39  a->m_marker = m_marker;
40  a->m_rank = m_rank;
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:39
const SHAPE_LINE_CHAIN Hull(int aClearance, int aWalkaroundThickness, int aLayer) const override
Definition: pns_arc.cpp:28
LAYER_RANGE m_layers
Definition: pns_item.h:239
int m_rank
Definition: pns_item.h:244
virtual const BOX2I BBox(int aClearance=0) const =0
Compute a bounding box of the shape, with a margin of aClearance a collision.
SHAPE_ARC m_arc
Definition: pns_arc.h:115
int m_marker
Definition: pns_item.h:243
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:386
int m_net
Definition: pns_item.h:242
const SHAPE * Shape() const override
Return the geometrical shape of the item.
Definition: pns_arc.h:77
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
Return a deep copy of the item.
Definition: pns_arc.cpp:34
OPT< BOX2I > OPT_BOX2I
Definition: box2.h:525
Push and Shove diff pair dimensions (gap) settings dialog.