KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_export_3d_image.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/gpl-3.0.html
19 * or you may search the http://www.gnu.org website for the version 3 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#pragma once
25
26#include "dialog_shim.h"
27#include <3d_viewer/eda_3d_viewer_frame.h> // for EDA_3D_VIEWER_EXPORT_FORMAT
28#include <wx/spinctrl.h>
29#include <wx/choice.h>
30#include <wx/stattext.h>
31#include <wx/bmpbuttn.h>
32
40
46
48{
49public:
50 DIALOG_EXPORT_3D_IMAGE( wxWindow* aParent,
51 const wxSize& aSize );
52
53 wxSize GetSize() const { return wxSize( m_width, m_height ); }
54 double GetXResolution() const { return m_xResolution; }
55 double GetYResolution() const { return m_yResolution; }
56
57private:
58 bool TransferDataFromWindow() override;
59
60 void OnLockToggle( wxCommandEvent& aEvent );
61 void OnWidthChange( wxSpinDoubleEvent& aEvent );
62 void OnHeightChange( wxSpinDoubleEvent& aEvent );
63 void OnXResolutionChange( wxSpinDoubleEvent& aEvent );
64 void OnYResolutionChange( wxSpinDoubleEvent& aEvent );
65 void OnSizeUnitChange( wxCommandEvent& aEvent );
66 void OnResolutionUnitChange( wxCommandEvent& aEvent );
67
68 wxSize GetPixelSize( double aWidth, double aHeight, double aXResolution, double aYResolution, SIZE_UNITS aSizeUnits ) const;
69 void UpdatePixelSize();
70 void UpdateAspectRatio();
71 void ConvertSizeUnits( SIZE_UNITS aFromUnit, SIZE_UNITS aToUnit );
73
74private:
83
86
87 wxSpinCtrlDouble* m_spinWidth;
88 wxSpinCtrlDouble* m_spinHeight;
89 wxSpinCtrlDouble* m_spinXResolution;
90 wxSpinCtrlDouble* m_spinYResolution;
93 wxBitmapButton* m_lockButton;
94 wxStaticText* m_pixelSizeLabel;
95};
DIALOG_EXPORT_3D_IMAGE(wxWindow *aParent, const wxSize &aSize)
EDA_3D_VIEWER_EXPORT_FORMAT m_format
void OnWidthChange(wxSpinDoubleEvent &aEvent)
void OnXResolutionChange(wxSpinDoubleEvent &aEvent)
void OnLockToggle(wxCommandEvent &aEvent)
void OnHeightChange(wxSpinDoubleEvent &aEvent)
wxSize GetPixelSize(double aWidth, double aHeight, double aXResolution, double aYResolution, SIZE_UNITS aSizeUnits) const
void OnResolutionUnitChange(wxCommandEvent &aEvent)
void OnYResolutionChange(wxSpinDoubleEvent &aEvent)
wxSpinCtrlDouble * m_spinYResolution
wxSpinCtrlDouble * m_spinHeight
void ConvertSizeUnits(SIZE_UNITS aFromUnit, SIZE_UNITS aToUnit)
wxSpinCtrlDouble * m_spinXResolution
void OnSizeUnitChange(wxCommandEvent &aEvent)
void ConvertResolutionUnits(RESOLUTION_UNITS aFromUnit, RESOLUTION_UNITS aToUnit)
DIALOG_SHIM(wxWindow *aParent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, const wxString &name=wxDialogNameStr)
Declaration of the eda_3d_viewer class.
EDA_3D_VIEWER_EXPORT_FORMAT