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
29#include <wx/spinctrl.h>
30#include <wx/choice.h>
31#include <wx/stattext.h>
32#include <wx/bmpbuttn.h>
33
41
47
49{
50public:
51 DIALOG_EXPORT_3D_IMAGE( wxWindow* aParent, const wxSize& aCanvasSize,
53
54 wxSize GetSize() const { return wxSize( m_width, m_height ); }
55 double GetXResolution() const { return m_xResolution; }
56 double GetYResolution() const { return m_yResolution; }
57
58private:
59 bool TransferDataToWindow() override;
60 bool TransferDataFromWindow() override;
61
62 void OnLockToggle( wxCommandEvent& aEvent );
63 void OnWidthChange( wxSpinDoubleEvent& aEvent );
64 void OnHeightChange( wxSpinDoubleEvent& aEvent );
65 void OnXResolutionChange( wxSpinDoubleEvent& aEvent );
66 void OnYResolutionChange( wxSpinDoubleEvent& aEvent );
67 void OnSizeUnitChange( wxCommandEvent& aEvent );
68 void OnResolutionUnitChange( wxCommandEvent& aEvent );
69
70 wxSize GetPixelSize( double aWidth, double aHeight, double aXResolution, double aYResolution, SIZE_UNITS aSizeUnits ) const;
71 void UpdatePixelSize();
72 void UpdateAspectRatio();
73 void ConvertSizeUnits( SIZE_UNITS aFromUnit, SIZE_UNITS aToUnit );
75
76private:
85
88
89 wxSpinCtrlDouble* m_spinWidth;
90 wxSpinCtrlDouble* m_spinHeight;
91 wxSpinCtrlDouble* m_spinXResolution;
92 wxSpinCtrlDouble* m_spinYResolution;
95 wxBitmapButton* m_lockButton;
96 wxStaticText* m_pixelSizeLabel;
97};
DIALOG_EXPORT_3D_IMAGE(wxWindow *aParent, const wxSize &aCanvasSize, EDA_3D_VIEWER_SETTINGS::EXPORT_IMAGE_SETTINGS *aCfg)
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)
EDA_3D_VIEWER_SETTINGS::EXPORT_IMAGE_SETTINGS * m_cfg
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.
static const long long MM