KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_import_graphics.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) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
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, see <https://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include <widgets/unit_binder.h>
24#include <pcb_edit_frame.h>
25#include <pcbnew_settings.h>
28
30
31
33{
34public:
37
41 std::list<std::unique_ptr<EDA_ITEM>>& GetImportedItems() { return m_importer->GetItems(); }
42
48 bool IsPlacementInteractive() { return !m_placeAtCheckbox->GetValue(); }
49
53 bool ShouldFixDiscontinuities() { return m_rbFixDiscontinuities->GetValue(); }
54
58 int GetTolerance() { return m_tolerance.GetIntValue(); }
59
63 bool ShouldGroupItems() { return m_cbGroupItems->IsChecked(); }
64
68 void SetFilenameOverride( const wxString& aFilenameOverride );
69
70 bool TransferDataToWindow() override;
71 bool TransferDataFromWindow() override;
72
73private:
74 // Virtual event handlers
75 void onBrowseFiles( wxCommandEvent& event ) override;
76 void onFilename( wxCommandEvent& event );
77 void onUpdateUI( wxUpdateUIEvent& event ) override;
78
79private:
81 std::unique_ptr<GRAPHICS_IMPORTER_PCBNEW> m_importer;
82 std::unique_ptr<GRAPHICS_IMPORT_MGR> m_gfxImportMgr;
83
88
90};
DIALOG_IMPORT_GRAPHICS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Import Vector Graphics File"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
std::list< std::unique_ptr< EDA_ITEM > > & GetImportedItems()
std::unique_ptr< GRAPHICS_IMPORT_MGR > m_gfxImportMgr
void onFilename(wxCommandEvent &event)
std::unique_ptr< GRAPHICS_IMPORTER_PCBNEW > m_importer
void onBrowseFiles(wxCommandEvent &event) override
void SetFilenameOverride(const wxString &aFilenameOverride)
Set the filename override to be applied in TransferDataToWindow.
void onUpdateUI(wxUpdateUIEvent &event) override
DIALOG_IMPORT_GRAPHICS(PCB_BASE_FRAME *aParent)
Manage vector graphics importers.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.