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 
68  double& m_rotation;
73 
74 public:
75  // Constructor and destructor
78 
79 private:
80 
84  void OnTextFocusLost( wxFocusEvent& event ) override;
85 
86  void OnPolarChanged( wxCommandEvent& event ) override;
87  void OnClear( wxCommandEvent& event ) override;
88 
89  void OnOriginChanged( wxCommandEvent& event ) override;
90  void OnOverrideChanged( wxCommandEvent& event ) override;
91 
92  void OnOkClick( wxCommandEvent& event ) override;
93 
100  void ToPolarDeg( double x, double y, double& r, double& q );
101 
108  bool GetTranslationInIU ( wxPoint& val, bool polar );
109 
110  // Update texts (comments) after changing the coordinates type (polar/cartesian)
111  void updateDlgTexts( bool aPolar );
112 
117  {
119  double entry1;
120  double entry2;
125 
127  polarCoords( false ),
128  entry1( 0 ),
129  entry2( 0 ),
130  entryRotation( 0 ),
132  anchor( ANCHOR_FROM_LIBRARY ),
133  overrideAnchor( false )
134  {
135  }
136  };
137 
138  // persistent settings
140 };
141 
142 #endif // __DIALOG_MOVE_EXACT__
143 
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
PCB_BASE_FRAME * m_parent
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