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  * Copyright (C) 2017 KiCad Developers, see CHANGELOG.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 __DIALOG_MOVE_EXACT__
27 #define __DIALOG_MOVE_EXACT__
28 
29 // Include the wxFormBuider header base:
30 #include <vector>
31 #include <dialog_move_exact_base.h>
32 
34 {
40 };
41 
42 
44 {
48 };
49 
50 
52 {
54  double rotation = 0;
57  bool allowOverride = true;
58  bool editingFootprint = false;
59 };
60 
61 
63 {
64 private:
65 
67  double& m_rotation;
72 
73 public:
74  // Constructor and destructor
77 
78 private:
79 
83  void OnTextFocusLost( wxFocusEvent& event ) override;
84 
85  void OnPolarChanged( wxCommandEvent& event ) override;
86  void OnClear( wxCommandEvent& event ) override;
87 
88  void OnOriginChanged( wxCommandEvent& event ) override;
89  void OnOverrideChanged( wxCommandEvent& event ) override;
90 
91  void OnOkClick( wxCommandEvent& event ) override;
92 
99  void ToPolarDeg( double x, double y, double& r, double& q );
100 
107  bool GetTranslationInIU ( wxPoint& val, bool polar );
108 
109  // Update texts (comments) after changing the coordinates type (polar/cartesian)
110  void updateDlgTexts( bool aPolar );
111 
116  {
118  double entry1;
119  double entry2;
124 
126  polarCoords( false ),
127  entry1( 0 ),
128  entry2( 0 ),
129  entryRotation( 0 ),
131  anchor( ANCHOR_FROM_LIBRARY ),
132  overrideAnchor( false )
133  {
134  }
135  };
136 
137  // persistent settings
139 };
140 
141 #endif // __DIALOG_MOVE_EXACT__
142 
MOVE_EXACT_ORIGIN
Class DIALOG_MOVE_EXACT_BASE.
MOVE_EXACT_ORIGIN origin
MOVE_EXACT_ORIGIN & m_origin
MOVE_EXACT_ANCHOR
void OnOkClick(wxCommandEvent &event) override
void OnPolarChanged(wxCommandEvent &event) override
DIALOG_MOVE_EXACT(PCB_BASE_FRAME *aParent, MOVE_PARAMETERS &aParams)
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.
MOVE_EXACT_ANCHOR & m_anchor
static MOVE_EXACT_OPTIONS m_options
void OnOriginChanged(wxCommandEvent &event) override
MOVE_EXACT_ANCHOR anchor
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
void OnOverrideChanged(wxCommandEvent &event) override