KiCad PCB EDA Suite
Loading...
Searching...
No Matches
fab_drill_model.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
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU 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 FAB_DRILL_MODEL_H
21#define FAB_DRILL_MODEL_H
22
23#include <map>
24#include <tuple>
25#include <unordered_map>
26#include <utility>
27#include <vector>
28
30
31class BOARD;
32class BOARD_ITEM;
33
34
36{
38 std::vector<DRILL_OPERATION> m_Holes;
39 std::vector<DRILL_OPERATION> m_Slots;
40};
41
42
45{
46 bool m_platedSlots = false;
47 bool m_counterbore = false;
48 bool m_countersink = false;
49 bool m_pressfit = false;
50};
51
52
54{
55public:
56 explicit FAB_DRILL_MODEL( const BOARD& aBoard );
57 FAB_DRILL_MODEL( const FAB_DRILL_MODEL& ) = delete;
59
60 const std::vector<FAB_DRILL_LAYER>& Layers() const { return m_layers; }
61 const FAB_DRILL_FACTS& Facts() const { return m_facts; }
62
63 const DRILL_OPERATION* Find( const DRILL_SPAN& aSpan, const BOARD_ITEM* aItem,
64 bool aIgnorePlating = false ) const;
65
66private:
68 using INDEX_KEY = std::tuple<DRILL_LAYER_PAIR, bool, PCB_LAYER_ID>;
69
70 static INDEX_KEY indexKey( const DRILL_SPAN& aSpan );
71
72 std::vector<FAB_DRILL_LAYER> m_layers;
74 std::map<INDEX_KEY, std::unordered_map<const BOARD_ITEM*, const DRILL_OPERATION*>> m_index;
75};
76
77#endif // FAB_DRILL_MODEL_H
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:410
std::map< INDEX_KEY, std::unordered_map< const BOARD_ITEM *, const DRILL_OPERATION * > > m_index
static INDEX_KEY indexKey(const DRILL_SPAN &aSpan)
FAB_DRILL_MODEL(const FAB_DRILL_MODEL &)=delete
FAB_DRILL_MODEL & operator=(const FAB_DRILL_MODEL &)=delete
const FAB_DRILL_FACTS & Facts() const
std::vector< FAB_DRILL_LAYER > m_layers
FAB_DRILL_MODEL(const BOARD &aBoard)
const DRILL_OPERATION * Find(const DRILL_SPAN &aSpan, const BOARD_ITEM *aItem, bool aIgnorePlating=false) const
FAB_DRILL_FACTS m_facts
std::tuple< DRILL_LAYER_PAIR, bool, PCB_LAYER_ID > INDEX_KEY
Backdrills keep their start layer so a reverse backdrill on the same item stays separate.
const std::vector< FAB_DRILL_LAYER > & Layers() const
One machining action, which is also one NC hit and one tool assignment.
Board-wide hole facts that a fabrication product states outright.
std::vector< DRILL_OPERATION > m_Slots
std::vector< DRILL_OPERATION > m_Holes