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_EDITOR_POLYGONPROPERTIESDIALOG_H
21#define LIBREPCB_EDITOR_POLYGONPROPERTIESDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include <QtCore>
27#include <QtWidgets>
28
29/*******************************************************************************
30 * Namespace / Forward Declarations
31 ******************************************************************************/
32namespace librepcb {
33
34class BI_Polygon;
35class Layer;
36class LengthUnit;
37class Polygon;
38
39namespace editor {
40
41class UndoStack;
42
43namespace Ui {
44class PolygonPropertiesDialog;
45}
46
47/*******************************************************************************
48 * Class PolygonPropertiesDialog
49 ******************************************************************************/
50
54class PolygonPropertiesDialog final : public QDialog {
55 Q_OBJECT
56
57public:
58 // Constructors / Destructor
61 PolygonPropertiesDialog(Polygon& polygon, UndoStack& undoStack,
62 const QSet<const Layer*>& layers,
63 const LengthUnit& lengthUnit,
64 const QString& settingsPrefix,
65 QWidget* parent = nullptr) noexcept;
66 PolygonPropertiesDialog(BI_Polygon& polygon, UndoStack& undoStack,
67 const QSet<const Layer*>& layers,
68 const LengthUnit& lengthUnit,
69 const QString& settingsPrefix,
70 QWidget* parent = nullptr) noexcept;
71 ~PolygonPropertiesDialog() noexcept;
72
73 // Setters
74 void setReadOnly(bool readOnly) noexcept;
75
76 // Operator Overloadings
78 delete;
79
80private: // Methods
81 PolygonPropertiesDialog(Polygon* libPolygon, BI_Polygon* boardPolygon,
82 UndoStack& undoStack,
83 const QSet<const Layer*>& layers,
84 const LengthUnit& lengthUnit,
85 const QString& settingsPrefix,
86 QWidget* parent = nullptr) noexcept;
87 template <typename T>
88 void load(const T& obj) noexcept;
89 void buttonBoxClicked(QAbstractButton* button) noexcept;
90 bool applyChanges() noexcept;
91 template <typename T>
92 void applyChanges(T& cmd);
93
94private: // Data
98 QScopedPointer<Ui::PolygonPropertiesDialog> mUi;
99};
100
101/*******************************************************************************
102 * End of File
103 ******************************************************************************/
104
105} // namespace editor
106} // namespace librepcb
107
108#endif
The BI_Polygon class.
Definition: bi_polygon.h:46
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 Polygon class.
Definition: polygon.h:45
The PolygonPropertiesDialog class.
Definition: polygonpropertiesdialog.h:54
void setReadOnly(bool readOnly) noexcept
Definition: polygonpropertiesdialog.cpp:88
QScopedPointer< Ui::PolygonPropertiesDialog > mUi
Definition: polygonpropertiesdialog.h:98
void load(const T &obj) noexcept
Definition: polygonpropertiesdialog.cpp:110
UndoStack & mUndoStack
Definition: polygonpropertiesdialog.h:97
Polygon * mLibraryObj
Definition: polygonpropertiesdialog.h:95
bool applyChanges() noexcept
Definition: polygonpropertiesdialog.cpp:138
BI_Polygon * mBoardObj
Definition: polygonpropertiesdialog.h:96
PolygonPropertiesDialog(const PolygonPropertiesDialog &other)=delete
void buttonBoxClicked(QAbstractButton *button) noexcept
Definition: polygonpropertiesdialog.cpp:118
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:106
Definition: occmodel.cpp:77