KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 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#pragma once
21
22#include <tools/pcb_tool_base.h>
23
24class ACTION_MENU;
25class PCB_SHAPE;
26
27
28class PAD_TOOL : public PCB_TOOL_BASE
29{
30public:
31 PAD_TOOL();
32
34 void Reset( RESET_REASON aReason ) override;
35
37 bool Init() override;
38
42 int EnumeratePads( const TOOL_EVENT& aEvent );
43
44 int PadTable( const TOOL_EVENT& aEvent );
45
49 int PlacePad( const TOOL_EVENT& aEvent );
50
54 int EditPad( const TOOL_EVENT& aEvent );
55
56 int OnUndoRedo( const TOOL_EVENT& aEvent );
57
58 bool InPadEditMode() { return m_editPad != niluuid; }
59 void ExitPadEditMode();
60
61 wxString GetLastPadNumber() const { return m_lastPadNumber; }
62 void SetLastPadNumber( const wxString& aPadNumber ) { m_lastPadNumber = aPadNumber; }
63
70 std::vector<PCB_SHAPE*> RecombinePad( PAD* aPad, bool aIsDryRun );
71
72protected:
74 void setTransitions() override;
75
76private:
78 int pastePadProperties( const TOOL_EVENT& aEvent );
79
81 int copyPadSettings( const TOOL_EVENT& aEvent );
82
84 int pushPadSettings( const TOOL_EVENT& aEvent );
85
86 void explodePad( PAD* aPad, BOARD_COMMIT& aCommit );
87
88 void enterPadEditMode();
89
90private:
92
95};
HIGH_CONTRAST_MODE
Determine how inactive layers should be displayed.
Define the structure of a menu based on ACTIONs.
Definition action_menu.h:43
Definition kiid.h:46
int OnUndoRedo(const TOOL_EVENT &aEvent)
Definition pad_tool.cpp:742
HIGH_CONTRAST_MODE m_previousHighContrastMode
Definition pad_tool.h:93
void setTransitions() override
< Bind handlers to corresponding TOOL_ACTIONs.
Definition pad_tool.cpp:922
int EditPad(const TOOL_EVENT &aEvent)
Enter/exit WYSIWYG pad shape editing.
Definition pad_tool.cpp:691
void ExitPadEditMode()
Definition pad_tool.cpp:814
KIID m_editPad
Definition pad_tool.h:94
int copyPadSettings(const TOOL_EVENT &aEvent)
Push pad settings from a pad to other pads on board or footprint.
Definition pad_tool.cpp:168
void enterPadEditMode()
Definition pad_tool.cpp:778
int pastePadProperties(const TOOL_EVENT &aEvent)
< Apply pad settings from board design settings to a pad.
Definition pad_tool.cpp:141
int PlacePad(const TOOL_EVENT &aEvent)
Place a pad in footprint editor.
Definition pad_tool.cpp:577
int EnumeratePads(const TOOL_EVENT &aEvent)
Tool for quick pad enumeration.
Definition pad_tool.cpp:314
PAD_TOOL()
React to model/view changes.
Definition pad_tool.cpp:50
void explodePad(PAD *aPad, BOARD_COMMIT &aCommit)
Definition pad_tool.cpp:844
int PadTable(const TOOL_EVENT &aEvent)
Definition pad_tool.cpp:905
bool Init() override
Init() is called once upon a registration of the tool.
Definition pad_tool.cpp:79
void SetLastPadNumber(const wxString &aPadNumber)
Definition pad_tool.h:62
wxString GetLastPadNumber() const
Definition pad_tool.h:61
std::vector< PCB_SHAPE * > RecombinePad(PAD *aPad, bool aIsDryRun)
Recombine an exploded pad (or one produced with overlapping polygons in an older version).
Definition pad_tool.cpp:894
bool InPadEditMode()
Definition pad_tool.h:58
wxString m_lastPadNumber
Definition pad_tool.h:91
int pushPadSettings(const TOOL_EVENT &aEvent)
Definition pad_tool.cpp:257
Definition pad.h:61
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
RESET_REASON
Determine the reason of reset for a tool.
Definition tool_base.h:74
Generic, UI-independent tool event.
Definition tool_event.h:167
void Reset() override
KIID niluuid(0)