LibrePCB Developers Documentation
Loading...
Searching...
No Matches
si_busline.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_BUSLINE_H
21#define LIBREPCB_CORE_SI_BUSLINE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../../geometry/netline.h"
27#include "si_base.h"
28
29#include <QtCore>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class SI_BusJunction;
37class SI_BusLine;
38class SI_BusSegment;
39
40/*******************************************************************************
41 * Class SI_BusLine
42 ******************************************************************************/
43
47class SI_BusLine final : public SI_Base {
48 Q_OBJECT
49
50public:
51 // Signals
52 enum class Event {
55 };
58
59 // Constructors / Destructor
60 SI_BusLine() = delete;
61 SI_BusLine(const SI_BusLine& other) = delete;
62 SI_BusLine(SI_BusSegment& segment, const Uuid& uuid, SI_BusJunction& a,
63 SI_BusJunction& b, const UnsignedLength& width);
64 ~SI_BusLine() noexcept;
65
66 // Getters
67 SI_BusSegment& getBusSegment() const noexcept { return mSegment; }
68 const NetLine& getNetLine() const noexcept { return mNetLine; }
69 const Uuid& getUuid() const noexcept { return mNetLine.getUuid(); }
70 const UnsignedLength& getWidth() const noexcept {
71 return mNetLine.getWidth();
72 }
73 SI_BusJunction& getP1() const noexcept { return *mP1; }
74 SI_BusJunction& getP2() const noexcept { return *mP2; }
76 const SI_BusJunction& firstPoint) const noexcept;
77
78 // Setters
79 void setWidth(const UnsignedLength& width) noexcept;
80
81 // General Methods
82 void addToSchematic() override;
83 void removeFromSchematic() override;
84 void updatePositions() noexcept;
85
86 // Operator Overloadings
87 SI_BusLine& operator=(const SI_BusLine& rhs) = delete;
88
89private: // Data
92
93 // References
96};
97
98/*******************************************************************************
99 * End of File
100 ******************************************************************************/
101
102} // namespace librepcb
103
104#endif
The NetLine class represents a net line within a schematic.
Definition netline.h:128
const UnsignedLength & getWidth() const noexcept
Definition netline.h:152
const Uuid & getUuid() const noexcept
Definition netline.h:151
The Schematic Item Base (SI_Base) class.
Definition si_base.h:45
The SI_BusJunction class.
Definition si_busjunction.h:45
The SI_BusLine class.
Definition si_busline.h:47
Signal< SI_BusLine, Event > onEdited
Definition si_busline.h:56
SI_BusJunction * mP2
Definition si_busline.h:95
SI_BusSegment & mSegment
Definition si_busline.h:90
Slot< SI_BusLine, Event > OnEditedSlot
Definition si_busline.h:57
NetLine mNetLine
Definition si_busline.h:91
Event
Definition si_busline.h:52
void updatePositions() noexcept
Definition si_busline.cpp:124
void removeFromSchematic() override
Definition si_busline.cpp:111
SI_BusLine(const SI_BusLine &other)=delete
const UnsignedLength & getWidth() const noexcept
Definition si_busline.h:70
void addToSchematic() override
Definition si_busline.cpp:98
~SI_BusLine() noexcept
Definition si_busline.cpp:68
SI_BusJunction & getP2() const noexcept
Definition si_busline.h:74
SI_BusJunction & getP1() const noexcept
Definition si_busline.h:73
void setWidth(const UnsignedLength &width) noexcept
Definition si_busline.cpp:90
SI_BusJunction * mP1
Definition si_busline.h:94
const Uuid & getUuid() const noexcept
Definition si_busline.h:69
SI_BusSegment & getBusSegment() const noexcept
Definition si_busline.h:67
SI_BusJunction * getOtherPoint(const SI_BusJunction &firstPoint) const noexcept
Definition si_busline.cpp:75
const NetLine & getNetLine() const noexcept
Definition si_busline.h:68
The SI_BusSegment class.
Definition si_bussegment.h:52
The Signal class is used to emit signals on non-QObject derived classes.
Definition signalslot.h:65
The Slot class is used to receive signals from non-QObject derived classes.
Definition signalslot.h:170
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
Definition occmodel.cpp:77
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694