KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[email protected]>
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
25namespace PNS {
26
27
28const SHAPE_LINE_CHAIN ARC::Hull( int aClearance, int aWalkaroundThickness, int aLayer ) const
29{
30 return ArcHull( m_arc, aClearance, aWalkaroundThickness );
31}
32
33
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
46OPT_BOX2I ARC::ChangedArea( const ARC* aOther ) const
47{
48 BOX2I tmp = Shape( -1 )->BBox();
49 tmp.Merge( aOther->Shape( -1 )->BBox() );
50 return tmp;
51}
52
53}
std::optional< BOX2I > OPT_BOX2I
Definition: box2.h:926
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:658
const SHAPE_LINE_CHAIN Hull(int aClearance, int aWalkaroundThickness, int aLayer) const override
Definition: pns_arc.cpp:28
OPT_BOX2I ChangedArea(const ARC *aOther) const
Definition: pns_arc.cpp:46
SHAPE_ARC m_arc
Definition: pns_arc.h:119
ARC()
Definition: pns_arc.h:40
const SHAPE * Shape(int aLayer) const override
Return the geometrical shape of the item.
Definition: pns_arc.h:78
ARC * Clone() const override
Return a deep copy of the item.
Definition: pns_arc.cpp:34
PNS_LAYER_RANGE m_layers
Definition: pns_item.h:306
NET_HANDLE m_net
Definition: pns_item.h:309
int m_marker
Definition: pns_item.h:310
int m_rank
Definition: pns_item.h:311
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
virtual const BOX2I BBox(int aClearance=0) const =0
Compute a bounding box of the shape, with a margin of aClearance a collision.
Push and Shove diff pair dimensions (gap) settings dialog.
const SHAPE_LINE_CHAIN ArcHull(const SHAPE_ARC &aArc, int aClearance, int aWalkaroundThickness)
Various utility functions.
Definition: pns_utils.cpp:67