LibrePCB Developers Documentation
dxfimportdialog.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (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, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_EDITOR_DXFIMPORTDIALOG_H
21#define LIBREPCB_EDITOR_DXFIMPORTDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
29
30#include <QtCore>
31#include <QtWidgets>
32
33#include <optional.hpp>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39
40class Layer;
41class LengthUnit;
42
43namespace editor {
44
45namespace Ui {
46class DxfImportDialog;
47}
48
49/*******************************************************************************
50 * Class DxfImportDialog
51 ******************************************************************************/
52
56class DxfImportDialog final : public QDialog {
57 Q_OBJECT
58
59public:
60 // Constructors / Destructor
61 DxfImportDialog() = delete;
62 DxfImportDialog(const DxfImportDialog& other) = delete;
63 explicit DxfImportDialog(const QSet<const Layer*>& layers,
64 const Layer& defaultLayer, bool supportHoles,
65 const LengthUnit& lengthUnit,
66 const QString& settingsPrefix,
67 QWidget* parent = nullptr) noexcept;
68 ~DxfImportDialog() noexcept;
69
70 // Getters
71 const Layer& getLayer() const noexcept;
72 UnsignedLength getLineWidth() const noexcept;
73 qreal getScaleFactor() const noexcept;
74 tl::optional<Point> getPlacementPosition() const noexcept;
75 bool getJoinTangentPolylines() const noexcept;
76 bool getImportCirclesAsDrills() const noexcept;
77
78 // General Methods
79 FilePath chooseFile() const noexcept;
80 static void throwNoObjectsImportedError();
81
82 // Operator Overloadings
83 DxfImportDialog& operator=(const DxfImportDialog& rhs) = delete;
84
85private: // Data
86 QScopedPointer<Ui::DxfImportDialog> mUi;
89};
90
91/*******************************************************************************
92 * End of File
93 ******************************************************************************/
94
95} // namespace editor
96} // namespace librepcb
97
98#endif
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
The Layer class provides all supported geometry layers.
Definition: layer.h:42
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
This class provides a Dialog (GUI) to choose DXF import settings.
Definition: dxfimportdialog.h:56
tl::optional< Point > getPlacementPosition() const noexcept
Definition: dxfimportdialog.cpp:139
QString mSettingsPrefix
Definition: dxfimportdialog.h:87
qreal getScaleFactor() const noexcept
Definition: dxfimportdialog.cpp:135
const Layer & mDefaultLayer
Definition: dxfimportdialog.h:88
static void throwNoObjectsImportedError()
Definition: dxfimportdialog.cpp:171
UnsignedLength getLineWidth() const noexcept
Definition: dxfimportdialog.cpp:131
const Layer & getLayer() const noexcept
Definition: dxfimportdialog.cpp:123
FilePath chooseFile() const noexcept
Definition: dxfimportdialog.cpp:159
bool getImportCirclesAsDrills() const noexcept
Definition: dxfimportdialog.cpp:151
QScopedPointer< Ui::DxfImportDialog > mUi
Definition: dxfimportdialog.h:86
bool getJoinTangentPolylines() const noexcept
Definition: dxfimportdialog.cpp:147
DxfImportDialog(const DxfImportDialog &other)=delete
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696
Definition: uuid.h:183