QElectroTech  0.8-dev
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Properties | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Conductor Class Reference

#include <conductor.h>

Inherits QGraphicsObject.

Collaboration diagram for Conductor:
Collaboration graph

Public Types

enum  { Type = UserType + 1001 }
 
enum  Highlight { None, Normal, Alert }
 

Public Slots

void displayedTextChanged ()
 Conductor::displayedTextChanged Update the properties (text) of this conductor and other conductors at the same potential of this conductor. More...
 

Signals

void propertiesChange ()
 

Public Member Functions

 Conductor (Terminal *, Terminal *)
 Conductor::Conductor Default constructor. More...
 
 ~Conductor () override
 Conductor::~Conductor Destructor. The conductor is removed from is terminal. More...
 
bool isValid () const
 Conductor::isValid. More...
 
int type () const override
 type Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a conductor. More...
 
Diagramdiagram () const
 
ConductorTextItemtextItem () const
 
void updatePath (const QRectF &=QRectF())
 
void updatePathAnimate (const int=1)
 
int fakePath ()
 
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
 
QRectF boundingRect () const override
 Conductor::boundingRect. More...
 
QPainterPath shape () const override
 Conductor::shape. More...
 
virtual QPainterPath nearShape () const
 Conductor::nearShape. More...
 
qreal length () const
 Conductor::length. More...
 
ConductorSegmentmiddleSegment ()
 
QPointF posForText (Qt::Orientations &flag)
 Conductor::posForText Calculate and return the better pos for text. More...
 
void refreshText ()
 Conductor::refreshText Refresh the text of this conductor. recalcule and set the text according to the formula. More...
 
void setPath (const QPainterPath &path)
 
QPainterPath path () const
 
bool fromXml (QDomElement &)
 Conductor::fromXml Load the conductor and her information from xml element. More...
 
QDomElement toXml (QDomDocument &, QHash< Terminal *, int > &) const
 Conductor::toXml Exporte les caracteristiques du conducteur sous forme d'une element XML. More...
 
QVector< QPointF > handlerPoints () const
 Conductor::handlerPoints. More...
 
const QList< ConductorSegment * > segmentsList () const
 
void setPropertyToPotential (const ConductorProperties &property, bool only_text=false)
 Conductor::setPropertiesToPotential. More...
 
void setProperties (const ConductorProperties &property)
 Conductor::setProperties Set property as current property of conductor. More...
 
ConductorProperties properties () const
 Conductor::properties. More...
 
void setProfile (const ConductorProfile &, Qt::Corner)
 
ConductorProfile profile (Qt::Corner) const
 
void setProfiles (const ConductorProfilesGroup &)
 Conductor::setProfiles. More...
 
ConductorProfilesGroup profiles () const
 
void calculateTextItemPosition ()
 Conductor::calculateTextItemPosition Move the text at middle of conductor (if is vertical or horizontal) otherwise, move conductor at the middle of the longest segment of conductor. If text was moved by user, this function do nothing, except check if text is near conductor. More...
 
virtual Highlight highlight () const
 
virtual void setHighlighted (Highlight)
 
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, this conductor isn't part of the returned QSet. More...
 
QETDiagramEditordiagramEditor () const
 Conductor::diagramEditor. More...
 
void editProperty ()
 Conductor::editProperty. More...
 
autonum::sequentialNumbers sequenceNum () const
 
autonum::sequentialNumbersrSequenceNum ()
 
void setSequenceNum (const autonum::sequentialNumbers &sn)
 
void setFreezeLabel (bool freeze)
 Conductor::setFreezeLabel Freeze this conductor label if true Unfreeze this conductor label if false. More...
 

Static Public Member Functions

static bool valideXml (QDomElement &)
 

Public Attributes

Terminalterminal1
 
Terminalterminal2
 

Protected Member Functions

void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
 Conductor::mouseDoubleClickEvent Manage the mouse double click. More...
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 Conductor::mousePressEvent Manage the mouse press event. More...
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 Conductor::mouseReleaseEvent. More...
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 Conductor::hoverEnterEvent Manage the hover enter event. More...
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 Conductor::hoverLeaveEvent Manage the mouse leave event. More...
 
QVariant itemChange (GraphicsItemChange, const QVariant &) override
 Conductor::itemChange. More...
 
bool sceneEventFilter (QGraphicsItem *watched, QEvent *event) override
 Conductor::sceneEventFilter. More...
 

Properties

QPointF pos
 
int animPath
 
ConductorProperties properties
 
autonum::sequentialNumbers sequenceNum
 

Private Member Functions

 Conductor (const Conductor &)
 
bool pathFromXml (const QDomElement &)
 Conductor::pathFromXml Generate the path (of the line) from xml file by checking the segments in the xml file. More...
 
void setUpConnectionForFormula (QString old_formula, QString new_formula)
 Conductor::setUpConnectionForFormula setup connection according to the variable of formula. More...
 
void adjusteHandlerPos ()
 Conductor::adjusteHandlerPos Adjust the position of the handler item. More...
 
void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
 Conductor::handlerMousePressEvent. More...
 
void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
 Conductor::handlerMouseMoveEvent. More...
 
void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
 Conductor::handlerMouseReleaseEvent. More...
 
void addHandler ()
 Conductor::addHandler Add handlers for this item. More...
 
void removeHandler ()
 Conductor::removeHandler Remove the handlers of this item. More...
 
void segmentsToPath ()
 Conductor::segmentsToPath Generate the QPainterPath from the list of points. More...
 
void saveProfile (bool=true)
 
void generateConductorPath (const QPointF &, Qet::Orientation, const QPointF &, Qet::Orientation)
 
void updateConductorPath (const QPointF &, Qet::Orientation, const QPointF &, Qet::Orientation)
 
uint segmentsCount (QET::ConductorSegmentType=QET::Both) const
 
QList< QPointF > segmentsToPoints () const
 
QList< ConductorBendbends () const
 
QList< QPointF > junctions () const
 
void pointsToSegments (const QList< QPointF > &)
 
Qt::Corner currentPathType () const
 
void deleteSegments ()
 Supprime les segments. More...
 
QHash< ConductorSegmentProfile *, qreal > shareOffsetBetweenSegments (const qreal &offset, const QList< ConductorSegmentProfile * > &, const qreal &=0.01) const
 

Static Private Member Functions

static int getCoeff (const qreal &, const qreal &)
 
static int getSign (const qreal &)
 
static QPointF extendTerminal (const QPointF &, Qet::Orientation, qreal=9.0)
 
static Qt::Corner movementType (const QPointF &, const QPointF &)
 
static QPointF movePointIntoPolygon (const QPointF &, const QPainterPath &)
 

Private Attributes

autonum::sequentialNumbers m_autoNum_seq
 
QVector< QetGraphicsHandlerItem * > m_handler_vector
 
int m_vector_index = -1
 
bool m_mouse_over
 
ConductorProperties m_properties
 Functional properties. More...
 
ConductorTextItemm_text_item
 Text input for non simple, non-singleline conductors. More...
 
ConductorSegmentsegments
 Segments composing the conductor. More...
 
bool m_moving_segment
 Attributs related to mouse interaction. More...
 
int moved_point
 
qreal m_previous_z_value
 
ConductorSegmentm_moved_segment
 
QPointF before_mov_text_pos_
 
bool modified_path
 Whether the conductor was manually modified by users. More...
 
bool has_to_save_profile
 Whether the current profile should be saved as soon as possible. More...
 
ConductorProfilesGroup conductor_profiles
 
Highlight must_highlight_
 Define whether and how the conductor should be highlighted. More...
 
bool m_valid
 
bool m_freeze_label = false
 
QPainterPath m_path
 

Static Private Attributes

static QPen conductor_pen = QPen()
 QPen et QBrush objects used to draw conductors. More...
 
static QBrush conductor_brush = QBrush()
 
static bool pen_and_brush_initialized = false
 

Detailed Description

This class represents a conductor, i.e. a wire between two element terminals.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

◆ Highlight

Enumerator
None 
Normal 
Alert 

Constructor & Destructor Documentation

◆ Conductor() [1/2]

Conductor::Conductor ( Terminal p1,
Terminal p2 
)

Conductor::Conductor Default constructor.

Parameters
p1: first terminal of this conductor.
p2: second terminal of this conductor.
Here is the call graph for this function:

◆ ~Conductor()

Conductor::~Conductor ( )
override

Conductor::~Conductor Destructor. The conductor is removed from is terminal.

Here is the call graph for this function:

◆ Conductor() [2/2]

Conductor::Conductor ( const Conductor )
private

Member Function Documentation

◆ addHandler()

void Conductor::addHandler ( )
private

Conductor::addHandler Add handlers for this item.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ adjusteHandlerPos()

void Conductor::adjusteHandlerPos ( )
private

Conductor::adjusteHandlerPos Adjust the position of the handler item.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bends()

QList< ConductorBend > Conductor::bends ( ) const
private
Returns
la liste des bifurcations de ce conducteur ; ConductorBend est un typedef pour une QPair<QPointF, Qt::Corner>. Le point indique la position (en coordonnees locales) de la bifurcation tandis que le Corner indique le type de bifurcation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ boundingRect()

QRectF Conductor::boundingRect ( ) const
override

Conductor::boundingRect.

Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateTextItemPosition()

void Conductor::calculateTextItemPosition ( )

Conductor::calculateTextItemPosition Move the text at middle of conductor (if is vertical or horizontal) otherwise, move conductor at the middle of the longest segment of conductor. If text was moved by user, this function do nothing, except check if text is near conductor.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ currentPathType()

Qt::Corner Conductor::currentPathType ( ) const
private
Returns
le type de trajet actuel de ce conducteur
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteSegments()

void Conductor::deleteSegments ( )
private

Supprime les segments.

Here is the caller graph for this function:

◆ diagram()

Diagram * Conductor::diagram ( ) const
Returns
le Diagram auquel ce conducteur appartient, ou 0 si ce conducteur est independant
Here is the caller graph for this function:

◆ diagramEditor()

QETDiagramEditor * Conductor::diagramEditor ( ) const

Conductor::diagramEditor.

Returns
The parent diagram editor or nullptr;
Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayedTextChanged

void Conductor::displayedTextChanged ( )
slot

Conductor::displayedTextChanged Update the properties (text) of this conductor and other conductors at the same potential of this conductor.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ editProperty()

void Conductor::editProperty ( )

Conductor::editProperty.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extendTerminal()

QPointF Conductor::extendTerminal ( const QPointF &  terminal,
Qet::Orientation  terminal_orientation,
qreal  ext_size = 9.0 
)
staticprivate

Prolonge une borne.

Parameters
terminalLe point correspondant a la borne
terminal_orientationL'orientation de la borne
ext_sizela taille de la prolongation
Returns
le point correspondant a la borne apres prolongation
Here is the caller graph for this function:

◆ fakePath()

int Conductor::fakePath ( )
inline

◆ fromXml()

bool Conductor::fromXml ( QDomElement &  dom_element)

Conductor::fromXml Load the conductor and her information from xml element.

Parameters
dom_element
Returns
true is loading success else return false
Here is the call graph for this function:

◆ generateConductorPath()

void Conductor::generateConductorPath ( const QPointF &  p1,
Qet::Orientation  o1,
const QPointF &  p2,
Qet::Orientation  o2 
)
private

Calcule un trajet "par defaut" pour le conducteur

Parameters
p1Coordonnees du point d'amarrage de la borne 1
o1Orientation de la borne 1
p2Coordonnees du point d'amarrage de la borne 2
o2Orientation de la borne 2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCoeff()

int Conductor::getCoeff ( const qreal &  value1,
const qreal &  value2 
)
staticprivate
Parameters
value1Premiere valeur
value2Deuxieme valeur
Returns
1 si les deux valeurs sont de meme signe, -1 sinon
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSign()

int Conductor::getSign ( const qreal &  value)
staticprivate
Parameters
valuevaleur
Returns
1 si valeur est negatif, 1 s'il est positif ou nul
Here is the caller graph for this function:

◆ handlerMouseMoveEvent()

void Conductor::handlerMouseMoveEvent ( QetGraphicsHandlerItem qghi,
QGraphicsSceneMouseEvent *  event 
)
private

Conductor::handlerMouseMoveEvent.

Parameters
qghi
event
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handlerMousePressEvent()

void Conductor::handlerMousePressEvent ( QetGraphicsHandlerItem qghi,
QGraphicsSceneMouseEvent *  event 
)
private

Conductor::handlerMousePressEvent.

Parameters
qghi
event
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handlerMouseReleaseEvent()

void Conductor::handlerMouseReleaseEvent ( QetGraphicsHandlerItem qghi,
QGraphicsSceneMouseEvent *  event 
)
private

Conductor::handlerMouseReleaseEvent.

Parameters
qghi
event
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handlerPoints()

QVector< QPointF > Conductor::handlerPoints ( ) const

Conductor::handlerPoints.

Returns
The points used to draw the handler square, used to modify the path of the conductor. The points stored in the QVector are the middle point of each segments that compose the conductor, at exception of the first and last segment because there just here to extend the terminal.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ highlight()

Conductor::Highlight Conductor::highlight ( ) const
virtual
Returns
true si le conducteur est mis en evidence

◆ hoverEnterEvent()

void Conductor::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

Conductor::hoverEnterEvent Manage the hover enter event.

Parameters
event

◆ hoverLeaveEvent()

void Conductor::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

Conductor::hoverLeaveEvent Manage the mouse leave event.

Parameters
event

◆ isValid()

bool Conductor::isValid ( ) const

Conductor::isValid.

Returns
true if conductor is valid else false; A non valid conductor, is a conductor without two terminal
Here is the caller graph for this function:

◆ itemChange()

QVariant Conductor::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
overrideprotected

Conductor::itemChange.

Parameters
change
value
Returns
Here is the call graph for this function:

◆ junctions()

QList< QPointF > Conductor::junctions ( ) const
private
Returns
la liste des positions des jonctions avec d'autres conducteurs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ length()

qreal Conductor::length ( ) const

Conductor::length.

Returns
the length of this conductor
Here is the call graph for this function:
Here is the caller graph for this function:

◆ middleSegment()

ConductorSegment * Conductor::middleSegment ( )
Returns
Le segment qui contient le point au milieu du conducteur
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseDoubleClickEvent()

void Conductor::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Conductor::mouseDoubleClickEvent Manage the mouse double click.

Parameters
event
Here is the call graph for this function:

◆ mousePressEvent()

void Conductor::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Conductor::mousePressEvent Manage the mouse press event.

Parameters
event

◆ mouseReleaseEvent()

void Conductor::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Conductor::mouseReleaseEvent.

Parameters
event

◆ movementType()

Qt::Corner Conductor::movementType ( const QPointF &  start,
const QPointF &  end 
)
staticprivate
Parameters
startPoint de depart
endPoint d'arrivee
Returns
le coin vers lequel se dirige le trajet de start vers end
Here is the caller graph for this function:

◆ movePointIntoPolygon()

QPointF Conductor::movePointIntoPolygon ( const QPointF &  point,
const QPainterPath &  polygon 
)
staticprivate
Parameters
pointUn point situe a l'exterieur du polygone
polygonLe polygone dans lequel on veut rapatrier le point
Returns
la position du point, une fois ramene dans le polygone, ou plus exactement sur le bord du polygone
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearShape()

QPainterPath Conductor::nearShape ( ) const
virtual

Conductor::nearShape.

Returns
: An area in which it is considered a point is near this conductor.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ paint()

void Conductor::paint ( QPainter *  qp,
const QStyleOptionGraphicsItem *  options,
QWidget *  qw 
)
override

Dessine le conducteur sans antialiasing.

Parameters
qpLe QPainter a utiliser pour dessiner le conducteur
optionsLes options de style pour le conducteur
qwLe QWidget sur lequel on dessine
Here is the call graph for this function:

◆ path()

QPainterPath Conductor::path ( ) const
Here is the caller graph for this function:

◆ pathFromXml()

bool Conductor::pathFromXml ( const QDomElement &  e)
private

Conductor::pathFromXml Generate the path (of the line) from xml file by checking the segments in the xml file.

Parameters
e
Returns
true if generate path success else return false
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pointsToSegments()

void Conductor::pointsToSegments ( const QList< QPointF > &  points_list)
private

Regenere les segments de ce conducteur a partir de la liste de points passee en parametre

Parameters
points_listListe de points a utiliser pour generer les segments
Here is the call graph for this function:
Here is the caller graph for this function:

◆ posForText()

QPointF Conductor::posForText ( Qt::Orientations &  flag)

Conductor::posForText Calculate and return the better pos for text.

Parameters
flag: flag is used to know if text pos is near of a vertical or horizontal conductor segment.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ profile()

ConductorProfile Conductor::profile ( Qt::Corner  path_type) const
Returns
le profil de ce conducteur

◆ profiles()

ConductorProfilesGroup Conductor::profiles ( ) const
Returns
les profils de ce conducteur

◆ properties()

ConductorProperties Conductor::properties ( ) const

Conductor::properties.

Returns
the properties of this Conductor

◆ propertiesChange

void Conductor::propertiesChange ( )
signal
Here is the caller graph for this function:

◆ refreshText()

void Conductor::refreshText ( )

Conductor::refreshText Refresh the text of this conductor. recalcule and set the text according to the formula.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ relatedPotentialConductors()

QSet< Conductor * > Conductor::relatedPotentialConductors ( const bool  all_diagram = true,
QList< Terminal * > *  t_list = nullptr 
)

Conductor::relatedPotentialConductors Return all conductors at the same potential of this conductor, this conductor isn't part of the returned QSet.

Parameters
all_diagram: if true search in all diagram of the project, false search only in the parent diagram of this conductor
t_list: a list of terminal already found for this potential.
Returns
a QSet of conductor at the same potential.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeHandler()

void Conductor::removeHandler ( )
private

Conductor::removeHandler Remove the handlers of this item.

Here is the caller graph for this function:

◆ rSequenceNum()

autonum::sequentialNumbers& Conductor::rSequenceNum ( )
inline
Here is the caller graph for this function:

◆ saveProfile()

void Conductor::saveProfile ( bool  undo = true)
private

Sauvegarde le profil courant du conducteur pour l'utiliser ulterieurement dans priv_modifieConductor.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sceneEventFilter()

bool Conductor::sceneEventFilter ( QGraphicsItem *  watched,
QEvent *  event 
)
overrideprotected

Conductor::sceneEventFilter.

Parameters
watched
event
Returns
Here is the call graph for this function:

◆ segmentsCount()

uint Conductor::segmentsCount ( QET::ConductorSegmentType  type = QET::Both) const
private
Parameters
typeType de Segments
Returns
Le nombre de segments composant le conducteur.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ segmentsList()

const QList< ConductorSegment * > Conductor::segmentsList ( ) const
Returns
les segments de ce conducteur
Here is the caller graph for this function:

◆ segmentsToPath()

void Conductor::segmentsToPath ( )
private

Conductor::segmentsToPath Generate the QPainterPath from the list of points.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ segmentsToPoints()

QList< QPointF > Conductor::segmentsToPoints ( ) const
private

Genere une liste de points a partir des segments de ce conducteur

Returns
La liste de points representant ce conducteur
Here is the caller graph for this function:

◆ sequenceNum()

autonum::sequentialNumbers Conductor::sequenceNum ( ) const
inline

◆ setFreezeLabel()

void Conductor::setFreezeLabel ( bool  freeze)

Conductor::setFreezeLabel Freeze this conductor label if true Unfreeze this conductor label if false.

Parameters
freeze
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHighlighted()

void Conductor::setHighlighted ( Conductor::Highlight  hl)
virtual
Parameters
hltrue pour mettre le conducteur en evidence, false sinon

◆ setPath()

void Conductor::setPath ( const QPainterPath &  path)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setProfile()

void Conductor::setProfile ( const ConductorProfile cp,
Qt::Corner  path_type 
)

Applique un nouveau profil a ce conducteur

Parameters
cpProfil a appliquer a ce conducteur
path_typeType de trajet pour lequel ce profil convient
Here is the call graph for this function:

◆ setProfiles()

void Conductor::setProfiles ( const ConductorProfilesGroup cpg)

Conductor::setProfiles.

Parameters
cpg: the new profils of conductor
Here is the call graph for this function:

◆ setProperties()

void Conductor::setProperties ( const ConductorProperties property)

Conductor::setProperties Set property as current property of conductor.

Parameters
property: properties
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPropertyToPotential()

void Conductor::setPropertyToPotential ( const ConductorProperties property,
bool  only_text = false 
)

Conductor::setPropertiesToPotential.

Parameters
property
only_textSet propertie to conductor and every conductors in the same potential of conductor. If only_text is true only formula, text, function and tension/protocol is set to other conductor in the same potential, the other values of property stay unmodified
Here is the call graph for this function:

◆ setSequenceNum()

void Conductor::setSequenceNum ( const autonum::sequentialNumbers sn)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpConnectionForFormula()

void Conductor::setUpConnectionForFormula ( QString  old_formula,
QString  new_formula 
)
private

Conductor::setUpConnectionForFormula setup connection according to the variable of formula.

Parameters
old_formula
new_formula
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shape()

QPainterPath Conductor::shape ( ) const
override

Conductor::shape.

Returns
the shape of conductor. The shape thickness is bigger when conductor is hovered
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shareOffsetBetweenSegments()

QHash< ConductorSegmentProfile *, qreal > Conductor::shareOffsetBetweenSegments ( const qreal &  offset,
const QList< ConductorSegmentProfile * > &  segments_list,
const qreal &  precision = 0.01 
) const
private
Parameters
offsetLongueur a repartir entre les segments
segments_listSegments sur lesquels il faut repartir la longueur
precisionseuil en-deca duquel on considere qu'il ne reste rien a repartir
Here is the call graph for this function:
Here is the caller graph for this function:

◆ textItem()

ConductorTextItem * Conductor::textItem ( ) const

4

Returns
le champ de texte associe a ce conducteur
Here is the caller graph for this function:

◆ toXml()

QDomElement Conductor::toXml ( QDomDocument &  dom_document,
QHash< Terminal *, int > &  table_adr_id 
) const

Conductor::toXml Exporte les caracteristiques du conducteur sous forme d'une element XML.

Parameters
dom_document: Le document XML a utiliser pour creer l'element XML
table_adr_id: Hash stockant les correspondances entre les ids des bornes dans le document XML et leur adresse en memoire
Returns
Un element XML representant le conducteur
Here is the call graph for this function:

◆ type()

int Conductor::type ( ) const
inlineoverride

type Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a conductor.

Returns
the QGraphicsItem type
Here is the caller graph for this function:

◆ updateConductorPath()

void Conductor::updateConductorPath ( const QPointF &  p1,
Qet::Orientation  o1,
const QPointF &  p2,
Qet::Orientation  o2 
)
private

Gere les updates

Parameters
p1Coordonnees du point d'amarrage de la borne 1
o1Orientation de la borne 1
p2Coordonnees du point d'amarrage de la borne 2
o2Orientation de la borne 2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatePath()

void Conductor::updatePath ( const QRectF &  rect = QRectF())

Met a jour la representation graphique du conducteur en recalculant son trace. Cette fonction est typiquement appelee lorsqu'une seule des bornes du conducteur a change de position.

Parameters
rectRectangle a mettre a jour
See also
QGraphicsPathItem::update()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatePathAnimate()

void Conductor::updatePathAnimate ( const int  = 1)
inline
Here is the call graph for this function:

◆ valideXml()

bool Conductor::valideXml ( QDomElement &  e)
static

Methode de validation d'element XML

Parameters
eUn element XML sense represente un Conducteur
Returns
true si l'element XML represente bien un Conducteur ; false sinon
Here is the caller graph for this function:

Member Data Documentation

◆ before_mov_text_pos_

QPointF Conductor::before_mov_text_pos_
private

◆ conductor_brush

QBrush Conductor::conductor_brush = QBrush()
staticprivate

◆ conductor_pen

QPen Conductor::conductor_pen = QPen()
staticprivate

QPen et QBrush objects used to draw conductors.

◆ conductor_profiles

ConductorProfilesGroup Conductor::conductor_profiles
private

conductor profile: "photography" of what the conductor is supposed to look like - there is one profile per kind of traject

◆ has_to_save_profile

bool Conductor::has_to_save_profile
private

Whether the current profile should be saved as soon as possible.

◆ m_autoNum_seq

autonum::sequentialNumbers Conductor::m_autoNum_seq
private

◆ m_freeze_label

bool Conductor::m_freeze_label = false
private

◆ m_handler_vector

QVector<QetGraphicsHandlerItem *> Conductor::m_handler_vector
private

◆ m_mouse_over

bool Conductor::m_mouse_over
private

◆ m_moved_segment

ConductorSegment* Conductor::m_moved_segment
private

◆ m_moving_segment

bool Conductor::m_moving_segment
private

Attributs related to mouse interaction.

◆ m_path

QPainterPath Conductor::m_path
private

◆ m_previous_z_value

qreal Conductor::m_previous_z_value
private

◆ m_properties

ConductorProperties Conductor::m_properties
private

Functional properties.

◆ m_text_item

ConductorTextItem* Conductor::m_text_item
private

Text input for non simple, non-singleline conductors.

◆ m_valid

bool Conductor::m_valid
private

◆ m_vector_index

int Conductor::m_vector_index = -1
private

◆ modified_path

bool Conductor::modified_path
private

Whether the conductor was manually modified by users.

◆ moved_point

int Conductor::moved_point
private

◆ must_highlight_

Highlight Conductor::must_highlight_
private

Define whether and how the conductor should be highlighted.

◆ pen_and_brush_initialized

bool Conductor::pen_and_brush_initialized = false
staticprivate

◆ segments

ConductorSegment* Conductor::segments
private

Segments composing the conductor.

◆ terminal1

Terminal* Conductor::terminal1

◆ terminal2

Terminal* Conductor::terminal2

Property Documentation

◆ animPath

int Conductor::animPath
readwrite

◆ pos

QPointF Conductor::pos
readwrite

◆ properties

ConductorProperties Conductor::properties
readwrite

◆ sequenceNum

autonum::sequentialNumbers Conductor::sequenceNum
readwrite

The documentation for this class was generated from the following files: