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  ******************************************************************************/
38 namespace librepcb {
39 
40 class Layer;
41 class LengthUnit;
42 
43 namespace editor {
44 
45 namespace Ui {
46 class DxfImportDialog;
47 }
48 
49 /*******************************************************************************
50  * Class DxfImportDialog
51  ******************************************************************************/
52 
56 class DxfImportDialog final : public QDialog {
57  Q_OBJECT
58 
59 public:
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 
85 private: // Data
86  QScopedPointer<Ui::DxfImportDialog> mUi;
87  QString mSettingsPrefix;
89 };
90 
91 /*******************************************************************************
92  * End of File
93  ******************************************************************************/
94 
95 } // namespace editor
96 } // namespace librepcb
97 
98 #endif
QScopedPointer< Ui::DxfImportDialog > mUi
Definition: dxfimportdialog.h:86
This class provides a Dialog (GUI) to choose DXF import settings.
Definition: dxfimportdialog.h:56
Definition: occmodel.cpp:77
The Layer class provides all supported geometry layers.
Definition: layer.h:40
const Layer & mDefaultLayer
Definition: dxfimportdialog.h:88
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
QString mSettingsPrefix
Definition: dxfimportdialog.h:87
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696