KiCad PCB EDA Suite
pad_tool.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 (C) 2017-2021 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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef __PAD_TOOL_H
25#define __PAD_TOOL_H
26
27
28#include <tools/pcb_tool_base.h>
29
30class ACTION_MENU;
31class FP_SHAPE;
32
36class PAD_TOOL : public PCB_TOOL_BASE
37{
38public:
39 PAD_TOOL();
40 ~PAD_TOOL();
41
43 void Reset( RESET_REASON aReason ) override;
44
46 bool Init() override;
47
51 int EnumeratePads( const TOOL_EVENT& aEvent );
52
56 int PlacePad( const TOOL_EVENT& aEvent );
57
61 int EditPad( const TOOL_EVENT& aEvent );
62
63 bool InPadEditMode() { return m_editPad != niluuid; }
64
65 wxString GetLastPadNumber() const { return m_lastPadNumber; }
66 void SetLastPadNumber( const wxString& aPadNumber ) { m_lastPadNumber = aPadNumber; }
67
75 std::vector<FP_SHAPE*> RecombinePad( PAD* aPad, bool aIsDryRun, BOARD_COMMIT& aCommit );
76
77private:
79 void setTransitions() override;
80
82 int pastePadProperties( const TOOL_EVENT& aEvent );
83
85 int copyPadSettings( const TOOL_EVENT& aEvent );
86
88 int pushPadSettings( const TOOL_EVENT& aEvent );
89
91
92private:
94
97};
98
99#endif // __PAD_TOOL_H
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:49
Definition: kiid.h:48
Tool relating to pads and pad settings.
Definition: pad_tool.h:37
void Reset(RESET_REASON aReason) override
Basic initialization.
Definition: pad_tool.cpp:57
~PAD_TOOL()
React to model/view changes.
Definition: pad_tool.cpp:53
bool m_wasHighContrast
Definition: pad_tool.h:95
void setTransitions() override
< Bind handlers to corresponding TOOL_ACTIONs.
Definition: pad_tool.cpp:893
int EditPad(const TOOL_EVENT &aEvent)
Enter/exit WYSIWYG pad shape editing.
Definition: pad_tool.cpp:567
KIID m_editPad
Definition: pad_tool.h:96
int copyPadSettings(const TOOL_EVENT &aEvent)
Push pad settings from a pad to other pads on board or footprint.
Definition: pad_tool.cpp:163
int pastePadProperties(const TOOL_EVENT &aEvent)
Copy pad settings from a pad to the board design settings.
Definition: pad_tool.cpp:136
int PlacePad(const TOOL_EVENT &aEvent)
Place a pad in footprint editor.
Definition: pad_tool.cpp:487
std::vector< FP_SHAPE * > RecombinePad(PAD *aPad, bool aIsDryRun, BOARD_COMMIT &aCommit)
Recombine an exploded pad (or one produced with overlapping polygons in an older version).
Definition: pad_tool.cpp:704
int EnumeratePads(const TOOL_EVENT &aEvent)
Tool for quick pad enumeration.
Definition: pad_tool.cpp:278
PAD_TOOL()
Definition: pad_tool.cpp:46
PCB_LAYER_ID explodePad(PAD *aPad)
Definition: pad_tool.cpp:629
bool Init() override
Init() is called once upon a registration of the tool.
Definition: pad_tool.cpp:77
void SetLastPadNumber(const wxString &aPadNumber)
Definition: pad_tool.h:66
wxString GetLastPadNumber() const
Definition: pad_tool.h:65
bool InPadEditMode()
Definition: pad_tool.h:63
wxString m_lastPadNumber
Definition: pad_tool.h:93
int pushPadSettings(const TOOL_EVENT &aEvent)
Definition: pad_tool.cpp:235
Definition: pad.h:59
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
Generic, UI-independent tool event.
Definition: tool_event.h:156
KIID niluuid(0)
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59