QElectroTech  0.8-dev
conductor.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_H
19 #define CONDUCTOR_H
20 
21 #include "conductorproperties.h"
22 #include <QGraphicsPathItem>
23 #include "assignvariables.h"
24 
25 class ConductorProfile;
27 class Diagram;
28 class Terminal;
29 class ConductorSegment;
30 class ConductorTextItem;
31 class Element;
32 class QETDiagramEditor;
35 
36 typedef QPair<QPointF, Qt::Corner> ConductorBend;
37 typedef QHash<Qt::Corner, ConductorProfile> ConductorProfilesGroup;
42 class Conductor : public QGraphicsObject
43 {
44  Q_OBJECT
45 
46  Q_PROPERTY(QPointF pos READ pos WRITE setPos)
47  Q_PROPERTY(int animPath READ fakePath WRITE updatePathAnimate)
50 
51  signals:
53 
54  public:
56  ~Conductor() override;
57 
58  bool isValid() const;
59 
60  private:
61  Conductor(const Conductor &);
62 
63  public:
64  enum { Type = UserType + 1001 };
65  enum Highlight { None, Normal, Alert };
66 
69 
70  public:
77  int type() const override { return Type; }
78  Diagram *diagram() const;
79  ConductorTextItem *textItem() const;
80  void updatePath(const QRectF & = QRectF());
81 
82  //This method do nothing, it's only made to be used with Q_PROPERTY
83  //It's used to anim the path when is change
84  void updatePathAnimate(const int = 1) {updatePath();}
85  int fakePath() {return 1;}
86 
87  void paint(QPainter *,
88  const QStyleOptionGraphicsItem *,
89  QWidget *) override;
90  QRectF boundingRect() const override;
91  QPainterPath shape() const override;
92  virtual QPainterPath nearShape() const;
93  qreal length() const;
95  QPointF posForText(Qt::Orientations &flag);
96  void refreshText();
97  void setPath(const QPainterPath &path);
98  QPainterPath path() const;
99 
100  public:
101  static bool valideXml (QDomElement &);
102  bool fromXml (QDomElement &);
103  QDomElement toXml (QDomDocument &,
104  QHash<Terminal *,
105  int> &) const;
106  private:
107  bool pathFromXml(const QDomElement &);
108 
109  public:
110  QVector <QPointF> handlerPoints() const;
111  const QList<ConductorSegment *> segmentsList() const;
112 
113  void setPropertyToPotential(const ConductorProperties &property,
114  bool only_text = false);
115  void setProperties(const ConductorProperties &property);
117 
118  void setProfile(const ConductorProfile &, Qt::Corner);
119  ConductorProfile profile(Qt::Corner) const;
120  void setProfiles(const ConductorProfilesGroup &);
123  virtual Highlight highlight() const;
124  virtual void setHighlighted(Highlight);
125  QSet<Conductor *> relatedPotentialConductors(
126  const bool all_diagram = true,
127  QList <Terminal *> *t_list=nullptr);
129  void editProperty ();
130 
134 
135  private:
136  void setUpConnectionForFormula(QString old_formula, QString new_formula);
138 
139  public:
140  void setFreezeLabel(bool freeze);
141 
142  public slots:
143  void displayedTextChanged();
144 
145  protected:
146  void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
147  void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
148  void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
149  void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
150  void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
151  QVariant itemChange(GraphicsItemChange, const QVariant &) override;
152  bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override;
153 
154  private:
155  void adjusteHandlerPos();
156 
157  void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
158  void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
159  void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
160  void addHandler();
161  void removeHandler();
162 
163 
164  QVector<QetGraphicsHandlerItem *> m_handler_vector;
165  int m_vector_index = -1;
188  bool m_valid;
189  bool m_freeze_label = false;
190 
192  static QPen conductor_pen;
193  static QBrush conductor_brush;
195  QPainterPath m_path;
196 
197  private:
198  void segmentsToPath();
199  void saveProfile(bool = true);
200  void generateConductorPath(const QPointF &, Qet::Orientation, const QPointF &, Qet::Orientation);
201  void updateConductorPath(const QPointF &, Qet::Orientation, const QPointF &, Qet::Orientation);
203  QList<QPointF> segmentsToPoints() const;
204  QList<ConductorBend> bends() const;
205  QList<QPointF> junctions() const;
206  void pointsToSegments(const QList<QPointF>&);
207  Qt::Corner currentPathType() const;
208  void deleteSegments();
209  static int getCoeff(const qreal &, const qreal &);
210  static int getSign(const qreal &);
211  QHash<ConductorSegmentProfile *, qreal> shareOffsetBetweenSegments(const qreal &offset, const QList<ConductorSegmentProfile *> &, const qreal & = 0.01) const;
212  static QPointF extendTerminal(const QPointF &, Qet::Orientation, qreal = 9.0);
213  static Qt::Corner movementType(const QPointF &, const QPointF &);
214  static QPointF movePointIntoPolygon(const QPointF &, const QPainterPath &);
215 };
216 
217 Conductor * longuestConductorInPotential (Conductor *conductor, bool all_diagram = false);
218 QList <Conductor *> relatedConductors (const Conductor *conductor);
219 
220 
221 //return true if @a is between or at @b and @c.
222 template <typename T>
223 bool isBetween (const T a, const T b, const T c) {
224  return (b <= c)? (a >= b && a <= c) : (a <= b && a >= c);
225 }
226 
227 #endif
Conductor::Conductor
Conductor(Terminal *, Terminal *)
Conductor::Conductor Default constructor.
Definition: conductor.cpp:77
ConductorProperties::m_show_text
bool m_show_text
Definition: conductorproperties.h:103
Conductor::m_handler_vector
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition: conductor.h:164
Conductor::handlerPoints
QVector< QPointF > handlerPoints() const
Conductor::handlerPoints.
Definition: conductor.cpp:1153
Conductor::highlight
virtual Highlight highlight() const
Definition: conductor.cpp:1589
ConductorProperties::Multi
@ Multi
Definition: conductorproperties.h:79
Conductor::shareOffsetBetweenSegments
QHash< ConductorSegmentProfile *, qreal > shareOffsetBetweenSegments(const qreal &offset, const QList< ConductorSegmentProfile * > &, const qreal &=0.01) const
Definition: conductor.cpp:287
ConductorTextItem::wasMovedByUser
virtual bool wasMovedByUser() const
Definition: conductortextitem.cpp:84
Terminal::conductors
QList< Conductor * > conductors() const
Terminal::conductors.
Definition: terminal.cpp:715
Conductor::profile
ConductorProfile profile(Qt::Corner) const
Definition: conductor.cpp:1443
Conductor::sequenceNum
autonum::sequentialNumbers sequenceNum
Definition: conductor.h:49
Qet::West
@ West
Definition: qet.h:209
Conductor::moved_point
int moved_point
Definition: conductor.h:175
Conductor::hoverLeaveEvent
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
Conductor::hoverLeaveEvent Manage the mouse leave event.
Definition: conductor.cpp:657
Conductor::nearShape
virtual QPainterPath nearShape() const
Conductor::nearShape.
Definition: conductor.cpp:904
QetGraphicsHandlerItem::Type
@ Type
Definition: qetgraphicshandleritem.h:42
Conductor::terminal2
Terminal * terminal2
Definition: conductor.h:68
ConductorProfile
Definition: conductorprofile.h:28
ConductorProperties::color
QColor color
Definition: conductorproperties.h:85
Conductor::displayedTextChanged
void displayedTextChanged()
Conductor::displayedTextChanged Update the properties (text) of this conductor and other conductors a...
Definition: conductor.cpp:1606
ConductorProperties::style
Qt::PenStyle style
Definition: conductorproperties.h:110
diagramcommands.h
autonum::sequentialNumbers
Definition: assignvariables.h:35
Conductor::setProperties
void setProperties(const ConductorProperties &property)
Conductor::setProperties Set property as current property of conductor.
Definition: conductor.cpp:1538
ConductorBend
QPair< QPointF, Qt::Corner > ConductorBend
Definition: conductor.h:34
QETProject::projectDiagramsOrderChanged
void projectDiagramsOrderChanged(QETProject *, int, int)
ConductorSegment::previousSegment
ConductorSegment * previousSegment() const
Definition: conductorsegment.cpp:421
ConductorProperties::text_color
QColor text_color
Definition: conductorproperties.h:87
Conductor::updatePath
void updatePath(const QRectF &=QRectF())
Definition: conductor.cpp:161
autonum::sequentialNumbers::fromXml
void fromXml(const QDomElement &element)
sequentialNumbers::fromXml Import sequential values from a QDomElement
Definition: assignvariables.cpp:138
Conductor::m_moving_segment
bool m_moving_segment
Attributs related to mouse interaction.
Definition: conductor.h:174
Conductor::pointsToSegments
void pointsToSegments(const QList< QPointF > &)
Definition: conductor.cpp:958
ConductorProfile::isNull
bool isNull() const
Definition: conductorprofile.cpp:72
conductor.h
Element::uuid
QUuid uuid() const
Element::uuid.
Definition: element.h:250
Conductor::setProfiles
void setProfiles(const ConductorProfilesGroup &)
Conductor::setProfiles.
Definition: conductor.cpp:1924
Conductor::mousePressEvent
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
Conductor::mousePressEvent Manage the mouse press event.
Definition: conductor.cpp:623
Conductor::profiles
ConductorProfilesGroup profiles() const
Definition: conductor.cpp:1916
Conductor::sceneEventFilter
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
Conductor::sceneEventFilter.
Definition: conductor.cpp:710
Conductor::mouseDoubleClickEvent
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
Conductor::mouseDoubleClickEvent Manage the mouse double click.
Definition: conductor.cpp:613
Conductor::boundingRect
QRectF boundingRect() const override
Conductor::boundingRect.
Definition: conductor.cpp:878
Conductor::bends
QList< ConductorBend > bends() const
Definition: conductor.cpp:1843
Conductor::pen_and_brush_initialized
static bool pen_and_brush_initialized
Definition: conductor.h:194
Conductor::movePointIntoPolygon
static QPointF movePointIntoPolygon(const QPointF &, const QPainterPath &)
Definition: conductor.cpp:1953
conductortextitem.h
Terminal::diagram
Diagram * diagram() const
Terminal::diagram.
Definition: terminal.cpp:814
Conductor::sequenceNum
autonum::sequentialNumbers sequenceNum() const
Definition: conductor.h:131
ConductorSegmentProfile
Definition: conductorsegmentprofile.h:26
longuestConductorInPotential
Conductor * longuestConductorInPotential(Conductor *conductor, bool all_diagram)
longuestConductorInPotential
Definition: conductor.cpp:2005
Conductor::fromXml
bool fromXml(QDomElement &)
Conductor::fromXml Load the conductor and her information from xml element.
Definition: conductor.cpp:976
ConductorProfile::segmentsCount
uint segmentsCount(QET::ConductorSegmentType) const
Definition: conductorprofile.cpp:104
Conductor::m_text_item
ConductorTextItem * m_text_item
Text input for non simple, non-singleline conductors.
Definition: conductor.h:170
ConductorSegment::length
qreal length() const
Definition: conductorsegment.cpp:505
Conductor::setPath
void setPath(const QPainterPath &path)
Definition: conductor.cpp:1481
Conductor::Alert
@ Alert
Definition: conductor.h:65
Conductor::diagram
Diagram * diagram() const
Definition: conductor.cpp:559
Conductor::must_highlight_
Highlight must_highlight_
Define whether and how the conductor should be highlighted.
Definition: conductor.h:187
longuestConductorInPotential
Conductor * longuestConductorInPotential(Conductor *conductor, bool all_diagram=false)
longuestConductorInPotential
Definition: conductor.cpp:2005
Conductor::valideXml
static bool valideXml(QDomElement &)
Definition: conductor.cpp:575
autonum::sequentialNumbers::unit_folio
QStringList unit_folio
Definition: assignvariables.h:50
relatedConductors
QList< Conductor * > relatedConductors(const Conductor *conductor)
relatedConductors
Definition: conductor.cpp:2022
Conductor::itemChange
QVariant itemChange(GraphicsItemChange, const QVariant &) override
Conductor::itemChange.
Definition: conductor.cpp:669
DiagramTextItem::setPlainText
void setPlainText(const QString &text)
Definition: diagramtextitem.cpp:218
relatedPotentialTerminal
QList< Terminal * > relatedPotentialTerminal(const Terminal *terminal, const bool all_diagram)
Conductor::relatedPotentialTerminal Return terminal at the same potential from the same parent elemen...
Definition: terminal.cpp:841
Conductor::shape
QPainterPath shape() const override
Conductor::shape.
Definition: conductor.cpp:889
ConductorProfile::height
qreal height() const
Definition: conductorprofile.cpp:92
Terminal::parentElement
Element * parentElement() const
Terminal::parentElement.
Definition: terminal.cpp:822
assignvariables.h
Conductor::m_autoNum_seq
autonum::sequentialNumbers m_autoNum_seq
Definition: conductor.h:137
NumerotationContext
Definition: numerotationcontext.h:31
Conductor::length
qreal length() const
Conductor::length.
Definition: conductor.cpp:1189
Conductor::m_mouse_over
bool m_mouse_over
Definition: conductor.h:166
Conductor::extendTerminal
static QPointF extendTerminal(const QPointF &, Qet::Orientation, qreal=9.0)
Definition: conductor.cpp:449
ConductorProperties::verti_rotate_text
double verti_rotate_text
Definition: conductorproperties.h:100
Conductor::m_valid
bool m_valid
Definition: conductor.h:188
Conductor::updatePathAnimate
void updatePathAnimate(const int=1)
Definition: conductor.h:84
Terminal::uuid
QUuid uuid() const
Definition: terminal.cpp:826
Conductor::addHandler
void addHandler()
Conductor::addHandler Add handlers for this item.
Definition: conductor.cpp:845
Conductor::posForText
QPointF posForText(Qt::Orientations &flag)
Conductor::posForText Calculate and return the better pos for text.
Definition: conductor.cpp:1219
ConductorProperties::m_dash_size
int m_dash_size
Definition: conductorproperties.h:97
QET::Icons::Orientations
QIcon Orientations
Definition: qeticons.cpp:126
Conductor::terminal1
Terminal * terminal1
Definition: conductor.h:67
numerotationcontextcommands.h
Conductor::hoverEnterEvent
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
Conductor::hoverEnterEvent Manage the hover enter event.
Definition: conductor.cpp:646
Conductor::adjusteHandlerPos
void adjusteHandlerPos()
Conductor::adjusteHandlerPos Adjust the position of the handler item.
Definition: conductor.cpp:753
Conductor::Highlight
Highlight
Definition: conductor.h:65
Conductor::setProfile
void setProfile(const ConductorProfile &, Qt::Corner)
Definition: conductor.cpp:1425
Conductor::middleSegment
ConductorSegment * middleSegment()
Definition: conductor.cpp:1196
Conductor::segmentsList
const QList< ConductorSegment * > segmentsList() const
Definition: conductor.cpp:1171
ConductorProperties::type
ConductorType type
Definition: conductorproperties.h:83
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
Conductor::setPropertyToPotential
void setPropertyToPotential(const ConductorProperties &property, bool only_text=false)
Conductor::setPropertiesToPotential.
Definition: conductor.cpp:1507
QET::orthogonalProjection
bool orthogonalProjection(const QPointF &, const QLineF &, QPointF *=nullptr)
Definition: qet.cpp:166
ConductorProperties::text_size
int text_size
Definition: conductorproperties.h:96
ConductorSegment
Definition: conductorsegment.h:25
ChangeConductorCommand
The ChangeConductorCommand class This command changes a particular conductor.
Definition: diagramcommands.h:239
Conductor::rSequenceNum
autonum::sequentialNumbers & rSequenceNum()
Definition: conductor.h:132
Conductor::calculateTextItemPosition
void calculateTextItemPosition()
Conductor::calculateTextItemPosition Move the text at middle of conductor (if is vertical or horizont...
Definition: conductor.cpp:1290
Conductor::mouseReleaseEvent
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Conductor::mouseReleaseEvent.
Definition: conductor.cpp:635
ConductorProperties::singleLineProperties
SingleLineProperties singleLineProperties
Definition: conductorproperties.h:112
Conductor::segmentsToPath
void segmentsToPath()
Conductor::segmentsToPath Generate the QPainterPath from the list of points.
Definition: conductor.cpp:177
Conductor::removeHandler
void removeHandler()
Conductor::removeHandler Remove the handlers of this item.
Definition: conductor.cpp:865
Terminal::removeConductor
void removeConductor(Conductor *conductor)
Terminal::removeConductor Remove a conductor from this terminal.
Definition: terminal.cpp:239
Conductor::propertiesChange
void propertiesChange()
Conductor::modified_path
bool modified_path
Whether the conductor was manually modified by users.
Definition: conductor.h:180
Conductor::movementType
static Qt::Corner movementType(const QPointF &, const QPointF &)
Definition: conductor.cpp:1900
Qet::Orientation
Orientation
Orientation (used for electrical elements and their terminals)
Definition: qet.h:206
Conductor::handlerMouseMoveEvent
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
Conductor::handlerMouseMoveEvent.
Definition: conductor.cpp:794
ConductorProfilesGroup
QHash< Qt::Corner, ConductorProfile > ConductorProfilesGroup
Definition: conductor.h:37
autonum::sequentialNumbers::hundred_folio
QStringList hundred_folio
Definition: assignvariables.h:54
Conductor::fakePath
int fakePath()
Definition: conductor.h:85
Conductor::~Conductor
~Conductor() override
Conductor::~Conductor Destructor. The conductor is removed from is terminal.
Definition: conductor.cpp:137
ConductorProfile::width
qreal width() const
Definition: conductorprofile.cpp:83
Conductor::handlerMousePressEvent
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
Conductor::handlerMousePressEvent.
Definition: conductor.cpp:771
element.h
ConductorProperties::fromXml
void fromXml(QDomElement &)
ConductorProperties::fromXml Import conductor propertie, from the attribute of the xml element 'e'.
Definition: conductorproperties.cpp:307
Conductor::generateConductorPath
void generateConductorPath(const QPointF &, Qet::Orientation, const QPointF &, Qet::Orientation)
Definition: conductor.cpp:346
Conductor::pos
QPointF pos
Definition: conductor.h:46
Conductor::properties
ConductorProperties properties
Definition: conductor.h:48
Conductor::segmentsCount
uint segmentsCount(QET::ConductorSegmentType=QET::Both) const
Definition: conductor.cpp:916
qpropertyundocommand.h
Conductor::animPath
int animPath
Definition: conductor.h:47
Conductor::handlerMouseReleaseEvent
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
Conductor::handlerMouseReleaseEvent.
Definition: conductor.cpp:822
isBetween
bool isBetween(const T a, const T b, const T c)
Definition: conductor.h:223
Conductor::Conductor
Conductor(const Conductor &)
Conductor::editProperty
void editProperty()
Conductor::editProperty.
Definition: conductor.cpp:1717
Conductor::segments
ConductorSegment * segments
Segments composing the conductor.
Definition: conductor.h:172
ConductorProperties::m_vertical_alignment
Qt::Alignment m_vertical_alignment
Definition: conductorproperties.h:108
Conductor::setUpConnectionForFormula
void setUpConnectionForFormula(QString old_formula, QString new_formula)
Conductor::setUpConnectionForFormula setup connection according to the variable of formula.
Definition: conductor.cpp:1733
SingleLineProperties::draw
void draw(QPainter *, QET::ConductorSegmentType, const QRectF &)
Definition: conductorproperties.cpp:65
Element
Definition: element.h:41
ConductorProperties::m_function
QString m_function
Definition: conductorproperties.h:90
Diagram::undoStack
QUndoStack & undoStack()
Diagram::undoStack.
Definition: diagram.h:397
Conductor::conductor_profiles
ConductorProfilesGroup conductor_profiles
Definition: conductor.h:185
Diagram::defaultConductorProperties
ConductorProperties defaultConductorProperties
Default properties for new conductors.
Definition: diagram.h:81
autonum::AssignVariables::formulaToLabel
static QString formulaToLabel(QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt=nullptr)
AssignVariables::formulaToLabel Return the formula with variable assigned (ready to be displayed)
Definition: assignvariables.cpp:187
DiagramTextItem::setColor
void setColor(const QColor &color)
Definition: diagramtextitem.cpp:167
Conductor::m_path
QPainterPath m_path
Definition: conductor.h:195
QetGraphicsHandlerItem
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition: qetgraphicshandleritem.h:37
ConductorSegment::isFirstSegment
bool isFirstSegment() const
Definition: conductorsegment.cpp:409
relatedConductors
QList< Conductor * > relatedConductors(const Conductor *conductor)
relatedConductors
Definition: conductor.cpp:2022
Conductor::setHighlighted
virtual void setHighlighted(Highlight)
Definition: conductor.cpp:1596
Conductor::setSequenceNum
void setSequenceNum(const autonum::sequentialNumbers &sn)
Definition: conductor.cpp:1721
conductorproperties.h
ConductorProperties::horiz_rotate_text
double horiz_rotate_text
Definition: conductorproperties.h:101
ConductorProfile::horizontalSegments
QList< ConductorSegmentProfile * > horizontalSegments()
Definition: conductorprofile.cpp:115
conductorautonumerotation.h
ConductorProperties::m_horizontal_alignment
Qt::Alignment m_horizontal_alignment
Definition: conductorproperties.h:107
Conductor::m_properties
ConductorProperties m_properties
Functional properties.
Definition: conductor.h:168
Diagram::xGrid
static int xGrid
abscissa grid step size
Definition: diagram.h:85
Conductor::setFreezeLabel
void setFreezeLabel(bool freeze)
Conductor::setFreezeLabel Freeze this conductor label if true Unfreeze this conductor label if false.
Definition: conductor.cpp:2035
Qet::North
@ North
Definition: qet.h:206
Conductor::pathFromXml
bool pathFromXml(const QDomElement &)
Conductor::pathFromXml Generate the path (of the line) from xml file by checking the segments in the ...
Definition: conductor.cpp:1075
ConductorXmlRetroCompatibility
Definition: conductor.cpp:43
ConductorProperties::m_color_2
QColor m_color_2
Definition: conductorproperties.h:86
ConductorProperties::cond_size
double cond_size
Definition: conductorproperties.h:99
isContained
bool isContained(const QPointF &a, const QPointF &b, const QPointF &c)
Definition: conductor.cpp:1763
Conductor::relatedPotentialConductors
QSet< Conductor * > relatedPotentialConductors(const bool all_diagram=true, QList< Terminal * > *t_list=nullptr)
Conductor::relatedPotentialConductors Return all conductors at the same potential of this conductor,...
Definition: conductor.cpp:1647
QETDiagramEditor
Definition: qetdiagrameditor.h:51
QetGraphicsHandlerItem::setColor
void setColor(QColor color)
QetGraphicsHandlerItem::setColor.
Definition: qetgraphicshandleritem.cpp:48
Conductor::saveProfile
void saveProfile(bool=true)
Definition: conductor.cpp:1386
Conductor::isValid
bool isValid() const
Conductor::isValid.
Definition: conductor.cpp:150
Diagram::yGrid
static int yGrid
ordinate grid step size
Definition: diagram.h:87
ConductorProperties::m_formula
QString m_formula
Definition: conductorproperties.h:94
Conductor::path
QPainterPath path() const
Definition: conductor.cpp:1491
Conductor::getCoeff
static int getCoeff(const qreal &, const qreal &)
Definition: conductor.cpp:1408
QET::Icons::sl
QIcon sl
Definition: qeticons.cpp:202
ConductorSegment::isHorizontal
bool isHorizontal() const
Definition: conductorsegment.cpp:442
Conductor::type
int type() const override
type Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a conductor.
Definition: conductor.h:77
Conductor::has_to_save_profile
bool has_to_save_profile
Whether the current profile should be saved as soon as possible.
Definition: conductor.h:182
Conductor::updateConductorPath
void updateConductorPath(const QPointF &, Qet::Orientation, const QPointF &, Qet::Orientation)
Definition: conductor.cpp:218
QET::Vertical
@ Vertical
Vertical segment.
Definition: qet.h:90
DiagramTextItem::setFont
void setFont(const QFont &font)
Definition: diagramtextitem.cpp:153
Conductor::Type
@ Type
Definition: conductor.h:64
Qet::South
@ South
Definition: qet.h:208
Conductor::m_vector_index
int m_vector_index
Definition: conductor.h:165
ConductorProperties
The ConductorProperties class This class represents the functional properties of a particular conduct...
Definition: conductorproperties.h:68
Conductor::toXml
QDomElement toXml(QDomDocument &, QHash< Terminal *, int > &) const
Conductor::toXml Exporte les caracteristiques du conducteur sous forme d'une element XML.
Definition: conductor.cpp:1010
Conductor::before_mov_text_pos_
QPointF before_mov_text_pos_
Definition: conductor.h:178
Diagram::snapToGrid
static QPointF snapToGrid(const QPointF &p)
Diagram::snapToGrid Return a nearest snap point of p.
Definition: diagram.cpp:2240
ConductorProperties::Single
@ Single
Definition: conductorproperties.h:79
Conductor::conductor_brush
static QBrush conductor_brush
Definition: conductor.h:193
autonum::sequentialNumbers::toXml
QDomElement toXml(QDomDocument &document, const QString &tag_name=QString("sequentialNumbers")) const
sequentialNumbers::toXml export this sequential numbers into a QDomElement.
Definition: assignvariables.cpp:94
Conductor::None
@ None
Definition: conductor.h:65
conductorpropertiesdialog.h
qetdiagrameditor.h
Conductor::conductor_pen
static QPen conductor_pen
QPen et QBrush objects used to draw conductors.
Definition: conductor.h:192
QET::Both
@ Both
Invalid segment.
Definition: qet.h:91
autonum::sequentialNumbers::ten_folio
QStringList ten_folio
Definition: assignvariables.h:52
QET::ConductorSegmentType
ConductorSegmentType
Known kinds of conductor segments.
Definition: qet.h:88
ConductorSegment::middle
QPointF middle() const
Definition: conductorsegment.cpp:493
Conductor::deleteSegments
void deleteSegments()
Supprime les segments.
Definition: conductor.cpp:1939
QET::Horizontal
@ Horizontal
Horizontal segment.
Definition: qet.h:89
DiagramTextItem::font
QFont font
Definition: diagramtextitem.h:40
ConductorXmlRetroCompatibility::loadSequential
static void loadSequential(const QDomElement &dom_element, const QString &seq, QStringList *list)
Definition: conductor.cpp:46
ConductorProperties::m_bicolor
bool m_bicolor
Definition: conductorproperties.h:105
Conductor
Definition: conductor.h:43
conductorsegmentprofile.h
Qet::East
@ East
Definition: qet.h:207
ConductorPropertiesDialog::PropertiesDialog
static void PropertiesDialog(Conductor *conductor, QWidget *parent=nullptr)
ConductorPropertiesDialog::PropertiesDialog Static method for open and apply properties.
Definition: conductorpropertiesdialog.cpp:62
terminal.h
ConductorProperties::m_wire_color
QString m_wire_color
Definition: conductorproperties.h:92
Conductor::paint
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
Definition: conductor.cpp:475
Terminal
The Terminal class This class represents a terminal of an electrical element, i.e....
Definition: terminal.h:35
ConductorProfile::verticalSegments
QList< ConductorSegmentProfile * > verticalSegments()
Definition: conductorprofile.cpp:124
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
ConductorTextItem
Definition: conductortextitem.h:30
ConductorTextItem::wasRotateByUser
virtual bool wasRotateByUser() const
ConductorTextItem::wasRotateByUser.
Definition: conductortextitem.cpp:92
ConductorProperties::text
QString text
Definition: conductorproperties.h:89
Conductor::diagramEditor
QETDiagramEditor * diagramEditor() const
Conductor::diagramEditor.
Definition: conductor.cpp:1703
QET::Icons::br
QIcon br
Definition: qeticons.cpp:185
Conductor::junctions
QList< QPointF > junctions() const
Definition: conductor.cpp:1773
Conductor::textItem
ConductorTextItem * textItem() const
Definition: conductor.cpp:566
ConductorProperties::m_tension_protocol
QString m_tension_protocol
Definition: conductorproperties.h:91
QetGraphicsHandlerItem::handlerForPoint
static QVector< QetGraphicsHandlerItem * > handlerForPoint(const QVector< QPointF > &points, int size=10)
QetGraphicsHandlerItem::handlerForPoint.
Definition: qetgraphicshandleritem.cpp:87
Conductor::m_moved_segment
ConductorSegment * m_moved_segment
Definition: conductor.h:177
Conductor::currentPathType
Qt::Corner currentPathType() const
Definition: conductor.cpp:1911
Conductor::segmentsToPoints
QList< QPointF > segmentsToPoints() const
Definition: conductor.cpp:930
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
Conductor::m_freeze_label
bool m_freeze_label
Definition: conductor.h:189
autonum::sequentialNumbers::unit
QStringList unit
Definition: assignvariables.h:49
Conductor::getSign
static int getSign(const qreal &)
Definition: conductor.cpp:1416
ConductorProperties::m_wire_section
QString m_wire_section
Definition: conductorproperties.h:93
autonum::sequentialNumbers::ten
QStringList ten
Definition: assignvariables.h:51
diagram.h
DiagramTextItem::textEdited
void textEdited(const QString &old_str, const QString &new_str)
Conductor::refreshText
void refreshText()
Conductor::refreshText Refresh the text of this conductor. recalcule and set the text according to th...
Definition: conductor.cpp:1452
ConductorXmlRetroCompatibility::loadSequential
static void loadSequential(const QDomElement &dom_element, Conductor *conductor)
Definition: conductor.cpp:56
ConductorProfile::segments
QList< ConductorSegmentProfile * > segments
Segments composing the conductor.
Definition: conductorprofile.h:40
Conductor::Normal
@ Normal
Definition: conductor.h:65
Conductor::m_previous_z_value
qreal m_previous_z_value
Definition: conductor.h:176
conductorsegment.h
autonum::sequentialNumbers::hundred
QStringList hundred
Definition: assignvariables.h:53