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 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.h>
29 
30 class CONTEXT_MENU;
31 
37 class PAD_TOOL : public PCB_TOOL
38 {
39 public:
40  PAD_TOOL();
41  ~PAD_TOOL();
42 
44  void Reset( RESET_REASON aReason ) override;
45 
47  bool Init() override;
48 
50  void SetTransitions() override;
51 
52 private:
54  bool haveFootprints();
55 
57  int applyPadSettings( const TOOL_EVENT& aEvent );
58 
60  int copyPadSettings( const TOOL_EVENT& aEvent );
61 
63  int pushPadSettings( const TOOL_EVENT& aEvent );
64 
67 };
68 
69 #endif // __PAD_TOOL_H
void SetTransitions() override
Bind handlers to corresponding TOOL_ACTIONs
Definition: pad_tool.cpp:387
Class CONTEXT_MENU.
Definition: context_menu.h:44
Class PAD_TOOL.
Definition: pad_tool.h:37
bool m_padCopied
Flag to indicate there are valid settings stored in the Master Pad object
Definition: pad_tool.h:66
void Reset(RESET_REASON aReason) override
React to model/view changes
Definition: pad_tool.cpp:157
int pushPadSettings(const TOOL_EVENT &aEvent)
Push pad settings from a pad to other pads on board or module
Definition: pad_tool.cpp:314
Class TOOL_EVENT.
Definition: tool_event.h:162
Class PCB_TOOL.
Definition: pcb_tool.h:45
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:80
bool haveFootprints()
Determine if there are any footprints on the board
Definition: pad_tool.cpp:163
bool Init() override
Basic initalization
Definition: pad_tool.cpp:170
int applyPadSettings(const TOOL_EVENT &aEvent)
Apply pad settings from board design settings to a pad
Definition: pad_tool.cpp:202
int copyPadSettings(const TOOL_EVENT &aEvent)
Copy pad settings from a pad to the board design settings
Definition: pad_tool.cpp:234