QElectroTech  0.70
conductorsegment.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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
bool canMove1stPointY(const qreal &, qreal &) const
QPointF middle() const
QPointF firstPoint() const
void setSecondPoint(const QPointF &)
virtual ~ConductorSegment()
ConductorSegment * previousSegment() const
void setFirstPoint(const QPointF &)
bool isHorizontal() const
bool hasPreviousSegment() const
bool hasNextSegment() const
void setPreviousSegment(ConductorSegment *)
bool canMove1stPointX(const qreal &, qreal &) const
ConductorSegmentType
Known kinds of conductor segments.
Definition: qet.h:86
bool canMove2ndPointX(const qreal &, qreal &) const
qreal length() const
bool isVertical() const
bool canMove2ndPointY(const qreal &, qreal &) const
bool isFirstSegment() const
void setNextSegment(ConductorSegment *)
ConductorSegment * previous_segment
ConductorSegment(const QPointF &, const QPointF &, ConductorSegment *=nullptr, ConductorSegment *=nullptr)
void moveY(const qreal &)
ConductorSegment * nextSegment() const
void moveX(const qreal &)
ConductorSegment * next_segment
QET::ConductorSegmentType type() const
bool isLastSegment() const
QPointF secondPoint() const