QElectroTech  0.8-dev
conductorsegment.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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
ConductorSegment::canMove2ndPointY
bool canMove2ndPointY(const qreal &, qreal &) const
Definition: conductorsegment.cpp:234
ConductorSegment::hasPreviousSegment
bool hasPreviousSegment() const
Definition: conductorsegment.cpp:479
ConductorSegment::point2
QPointF point2
Definition: conductorsegment.h:40
ConductorSegment::setPreviousSegment
void setPreviousSegment(ConductorSegment *)
Definition: conductorsegment.cpp:385
ConductorSegment::previousSegment
ConductorSegment * previousSegment() const
Definition: conductorsegment.cpp:421
ConductorSegment::moveY
void moveY(const qreal &)
Definition: conductorsegment.cpp:337
ConductorSegment::ConductorSegment
ConductorSegment(const ConductorSegment &)
ConductorSegment::length
qreal length() const
Definition: conductorsegment.cpp:505
ConductorSegment::canMove1stPointY
bool canMove1stPointY(const qreal &, qreal &) const
Definition: conductorsegment.cpp:175
ConductorSegment::setNextSegment
void setNextSegment(ConductorSegment *)
Definition: conductorsegment.cpp:396
ConductorSegment::firstPoint
QPointF firstPoint() const
Definition: conductorsegment.cpp:449
ConductorSegment::type
QET::ConductorSegmentType type() const
Definition: conductorsegment.cpp:514
ConductorSegment::isPoint
bool isPoint() const
Definition: conductorsegment.cpp:519
ConductorSegment::secondPoint
QPointF secondPoint() const
Definition: conductorsegment.cpp:456
ConductorSegment::ConductorSegment
ConductorSegment(const QPointF &, const QPointF &, ConductorSegment *=nullptr, ConductorSegment *=nullptr)
Definition: conductorsegment.cpp:28
ConductorSegment::moveX
void moveX(const qreal &)
Definition: conductorsegment.cpp:289
ConductorSegment::hasNextSegment
bool hasNextSegment() const
Definition: conductorsegment.cpp:486
ConductorSegment::next_segment
ConductorSegment * next_segment
Definition: conductorsegment.h:38
ConductorSegment::setSecondPoint
void setSecondPoint(const QPointF &)
Definition: conductorsegment.cpp:472
qet.h
ConductorSegment
Definition: conductorsegment.h:25
ConductorSegment::isVertical
bool isVertical() const
Definition: conductorsegment.cpp:435
ConductorSegment::canMove1stPointX
bool canMove1stPointX(const qreal &, qreal &) const
Definition: conductorsegment.cpp:57
ConductorSegment::isFirstSegment
bool isFirstSegment() const
Definition: conductorsegment.cpp:409
ConductorSegment::~ConductorSegment
virtual ~ConductorSegment()
Definition: conductorsegment.cpp:44
ConductorSegment::previous_segment
ConductorSegment * previous_segment
Definition: conductorsegment.h:37
ConductorSegment::isHorizontal
bool isHorizontal() const
Definition: conductorsegment.cpp:442
QET::Vertical
@ Vertical
Vertical segment.
Definition: qet.h:90
ConductorSegment::isStatic
bool isStatic() const
Definition: conductorsegment.cpp:404
QET::ConductorSegmentType
ConductorSegmentType
Known kinds of conductor segments.
Definition: qet.h:88
ConductorSegment::middle
QPointF middle() const
Definition: conductorsegment.cpp:493
QET::Horizontal
@ Horizontal
Horizontal segment.
Definition: qet.h:89
ConductorSegment::setFirstPoint
void setFirstPoint(const QPointF &)
Definition: conductorsegment.cpp:464
ConductorSegment::point1
QPointF point1
Definition: conductorsegment.h:39
ConductorSegment::isLastSegment
bool isLastSegment() const
Definition: conductorsegment.cpp:414
ConductorSegment::nextSegment
ConductorSegment * nextSegment() const
Definition: conductorsegment.cpp:428
ConductorSegment::canMove2ndPointX
bool canMove2ndPointX(const qreal &, qreal &) const
Definition: conductorsegment.cpp:116
conductorsegment.h