KiCad PCB EDA Suite
zone_filler_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) 2014 CERN
5  * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * @author Maciej Suminski <maciej.suminski@cern.ch>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
27 #ifndef ZONE_FILLER_TOOL_H
28 #define ZONE_FILLER_TOOL_H
29 
30 #include <tools/pcb_tool_base.h>
31 
32 
33 class PCB_EDIT_FRAME;
34 class PROGRESS_REPORTER;
36 
37 
42 {
43 public:
46 
48  void Reset( RESET_REASON aReason ) override;
49 
50  void CheckAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aReporter = nullptr );
51  void FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aReporter = nullptr );
52 
53  int ZoneFill( const TOOL_EVENT& aEvent );
54  int ZoneFillAll( const TOOL_EVENT& aEvent );
55  int ZoneUnfill( const TOOL_EVENT& aEvent );
56  int ZoneUnfillAll( const TOOL_EVENT& aEvent );
57 
58  bool IsBusy() { return m_fillInProgress; }
59 
60 private:
62  void singleShotRefocus( wxIdleEvent& );
63 
65  void setTransitions() override;
66 
67 private:
69 };
70 
71 #endif
int ZoneUnfill(const TOOL_EVENT &aEvent)
A progress reporter for use in multi-threaded environments.
int ZoneUnfillAll(const TOOL_EVENT &aEvent)
void singleShotRefocus(wxIdleEvent &)
< Refocus on an idle event (used after the Progress Reporter messes up the focus).
void FillAllZones(wxWindow *aCaller, PROGRESS_REPORTER *aReporter=nullptr)
Handle actions specific to filling copper zones.
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
void CheckAllZones(wxWindow *aCaller, PROGRESS_REPORTER *aReporter=nullptr)
int ZoneFill(const TOOL_EVENT &aEvent)
Generic, UI-independent tool event.
Definition: tool_event.h:152
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
The main frame for Pcbnew.
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:77
int ZoneFillAll(const TOOL_EVENT &aEvent)