20#include "../autoNum/assignvariables.h"
21#include "../conductorproperties.h"
23#include <QGraphicsPathItem>
46 Q_PROPERTY(QPointF
pos READ
pos WRITE setPos)
64 enum {
Type = UserType + 1001 };
89 const QStyleOptionGraphicsItem *,
92 QPainterPath
shape()
const override;
99 QPainterPath
path()
const;
117 bool only_text =
false);
129 const bool all_diagram =
true,
130 QList <Terminal *> *t_list=
nullptr);
144 QString old_formula, QString new_formula);
155 QGraphicsSceneMouseEvent *event)
override;
158 QGraphicsSceneMouseEvent *event)
override;
162 GraphicsItemChange,
const QVariant &)
override;
164 QGraphicsItem *watched, QEvent *event)
override;
171 QGraphicsSceneMouseEvent *event);
174 QGraphicsSceneMouseEvent *event);
177 QGraphicsSceneMouseEvent *event);
222 QList<ConductorBend>
bends()
const;
227 static int getCoeff(
const qreal &,
const qreal &);
228 static int getSign(
const qreal &);
229 QHash<ConductorSegmentProfile *, qreal>
shareOffsetBetweenSegments(
const qreal &offset,
const QList<ConductorSegmentProfile *> &,
const qreal & = 0.01)
const;
231 static Qt::Corner
movementType(
const QPointF &,
const QPointF &);
242 return (b <= c)? (a >= b && a <= c) : (a <= b && a >= c);
Definition conductor.h:43
bool has_to_save_profile
Whether the current profile should be saved as soon as possible.
Definition conductor.h:200
autonum::sequentialNumbers m_autoNum_seq
Definition conductor.h:145
void setSequenceNum(const autonum::sequentialNumbers &sn)
Definition conductor.cpp:1771
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
Conductor::sceneEventFilter.
Definition conductor.cpp:733
bool pathFromXml(const QDomElement &)
Conductor::pathFromXml Generate the path (of the line) from xml file by checking the segments in the ...
Definition conductor.cpp:1117
static QPen conductor_pen
QPen et QBrush objects used to draw conductors.
Definition conductor.h:210
int moved_point
Definition conductor.h:193
QETDiagramEditor * diagramEditor() const
Conductor::diagramEditor.
Definition conductor.cpp:1751
bool isValid() const
Conductor::isValid.
Definition conductor.cpp:153
void setProperties(const ConductorProperties &property)
Conductor::setProperties Set property as current property of conductor.
Definition conductor.cpp:1583
qreal length() const
Conductor::length.
Definition conductor.cpp:1232
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
Conductor::hoverEnterEvent Manage the hover enter event.
Definition conductor.cpp:669
ConductorProfile profile(Qt::Corner) const
Definition conductor.cpp:1487
Diagram * diagram() const
Definition conductor.cpp:580
uint segmentsCount(QET::ConductorSegmentType=QET::Both) const
Definition conductor.cpp:939
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
Conductor::handlerMouseReleaseEvent.
Definition conductor.cpp:845
void updatePathAnimate(const int=1)
Definition conductor.h:84
QPainterPath path() const
Definition conductor.cpp:1536
void generateConductorPath(const QPointF &, Qet::Orientation, const QPointF &, Qet::Orientation)
Definition conductor.cpp:351
void deleteSegments()
Supprime les segments.
Definition conductor.cpp:1997
QDomElement toXml(QDomDocument &, QHash< Terminal *, int > &) const
Conductor::toXml Exporte les caracteristiques du conducteur sous forme d'une element XML.
Definition conductor.cpp:1035
void pointsToSegments(const QList< QPointF > &)
Definition conductor.cpp:983
int m_vector_index
Definition conductor.h:183
ConductorProperties properties
Definition conductor.h:48
ConductorProfilesGroup profiles() const
Definition conductor.cpp:1973
int type() const override
type Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a conductor.
Definition conductor.h:77
ConductorProfilesGroup conductor_profiles
Definition conductor.h:203
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Conductor::mouseReleaseEvent.
Definition conductor.cpp:658
QVariant itemChange(GraphicsItemChange, const QVariant &) override
Conductor::itemChange.
Definition conductor.cpp:692
ConductorProperties m_properties
Functional properties.
Definition conductor.h:186
QPointF pos
Definition conductor.h:46
Terminal * terminal1
Definition conductor.h:67
void updateConductorPath(const QPointF &, Qet::Orientation, const QPointF &, Qet::Orientation)
Definition conductor.cpp:222
QRectF boundingRect() const override
Conductor::boundingRect.
Definition conductor.cpp:901
@ Type
Definition conductor.h:64
static bool pen_and_brush_initialized
Definition conductor.h:212
void displayedTextChanged()
Conductor::displayedTextChanged Update the properties (text) of this conductor and other conductors a...
Definition conductor.cpp:1652
virtual QPainterPath nearShape() const
Conductor::nearShape.
Definition conductor.cpp:927
ConductorSegment * middleSegment()
Definition conductor.cpp:1239
int animPath
Definition conductor.h:47
bool fromXml(QDomElement &)
Conductor::fromXml Load the conductor and her information from xml element.
Definition conductor.cpp:1001
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:1693
void setProfiles(const ConductorProfilesGroup &)
Conductor::setProfiles.
Definition conductor.cpp:1982
void setPath(const QPainterPath &path)
Definition conductor.cpp:1526
void setFreezeLabel(bool freeze)
Conductor::setFreezeLabel Freeze this conductor label if true Unfreeze this conductor label if false.
Definition conductor.cpp:2111
bool modified_path
Whether the conductor was manually modified by users.
Definition conductor.h:198
static QPointF extendTerminal(const QPointF &, Qet::Orientation, qreal=10)
Conductor::extendTerminal.
Definition conductor.cpp:456
static int getSign(const qreal &)
Definition conductor.cpp:1460
int fakePath()
Definition conductor.h:85
Highlight must_highlight_
Define whether and how the conductor should be highlighted.
Definition conductor.h:205
QHash< ConductorSegmentProfile *, qreal > shareOffsetBetweenSegments(const qreal &offset, const QList< ConductorSegmentProfile * > &, const qreal &=0.01) const
Definition conductor.cpp:291
qreal m_previous_z_value
Definition conductor.h:194
Terminal * terminal2
Definition conductor.h:68
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
Conductor::hoverLeaveEvent Manage the mouse leave event.
Definition conductor.cpp:680
virtual void setHighlighted(Highlight)
Definition conductor.cpp:1642
static int getCoeff(const qreal &, const qreal &)
Definition conductor.cpp:1452
Highlight
Definition conductor.h:65
@ None
Definition conductor.h:65
@ Normal
Definition conductor.h:65
@ Alert
Definition conductor.h:65
QList< QPointF > segmentsToPoints() const
Definition conductor.cpp:954
QPainterPath shape() const override
Conductor::shape.
Definition conductor.cpp:912
QVector< QPointF > handlerPoints() const
Conductor::handlerPoints.
Definition conductor.cpp:1195
bool m_valid
Definition conductor.h:206
void setPropertyToPotential(const ConductorProperties &property, bool only_text=false)
Conductor::setPropertiesToPotential.
Definition conductor.cpp:1552
Qt::Corner currentPathType() const
Definition conductor.cpp:1967
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
Conductor::mouseDoubleClickEvent Manage the mouse double click.
Definition conductor.cpp:636
void setProfile(const ConductorProfile &, Qt::Corner)
Definition conductor.cpp:1469
ConductorTextItem * m_text_item
Text input for non simple, non-singleline conductors.
Definition conductor.h:188
static Qt::Corner movementType(const QPointF &, const QPointF &)
Definition conductor.cpp:1956
bool m_freeze_label
Definition conductor.h:207
autonum::sequentialNumbers & rSequenceNum()
Definition conductor.h:136
QPointF posForText(Qt::Orientations &flag)
Conductor::posForText Calculate and return the better pos for text.
Definition conductor.cpp:1263
void removeHandler()
Conductor::removeHandler Remove the handlers of this item.
Definition conductor.cpp:888
void calculateTextItemPosition()
Conductor::calculateTextItemPosition Move the text at middle of conductor (if is vertical or horizont...
Definition conductor.cpp:1334
void setUpConnectionForFormula(QString old_formula, QString new_formula)
Conductor::setUpConnectionForFormula setup connection according to the variable of formula.
Definition conductor.cpp:1783
bool m_mouse_over
Definition conductor.h:184
autonum::sequentialNumbers sequenceNum() const
Definition conductor.h:134
const QList< ConductorSegment * > segmentsList() const
Definition conductor.cpp:1213
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition conductor.h:182
autonum::sequentialNumbers sequenceNum
Definition conductor.h:49
QPointF before_mov_text_pos_
Definition conductor.h:196
void saveProfile(bool=true)
Definition conductor.cpp:1430
void editProperty()
Conductor::editProperty.
Definition conductor.cpp:1766
ConductorSegment * m_moved_segment
Definition conductor.h:195
ConductorSegment * segments
Segments composing the conductor.
Definition conductor.h:190
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
Definition conductor.cpp:488
void adjusteHandlerPos()
Conductor::adjusteHandlerPos Adjust the position of the handler item.
Definition conductor.cpp:776
virtual Highlight highlight() const
Definition conductor.cpp:1634
ConductorTextItem * textItem() const
Definition conductor.cpp:588
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
Conductor::handlerMouseMoveEvent.
Definition conductor.cpp:817
QPainterPath m_path
Definition conductor.h:213
QList< QPointF > junctions() const
Definition conductor.cpp:1827
void segmentsToPath()
Conductor::segmentsToPath Generate the QPainterPath from the list of points.
Definition conductor.cpp:181
bool m_moving_segment
Attributes related to mouse interaction.
Definition conductor.h:192
void refreshText()
Conductor::refreshText Refresh the text of this conductor. recalcule and set the text according to th...
Definition conductor.cpp:1497
QList< ConductorBend > bends() const
Definition conductor.cpp:1898
static QPointF movePointIntoPolygon(const QPointF &, const QPainterPath &)
Conductor::movePointIntoPolygon.
Definition conductor.cpp:2013
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
Conductor::handlerMousePressEvent.
Definition conductor.cpp:794
static bool valideXml(QDomElement &)
Definition conductor.cpp:598
void updatePath(const QRectF &=QRectF())
Definition conductor.cpp:165
static QBrush conductor_brush
Definition conductor.h:211
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
Conductor::mousePressEvent Manage the mouse press event.
Definition conductor.cpp:646
void addHandler()
Conductor::addHandler Add handlers for this item.
Definition conductor.cpp:868
Definition conductorprofile.h:28
The ConductorProperties class This class represents the functional properties of a particular conduct...
Definition conductorproperties.h:68
Definition conductorsegment.h:25
Definition conductorsegmentprofile.h:26
Definition conductortextitem.h:30
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition numerotationcontext.h:31
Definition qetdiagrameditor.h:55
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition qetgraphicshandleritem.h:37
Orientation
Orientation (used for electrical elements and their terminals)
Definition qet.h:210
The Terminal class This class represents a terminal of an electrical element, i.e....
Definition terminal.h:36
Definition assignvariables.h:34
QPair< QPointF, Qt::Corner > ConductorBend
Definition conductor.h:36
bool isBetween(const T a, const T b, const T c)
Definition conductor.h:241
Conductor * longuestConductorInPotential(Conductor *conductor, bool all_diagram=false)
longuestConductorInPotential
Definition conductor.cpp:2081
QList< Conductor * > relatedConductors(const Conductor *conductor)
relatedConductors
Definition conductor.cpp:2098
QHash< Qt::Corner, ConductorProfile > ConductorProfilesGroup
Definition conductor.h:37
ConductorSegmentType
Known kinds of conductor segments.
Definition qet.h:84
@ Both
Invalid segment.
Definition qet.h:87
Definition assignvariables.cpp:31