KiCad PCB EDA Suite
cvpcb_control.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-2016 CERN
5  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  * Copyright (C) 2007-2018 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #ifndef CVPCB_CONTROL_H
27 #define CVPCB_CONTROL_H
28 
29 #include <tool/tool_interactive.h>
31 
32 namespace KIGFX {
33  class ORIGIN_VIEWITEM;
34 }
35 
43 {
44 public:
45  CVPCB_CONTROL();
46  ~CVPCB_CONTROL();
47 
49  void Reset( RESET_REASON aReason ) override;
50 
51  // Miscellaneous
52  int ResetCoords( const TOOL_EVENT& aEvent );
53  int SwitchCursor( const TOOL_EVENT& aEvent );
54  int SwitchUnits( const TOOL_EVENT& aEvent );
55 
57  void setTransitions() override;
58 
59 private:
62 
64  std::unique_ptr<KIGFX::ORIGIN_VIEWITEM> m_gridOrigin;
65 
67  void updateGrid();
68 
70  {
71  return m_frame->GetGalCanvas()->GetView();
72  }
73 };
74 
75 #endif
KIGFX::VIEW * view()
Definition: cvpcb_control.h:69
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
std::unique_ptr< KIGFX::ORIGIN_VIEWITEM > m_gridOrigin
Grid origin marker.
Definition: cvpcb_control.h:64
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
Class DISPLAY_FOOTPRINTS_FRAME is used to display footprints.
Class TOOL_EVENT.
Definition: tool_event.h:168
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:80
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:928
Class VIEW.
Definition: view.h:61
Class CVPCB_CONTROL.
Definition: cvpcb_control.h:42
DISPLAY_FOOTPRINTS_FRAME * m_frame
Pointer to the currently used edit/draw frame.
Definition: cvpcb_control.h:61