KiCad PCB EDA Suite
dialog_move_exact.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 John Beard, john.j.beard@gmail.com
5  * Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
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 __DIALOG_MOVE_EXACT__
26 #define __DIALOG_MOVE_EXACT__
27 
28 // Include the wxFormBuider header base:
29 #include <vector>
30 #include <dialog_move_exact_base.h>
31 
33 {
34 private:
35 
37  double& m_rotation;
38 
39 public:
40  // Constructor and destructor
41  DIALOG_MOVE_EXACT( PCB_BASE_FRAME* aParent, wxPoint& translation,
42  double& rotation );
44 
45 private:
46 
50  void OnTextFocusLost( wxFocusEvent& event ) override;
51 
52  void OnPolarChanged( wxCommandEvent& event ) override;
53  void OnClear( wxCommandEvent& event ) override;
54 
55  void OnOkClick( wxCommandEvent& event ) override;
56 
63  void ToPolarDeg( double x, double y, double& r, double& q );
64 
71  bool GetTranslationInIU ( wxPoint& val, bool polar );
72 
73  // Update texts (comments) after changing the coordinates type (polar/cartesian)
74  void updateDlgTexts( bool aPolar );
75 
80  {
82  double entry1;
83  double entry2;
84  double entryRotation;
85 
87  polarCoords(false),
88  entry1(0),
89  entry2(0),
90  entryRotation(0)
91  {
92  }
93  };
94 
95  // persistent settings
97 };
98 
99 #endif // __DIALOG_MOVE_EXACT__
Class DIALOG_MOVE_EXACT_BASE.
DIALOG_MOVE_EXACT(PCB_BASE_FRAME *aParent, wxPoint &translation, double &rotation)
void OnOkClick(wxCommandEvent &event) override
void OnPolarChanged(wxCommandEvent &event) override
void updateDlgTexts(bool aPolar)
bool GetTranslationInIU(wxPoint &val, bool polar)
Get the (Cartesian) translation described by the text entries.
void OnTextFocusLost(wxFocusEvent &event) override
void OnClear(wxCommandEvent &event) override
void ToPolarDeg(double x, double y, double &r, double &q)
Convert a given Cartesian point into a polar representation.
static MOVE_EXACT_OPTIONS m_options
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...