KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pads_layer_mapper.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef PADS_LAYER_MAPPER_H
21#define PADS_LAYER_MAPPER_H
22
23#include <string>
24#include <map>
25#include <vector>
26
27#include <layer_ids.h>
28#include <lset.h>
30
31
53
54
62
63
78{
79public:
81
82 void SetCopperLayerCount( int aLayerCount );
83
85
86 PADS_LAYER_TYPE GetLayerType( int aPadsLayer ) const;
87
88 PADS_LAYER_TYPE ParseLayerName( const std::string& aLayerName ) const;
89
94 PCB_LAYER_ID GetAutoMapLayer( int aPadsLayer,
96
98
99 std::vector<INPUT_LAYER_DESC> BuildInputLayerDescriptions(
100 const std::vector<PADS_LAYER_INFO>& aLayerInfos ) const;
101
102 void AddLayerNameMapping( const std::string& aName, PADS_LAYER_TYPE aType );
103
104 static std::string LayerTypeToString( PADS_LAYER_TYPE aType );
105
106 static constexpr int LAYER_PAD_STACK_TOP = -2;
107 static constexpr int LAYER_PAD_STACK_BOTTOM = -1;
108 static constexpr int LAYER_PAD_STACK_INNER = 0;
109
110 static constexpr int LAYER_DRILL_DRAWING = 18;
111 static constexpr int LAYER_DIMENSIONS = 19;
112 static constexpr int LAYER_PLACEMENT_OUTLINE = 20;
113 static constexpr int LAYER_ASSEMBLY_TOP = 21;
114 static constexpr int LAYER_ASSEMBLY_BOTTOM = 22;
115 static constexpr int LAYER_SOLDERMASK_TOP = 25;
116 static constexpr int LAYER_SILKSCREEN_TOP = 26;
117 static constexpr int LAYER_SILKSCREEN_BOTTOM = 27;
118 static constexpr int LAYER_SOLDERMASK_BOTTOM = 28;
119 static constexpr int LAYER_PASTE_TOP = 29;
120 static constexpr int LAYER_PASTE_BOTTOM = 30;
121 static constexpr int LAYER_BOARD_OUTLINE = 1;
122
123private:
125 std::map<std::string, PADS_LAYER_TYPE> m_layerNameMap;
126
127 PCB_LAYER_ID mapInnerCopperLayer( int aPadsLayer ) const;
128 std::string normalizeLayerName( const std::string& aName ) const;
129};
130
131#endif // PADS_LAYER_MAPPER_H
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
LSET GetPermittedLayers(PADS_LAYER_TYPE aType) const
PADS_LAYER_TYPE ParseLayerName(const std::string &aLayerName) const
static constexpr int LAYER_ASSEMBLY_TOP
static constexpr int LAYER_SILKSCREEN_BOTTOM
static constexpr int LAYER_PASTE_TOP
static constexpr int LAYER_SILKSCREEN_TOP
PADS_LAYER_TYPE GetLayerType(int aPadsLayer) const
static constexpr int LAYER_PLACEMENT_OUTLINE
static constexpr int LAYER_SOLDERMASK_TOP
static constexpr int LAYER_ASSEMBLY_BOTTOM
PCB_LAYER_ID mapInnerCopperLayer(int aPadsLayer) const
static constexpr int LAYER_DIMENSIONS
PCB_LAYER_ID GetAutoMapLayer(int aPadsLayer, PADS_LAYER_TYPE aType=PADS_LAYER_TYPE::UNKNOWN) const
Suggested KiCad layer for a PADS layer.
static constexpr int LAYER_PAD_STACK_BOTTOM
std::string normalizeLayerName(const std::string &aName) const
static constexpr int LAYER_PAD_STACK_TOP
static constexpr int LAYER_PASTE_BOTTOM
static std::string LayerTypeToString(PADS_LAYER_TYPE aType)
void SetCopperLayerCount(int aLayerCount)
static constexpr int LAYER_PAD_STACK_INNER
std::map< std::string, PADS_LAYER_TYPE > m_layerNameMap
static constexpr int LAYER_BOARD_OUTLINE
int GetCopperLayerCount() const
std::vector< INPUT_LAYER_DESC > BuildInputLayerDescriptions(const std::vector< PADS_LAYER_INFO > &aLayerInfos) const
void AddLayerNameMapping(const std::string &aName, PADS_LAYER_TYPE aType)
static constexpr int LAYER_DRILL_DRAWING
static constexpr int LAYER_SOLDERMASK_BOTTOM
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
PADS_LAYER_TYPE
Functional categories of PADS layers, independent of specific layer numbers.
PADS_LAYER_TYPE type