KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_export_vrml.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) 2009-2013 Lorenzo Mercantonio
5 * Copyright (C) 2013 Jean-Pierre Charras jp.charras at wanadoo.fr
6 * Copyright The KiCad Developers, see AUTHORS.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, see <https://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include <dialog_export_vrml_base.h> // the wxFormBuilder header file
25#include <widgets/unit_binder.h>
26
27class PCB_EDIT_FRAME;
28
30{
31public:
34
35 wxFilePickerCtrl* FilePicker() { return m_filePicker; }
36
37 wxString GetSubdir3Dshapes() { return m_SubdirNameCtrl->GetValue(); }
38 int GetSetUserDefinedOrigin() { return m_cbUserDefinedOrigin->GetValue(); }
39
40 double GetXRefMM() { return pcbIUScale.IUTomm( m_xOrigin.GetIntValue() ); }
41 double GetYRefMM() { return pcbIUScale.IUTomm( m_yOrigin.GetIntValue() ); }
42
43 double GetScale()
44 {
45 // Assuming the VRML default unit is the mm
46 // this is the mm to VRML scaling factor for mm, 0.1 inch, and inch
47 double scaleList[4] = { 1.0, 0.001, 10.0/25.4, 1.0/25.4 };
48 return scaleList[ m_unitsChoice->GetSelection() ];
49 }
50
51 bool GetNoUnspecifiedOption() { return m_cbRemoveUnspecified->GetValue(); }
52 bool GetNoDNPOption() { return m_cbRemoveDNP->GetValue(); }
53 bool GetCopyFilesOption() { return m_cbCopyFiles->GetValue(); }
54 bool GetUseRelativePathsOption() { return m_cbUseRelativePaths->GetValue(); }
55
56 void OnUpdateUseRelativePath( wxUpdateUIEvent& event ) override
57 {
58 // Making path relative or absolute has no meaning when VRML files are not copied.
59 event.Enable( m_cbCopyFiles->GetValue() );
60 }
61
62 bool TransferDataFromWindow() override;
63
64private:
67};
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:121
DIALOG_EXPORT_VRML_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("VRML Export Options"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxFilePickerCtrl * FilePicker()
DIALOG_EXPORT_VRML(PCB_EDIT_FRAME *aEditFrame)
void OnUpdateUseRelativePath(wxUpdateUIEvent &event) override
bool TransferDataFromWindow() override
~DIALOG_EXPORT_VRML()=default
The main frame for Pcbnew.