KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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, [email protected]
5 * Copyright The 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#pragma once
26
27#include <vector>
28#include <math/box2.h>
29#include <geometry/eda_angle.h>
30#include <widgets/unit_binder.h>
31
33
34
35class PCB_BASE_FRAME;
36
37
39{
44};
45
46
48{
49public:
50 DIALOG_MOVE_EXACT( PCB_BASE_FRAME* aParent, VECTOR2I& aTranslate, EDA_ANGLE& aRotate,
51 ROTATION_ANCHOR& aAnchor, const BOX2I& aBbox );
53
54private:
55
59 void OnTextFocusLost( wxFocusEvent& event ) override;
60
61 void OnPolarChanged( wxCommandEvent& event ) override;
62 void OnClear( wxCommandEvent& event ) override;
63 void OnTextChanged( wxCommandEvent& event ) override;
64
65 bool TransferDataToWindow() override;
66 bool TransferDataFromWindow() override;
67
73 void ToPolarDeg( double x, double y, double& r, EDA_ANGLE& q );
74
82 bool GetTranslationInIU( wxRealPoint& val, bool polar );
83
85
86 // Update controls and their labels after changing the coordinates type (polar/cartesian)
87 void updateDialogControls( bool aPolar );
88
89private:
93 const BOX2I& m_bbox;
94
98
99 std::vector<ROTATION_ANCHOR> m_menuIDs;
100
101 double m_stateX;
102 double m_stateY;
105};
Class DIALOG_MOVE_EXACT_BASE.
VECTOR2I & m_translation
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
ROTATION_ANCHOR & m_rotationAnchor
void ToPolarDeg(double x, double y, double &r, EDA_ANGLE &q)
Convert a given Cartesian point into a polar representation.
const BOX2I & m_bbox
EDA_ANGLE & m_rotation
void updateDialogControls(bool aPolar)
void OnClear(wxCommandEvent &event) override
void OnTextFocusLost(wxFocusEvent &event) override
Reset a text field to be 0 if it was exited while blank.
void OnPolarChanged(wxCommandEvent &event) override
void OnTextChanged(wxCommandEvent &event) override
bool GetTranslationInIU(wxRealPoint &val, bool polar)
Get the (Cartesian) translation described by the text entries.
std::vector< ROTATION_ANCHOR > m_menuIDs
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
ROTATION_ANCHOR
@ ROTATE_AROUND_USER_ORIGIN
@ ROTATE_AROUND_SEL_CENTER
@ ROTATE_AROUND_AUX_ORIGIN
@ ROTATE_AROUND_ITEM_ANCHOR