QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
conductorsegment.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef CONDUCTOR_SEGMENT_H
19#define CONDUCTOR_SEGMENT_H
20#include <QPointF>
21#include "qet.h"
26
27 // constructors, destructor
28 public:
29 ConductorSegment(const QPointF &, const QPointF &, ConductorSegment * = nullptr, ConductorSegment * = nullptr);
30 virtual ~ConductorSegment();
31
32 private:
34
35 // attributes
36 private:
39 QPointF point1;
40 QPointF point2;
41
42 // methods
43 public:
44 void moveX(const qreal &);
45 void moveY(const qreal &);
48 bool hasPreviousSegment() const;
49 bool hasNextSegment() const;
52 bool isStatic() const;
53 bool isFirstSegment() const;
54 bool isLastSegment() const;
55 QPointF firstPoint() const;
56 QPointF secondPoint() const;
57 void setFirstPoint(const QPointF &);
58 void setSecondPoint(const QPointF &);
59 QPointF middle() const;
60 bool isHorizontal() const;
61 bool isVertical() const;
63 qreal length() const;
64 bool isPoint() const;
65 bool canMove1stPointX(const qreal &, qreal &) const;
66 bool canMove2ndPointX(const qreal &, qreal &) const;
67 bool canMove1stPointY(const qreal &, qreal &) const;
68 bool canMove2ndPointY(const qreal &, qreal &) const;
69};
70#endif
Definition conductorsegment.h:25
ConductorSegment(const ConductorSegment &)
QPointF point1
Definition conductorsegment.h:39
QPointF firstPoint() const
Definition conductorsegment.cpp:461
QPointF point2
Definition conductorsegment.h:40
QPointF middle() const
Definition conductorsegment.cpp:509
void moveY(const qreal &)
Definition conductorsegment.cpp:342
bool hasNextSegment() const
Definition conductorsegment.cpp:501
ConductorSegment * previous_segment
Definition conductorsegment.h:37
bool isPoint() const
Definition conductorsegment.cpp:538
void moveX(const qreal &)
Definition conductorsegment.cpp:294
QET::ConductorSegmentType type() const
Definition conductorsegment.cpp:532
bool canMove2ndPointY(const qreal &, qreal &) const
Definition conductorsegment.cpp:238
qreal length() const
Definition conductorsegment.cpp:522
virtual ~ConductorSegment()
Definition conductorsegment.cpp:44
bool isLastSegment() const
Definition conductorsegment.cpp:421
bool canMove1stPointX(const qreal &, qreal &) const
Definition conductorsegment.cpp:58
bool isHorizontal() const
Definition conductorsegment.cpp:453
ConductorSegment * nextSegment() const
Definition conductorsegment.cpp:437
ConductorSegment * next_segment
Definition conductorsegment.h:38
void setNextSegment(ConductorSegment *)
Definition conductorsegment.cpp:401
QPointF secondPoint() const
Definition conductorsegment.cpp:469
void setSecondPoint(const QPointF &)
Definition conductorsegment.cpp:486
bool canMove2ndPointX(const qreal &, qreal &) const
Definition conductorsegment.cpp:118
void setPreviousSegment(ConductorSegment *)
Definition conductorsegment.cpp:390
bool isStatic() const
Definition conductorsegment.cpp:409
bool hasPreviousSegment() const
Definition conductorsegment.cpp:493
void setFirstPoint(const QPointF &)
Definition conductorsegment.cpp:478
bool isFirstSegment() const
Definition conductorsegment.cpp:415
ConductorSegment * previousSegment() const
Definition conductorsegment.cpp:429
bool isVertical() const
Definition conductorsegment.cpp:445
bool canMove1stPointY(const qreal &, qreal &) const
Definition conductorsegment.cpp:178
ConductorSegmentType
Known kinds of conductor segments.
Definition qet.h:84