KiCad PCB EDA Suite
pns_sizes_settings.cpp
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2014 CERN
5 * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6 * Author: Tomasz Wlostowski <[email protected]>
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#include <board.h>
23
24#include "pns_item.h"
25#include "pns_sizes_settings.h"
26
27namespace PNS {
28
29
31{
32 m_layerPairs.clear();
33}
34
35
36void SIZES_SETTINGS::AddLayerPair( int aL1, int aL2 )
37{
38 int top = std::min( aL1, aL2 );
39 int bottom = std::max( aL1, aL2 );
40
41 m_layerPairs[bottom] = top;
42 m_layerPairs[top] = bottom;
43}
44
45
47{
48 if( m_layerPairs.empty() )
49 return F_Cu;
50 else
51 return m_layerPairs.begin()->first;
52}
53
54
56{
57 if( m_layerPairs.empty() )
58 return B_Cu;
59 else
60 return m_layerPairs.begin()->second;
61}
62
63}
std::map< int, int > m_layerPairs
void AddLayerPair(int aL1, int aL2)
@ B_Cu
Definition: layer_ids.h:95
@ F_Cu
Definition: layer_ids.h:64
Push and Shove diff pair dimensions (gap) settings dialog.