LibrePCB Developers Documentation
si_polygon.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_CORE_SI_POLYGON_H
21#define LIBREPCB_CORE_SI_POLYGON_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../../types/point.h"
27#include "../../../types/uuid.h"
28#include "si_base.h"
29
30#include <QtCore>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36
37class Polygon;
38class Schematic;
39
40/*******************************************************************************
41 * Class SI_Polygon
42 ******************************************************************************/
43
47class SI_Polygon final : public SI_Base {
48 Q_OBJECT
49
50public:
51 // Constructors / Destructor
52 SI_Polygon() = delete;
53 SI_Polygon(const SI_Polygon& other) = delete;
54 SI_Polygon(Schematic& schematic, const Polygon& polygon);
55 ~SI_Polygon() noexcept;
56
57 // Getters
58 const Uuid& getUuid() const noexcept;
59 Polygon& getPolygon() noexcept { return *mPolygon; }
60 const Polygon& getPolygon() const noexcept { return *mPolygon; }
61
62 // General Methods
63 void addToSchematic() override;
64 void removeFromSchematic() override;
65
66 // Operator Overloadings
67 SI_Polygon& operator=(const SI_Polygon& rhs) = delete;
68
69private: // Attributes
70 QScopedPointer<Polygon> mPolygon;
71};
72
73/*******************************************************************************
74 * End of File
75 ******************************************************************************/
76
77} // namespace librepcb
78
79#endif
The Polygon class.
Definition: polygon.h:45
The Schematic Item Base (SI_Base) class.
Definition: si_base.h:45
The SI_Polygon class represents a polygon in a schematic.
Definition: si_polygon.h:47
void removeFromSchematic() override
Definition: si_polygon.cpp:65
~SI_Polygon() noexcept
Definition: si_polygon.cpp:42
const Polygon & getPolygon() const noexcept
Definition: si_polygon.h:60
void addToSchematic() override
Definition: si_polygon.cpp:58
SI_Polygon & operator=(const SI_Polygon &rhs)=delete
QScopedPointer< Polygon > mPolygon
Definition: si_polygon.h:70
const Uuid & getUuid() const noexcept
Definition: si_polygon.cpp:50
SI_Polygon(const SI_Polygon &other)=delete
Polygon & getPolygon() noexcept
Definition: si_polygon.h:59
The Schematic class represents one schematic page of a project and is always part of a circuit.
Definition: schematic.h:74
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
Definition: occmodel.cpp:77