LibrePCB Developers Documentation
polygonpropertiesdialog.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_POLYGONPROPERTIESDIALOG_H
21 #define LIBREPCB_POLYGONPROPERTIESDIALOG_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../geometry/vertex.h"
27 #include "../units/all_length_units.h"
28 
29 #include <QtCore>
30 #include <QtWidgets>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 class UndoStack;
38 class Polygon;
39 class GraphicsLayer;
40 
41 namespace Ui {
42 class PolygonPropertiesDialog;
43 }
44 
45 /*******************************************************************************
46  * Class PolygonPropertiesDialog
47  ******************************************************************************/
48 
52 class PolygonPropertiesDialog final : public QDialog {
53  Q_OBJECT
54 
55 public:
56  // Constructors / Destructor
57  PolygonPropertiesDialog() = delete;
58  PolygonPropertiesDialog(const PolygonPropertiesDialog& other) = delete;
59  PolygonPropertiesDialog(Polygon& polygon, UndoStack& undoStack,
60  QList<GraphicsLayer*> layers,
61  const LengthUnit& lengthUnit,
62  const QString& settingsPrefix,
63  QWidget* parent = nullptr) noexcept;
64  ~PolygonPropertiesDialog() noexcept;
65 
66  // Operator Overloadings
67  PolygonPropertiesDialog& operator=(const PolygonPropertiesDialog& rhs) =
68  delete;
69 
70 private: // GUI Events
71  void buttonBoxClicked(QAbstractButton* button) noexcept;
72 
73 private: // Methods
74  bool applyChanges() noexcept;
75  void selectLayerNameInCombobox(const QString& name) noexcept;
76 
77 private: // Data
80  QScopedPointer<Ui::PolygonPropertiesDialog> mUi;
81 };
82 
83 /*******************************************************************************
84  * End of File
85  ******************************************************************************/
86 
87 } // namespace librepcb
88 
89 #endif // LIBREPCB_POLYGONPROPERTIESDIALOG_H
Definition: mainwindow.h:10
Definition: airwiresbuilder.cpp:32
Polygon & mPolygon
Definition: polygonpropertiesdialog.h:78
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:107
QScopedPointer< Ui::PolygonPropertiesDialog > mUi
Definition: polygonpropertiesdialog.h:80
UndoStack & mUndoStack
Definition: polygonpropertiesdialog.h:79
The Polygon class.
Definition: polygon.h:49
The PolygonPropertiesDialog class.
Definition: polygonpropertiesdialog.h:52
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:62