KiCad PCB EDA Suite
placement_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  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef ALIGN_DISTRIBUTE_TOOL_H_
26 #define ALIGN_DISTRIBUTE_TOOL_H_
27 
28 #include <tool/tool_interactive.h>
29 
30 class SELECTION_TOOL;
31 
33 {
34 public:
36  virtual ~ALIGN_DISTRIBUTE_TOOL();
37 
39  void Reset( RESET_REASON aReason ) override {}
40 
42  bool Init() override;
43 
48  int AlignTop( const TOOL_EVENT& aEvent );
49 
54  int AlignBottom( const TOOL_EVENT& aEvent );
55 
60  int AlignLeft( const TOOL_EVENT& aEvent );
61 
66  int AlignRight( const TOOL_EVENT& aEvent );
67 
72  int DistributeHorizontally( const TOOL_EVENT& aEvent );
73 
78  int DistributeVertically( const TOOL_EVENT& aEvent );
79 
81  void setTransitions() override;
82 
83 private:
85 
87 };
88 
89 #endif /* ALIGN_DISTRIBUTE_TOOL_H_ */
int AlignLeft(const TOOL_EVENT &aEvent)
Function AlignLeft() Sets X coordinate of the selected items to the value of the left-most selected i...
Class CONTEXT_MENU.
Definition: context_menu.h:44
virtual ~ALIGN_DISTRIBUTE_TOOL()
Class SELECTION_TOOL.
int AlignBottom(const TOOL_EVENT &aEvent)
Function AlignBottom() Sets Y coordinate of the selected items to the value of the bottom-most select...
CONTEXT_MENU * m_placementMenu
int DistributeHorizontally(const TOOL_EVENT &aEvent)
Function DistributeHorizontally() Distributes the selected items along the X axis.
int AlignTop(const TOOL_EVENT &aEvent)
Function AlignTop() Sets Y coordinate of the selected items to the value of the top-most selected ite...
Class TOOL_EVENT.
Definition: tool_event.h:162
int DistributeVertically(const TOOL_EVENT &aEvent)
Function DistributeVertically() Distributes the selected items along the Y axis.
void setTransitions() override
Sets up handlers for various events.
void Reset(RESET_REASON aReason) override
Function Reset() Brings the tool to a known, initial state.
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:80
SELECTION_TOOL * m_selectionTool
int AlignRight(const TOOL_EVENT &aEvent)
Function AlignRight() Sets X coordinate of the selected items to the value of the right-most selected...
bool Init() override
Function Init() Init() is called once upon a registration of the tool.