LibrePCB Developers Documentation
airwiresbuilder.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_AIRWIRESBUILDER_H
21#define LIBREPCB_CORE_AIRWIRESBUILDER_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../types/point.h"
27
28#include <QtCore>
29
30/*******************************************************************************
31 * Namespace / Forward Declarations
32 ******************************************************************************/
33namespace librepcb {
34
35class AirWiresBuilderImpl;
36
37/*******************************************************************************
38 * Class AirWiresBuilder
39 ******************************************************************************/
40
44class AirWiresBuilder final {
45 Q_DECLARE_TR_FUNCTIONS(AirWiresBuilder)
46
47public:
48 // Types
49 typedef std::pair<int, int> AirWire;
50 typedef QVector<AirWire> AirWires;
51
52 // Constructors / Destructor
53
57 AirWiresBuilder() noexcept;
58
64 AirWiresBuilder(const AirWiresBuilder& other) = delete;
65
69 ~AirWiresBuilder() noexcept;
70
78 int addPoint(const Point& p) noexcept;
79
86 void addEdge(int p1, int p2) noexcept;
87
93 AirWires buildAirWires() noexcept;
94
95 // Operator overloadings
96 AirWiresBuilder& operator=(const AirWiresBuilder& rhs) = delete;
97
98private: // Data
104 QScopedPointer<AirWiresBuilderImpl> mImpl;
105};
106
107/*******************************************************************************
108 * End of File
109 ******************************************************************************/
110
111} // namespace librepcb
112
113#endif
The AirWiresBuilder class.
Definition: airwiresbuilder.h:44
AirWires buildAirWires() noexcept
Build the air wires.
Definition: airwiresbuilder.cpp:219
AirWiresBuilder() noexcept
Default constructor.
Definition: airwiresbuilder.cpp:201
void addEdge(int p1, int p2) noexcept
Add an edge between two points.
Definition: airwiresbuilder.cpp:215
QVector< AirWire > AirWires
Definition: airwiresbuilder.h:50
QScopedPointer< AirWiresBuilderImpl > mImpl
Definition: airwiresbuilder.h:104
std::pair< int, int > AirWire
Definition: airwiresbuilder.h:49
int addPoint(const Point &p) noexcept
Add a new point.
Definition: airwiresbuilder.cpp:211
Definition: airwiresbuilder.cpp:40
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
Definition: occmodel.cpp:77