QElectroTech
0.70
|
#include <conductor.h>
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 |
Diagram * | diagram () const |
ConductorTextItem * | textItem () 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... | |
ConductorSegment * | middleSegment () |
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 |
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) |
ConductorProperties | properties () const |
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... | |
QETDiagramEditor * | diagramEditor () const |
Conductor::diagramEditor. More... | |
void | editProperty () |
Conductor::editProperty. More... | |
autonum::sequentialNumbers | sequenceNum () const |
autonum::sequentialNumbers & | rSequenceNum () |
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 | |
Terminal * | terminal1 |
Terminal * | terminal2 |
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 |
Conductor::properties. More... | |
autonum::sequentialNumbers | sequenceNum |
Private Member Functions | |
Conductor (const Conductor &) | |
bool | pathFromXml (const QDomElement &) |
Conductor::pathFromXml Generate the path from 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< ConductorBend > | bends () 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... | |
ConductorTextItem * | m_text_item |
Text input for non simple, non-singleline conductors. More... | |
ConductorSegment * | segments |
Segments composing the conductor. More... | |
bool | m_moving_segment |
Attributs related to mouse interaction. More... | |
int | moved_point |
qreal | m_previous_z_value |
ConductorSegment * | m_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 |
This class represents a conductor, i.e. a wire between two element terminals.
Definition at line 42 of file conductor.h.
anonymous enum |
Enumerator | |
---|---|
Type |
Definition at line 64 of file conductor.h.
enum Conductor::Highlight |
Enumerator | |
---|---|
None | |
Normal | |
Alert |
Definition at line 65 of file conductor.h.
Conductor::Conductor Default constructor.
p1 | : first terminal of this conductor. |
p2 | : second terminal of this conductor. |
Definition at line 75 of file conductor.cpp.
References conductor_brush, conductor_pen, conductor_profiles, Diagram::defaultConductorProperties, Terminal::diagram(), displayedTextChanged(), generateConductorPath(), m_previous_z_value, m_properties, m_text_item, m_valid, pen_and_brush_initialized, setProperties(), terminal1, terminal2, ConductorProperties::text, and DiagramTextItem::textEdited().
|
override |
Conductor::~Conductor Destructor. The conductor is removed from is terminal.
Definition at line 135 of file conductor.cpp.
References deleteSegments(), Terminal::removeConductor(), removeHandler(), terminal1, and terminal2.
|
private |
|
private |
Conductor::addHandler Add handlers for this item.
Definition at line 829 of file conductor.cpp.
References QetGraphicsHandlerItem::handlerForPoint(), handlerPoints(), and m_handler_vector.
Referenced by handlerMouseReleaseEvent(), itemChange(), and segmentsToPath().
|
private |
Conductor::adjusteHandlerPos Adjust the position of the handler item.
Definition at line 737 of file conductor.cpp.
References handlerPoints(), and m_handler_vector.
Referenced by itemChange(), and segmentsToPath().
|
private |
Definition at line 1794 of file conductor.cpp.
References length(), segments, QET::Icons::sl, and type().
Referenced by junctions().
|
override |
Definition at line 862 of file conductor.cpp.
References QET::Icons::br, and shape().
Referenced by calculateTextItemPosition(), and ConductorTextItem::setPos().
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.
Definition at line 1253 of file conductor.cpp.
References boundingRect(), diagram(), ConductorProperties::horiz_rotate_text, QET::Horizontal, longuestConductorInPotential(), ConductorProperties::m_horizontal_alignment, m_properties, m_text_item, ConductorProperties::m_vertical_alignment, movePointIntoPolygon(), ConductorProperties::Multi, nearShape(), QET::Icons::Orientations, pos, posForText(), relatedPotentialConductors(), textItem(), ConductorProperties::type, ConductorProperties::verti_rotate_text, and QET::Vertical.
Referenced by Diagram::addItem(), handlerMouseMoveEvent(), itemChange(), setProfile(), setProfiles(), setProperties(), and updatePath().
|
private |
Definition at line 1862 of file conductor.cpp.
References movementType(), terminal1, and terminal2.
Referenced by saveProfile(), setProfile(), setProfiles(), updateConductorPath(), and updatePath().
|
private |
Supprime les segments.
Definition at line 1890 of file conductor.cpp.
References segments.
Referenced by pointsToSegments(), and ~Conductor().
Diagram * Conductor::diagram | ( | ) | const |
Definition at line 557 of file conductor.cpp.
Referenced by calculateTextItemPosition(), diagramEditor(), displayedTextChanged(), PotentialSelectorDialog::on_buttonBox_accepted(), paint(), ConductorPropertiesDialog::PropertiesDialog(), refreshText(), saveProfile(), DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements(), setProperties(), and setUpConnectionForFormula().
QETDiagramEditor * Conductor::diagramEditor | ( | ) | const |
Definition at line 1654 of file conductor.cpp.
References diagram().
Referenced by editProperty(), and ConductorAutoNumerotation::numeratePotential().
|
slot |
Conductor::displayedTextChanged Update the properties (text) of this conductor and other conductors at the same potential of this conductor.
Definition at line 1562 of file conductor.cpp.
References diagram(), ConductorProperties::m_formula, m_properties, m_text_item, properties, relatedPotentialConductors(), ConductorProperties::text, QET::Icons::tr, and Diagram::undoStack().
Referenced by Conductor().
void Conductor::editProperty | ( | ) |
Definition at line 1668 of file conductor.cpp.
References diagramEditor(), and ConductorPropertiesDialog::PropertiesDialog().
Referenced by mouseDoubleClickEvent(), and sceneEventFilter().
|
staticprivate |
Prolonge une borne.
terminal | Le point correspondant a la borne |
terminal_orientation | L'orientation de la borne |
ext_size | la taille de la prolongation |
Definition at line 447 of file conductor.cpp.
References Qet::East, Qet::North, Qet::South, and Qet::West.
Referenced by generateConductorPath().
|
inline |
Definition at line 83 of file conductor.h.
bool Conductor::fromXml | ( | QDomElement & | dom_element | ) |
Conductor::fromXml Load the conductor and her information from xml element.
e |
Definition at line 960 of file conductor.cpp.
References autonum::sequentialNumbers::fromXml(), ConductorProperties::fromXml(), ConductorXmlRetroCompatibility::loadSequential(), m_autoNum_seq, m_freeze_label, m_text_item, pathFromXml(), and setProperties().
|
private |
Calcule un trajet "par defaut" pour le conducteur
p1 | Coordonnees du point d'amarrage de la borne 1 |
o1 | Orientation de la borne 1 |
p2 | Coordonnees du point d'amarrage de la borne 2 |
o2 | Orientation de la borne 2 |
Definition at line 344 of file conductor.cpp.
References Qet::East, extendTerminal(), Qet::North, pointsToSegments(), segmentsToPath(), Qet::South, Qet::West, Diagram::xGrid, and Diagram::yGrid.
Referenced by Conductor(), pathFromXml(), setProfile(), setProfiles(), and updatePath().
|
staticprivate |
value1 | Premiere valeur |
value2 | Deuxieme valeur |
Definition at line 1371 of file conductor.cpp.
References getSign().
Referenced by updateConductorPath().
|
staticprivate |
value | valeur |
Definition at line 1379 of file conductor.cpp.
Referenced by getCoeff(), shareOffsetBetweenSegments(), and updateConductorPath().
|
private |
Conductor::handlerMouseMoveEvent.
qghi | |
event |
Definition at line 778 of file conductor.cpp.
References calculateTextItemPosition(), has_to_save_profile, m_moved_segment, m_moving_segment, ConductorSegment::middle(), modified_path, segmentsToPath(), and Diagram::snapToGrid().
Referenced by sceneEventFilter().
|
private |
Conductor::handlerMousePressEvent.
qghi | |
event |
Definition at line 755 of file conductor.cpp.
References before_mov_text_pos_, m_handler_vector, m_moved_segment, m_moving_segment, m_text_item, m_vector_index, pos, segmentsList(), and QetGraphicsHandlerItem::setColor().
Referenced by sceneEventFilter().
|
private |
Conductor::handlerMouseReleaseEvent.
qghi | |
event |
Definition at line 806 of file conductor.cpp.
References addHandler(), has_to_save_profile, m_moving_segment, m_vector_index, removeHandler(), and saveProfile().
Referenced by sceneEventFilter().
QVector< QPointF > Conductor::handlerPoints | ( | ) | const |
Definition at line 1116 of file conductor.cpp.
References ConductorSegment::middle(), segmentsList(), and QET::Icons::sl.
Referenced by addHandler(), adjusteHandlerPos(), and segmentsToPath().
|
virtual |
Definition at line 1545 of file conductor.cpp.
References must_highlight_.
|
overrideprotected |
Conductor::hoverEnterEvent Manage the hover enter event.
event |
Definition at line 630 of file conductor.cpp.
References m_mouse_over.
|
overrideprotected |
Conductor::hoverLeaveEvent Manage the mouse leave event.
event |
Definition at line 641 of file conductor.cpp.
References m_mouse_over.
bool Conductor::isValid | ( | ) | const |
Definition at line 148 of file conductor.cpp.
References m_valid.
Referenced by Diagram::fromXml().
|
overrideprotected |
change | |
value |
Definition at line 653 of file conductor.cpp.
References addHandler(), adjusteHandlerPos(), calculateTextItemPosition(), m_previous_z_value, and removeHandler().
|
private |
Definition at line 1724 of file conductor.cpp.
References bends(), isContained(), relatedConductors(), segmentsList(), and segmentsToPoints().
Referenced by paint().
qreal Conductor::length | ( | ) | const |
Definition at line 1152 of file conductor.cpp.
References path().
Referenced by bends(), longuestConductorInPotential(), middleSegment(), movePointIntoPolygon(), posForText(), shareOffsetBetweenSegments(), and toXml().
ConductorSegment * Conductor::middleSegment | ( | ) |
Definition at line 1159 of file conductor.cpp.
References length(), and segments.
Referenced by paint().
|
overrideprotected |
Conductor::mouseDoubleClickEvent Manage the mouse double click.
event |
Definition at line 597 of file conductor.cpp.
References editProperty().
|
overrideprotected |
Conductor::mousePressEvent Manage the mouse press event.
event |
Definition at line 607 of file conductor.cpp.
|
overrideprotected |
|
staticprivate |
start | Point de depart |
end | Point d'arrivee |
Definition at line 1851 of file conductor.cpp.
Referenced by currentPathType().
|
staticprivate |
point | Un point situe a l'exterieur du polygone |
polygon | Le polygone dans lequel on veut rapatrier le point |
Definition at line 1904 of file conductor.cpp.
References length(), and QET::orthogonalProjection().
Referenced by calculateTextItemPosition().
|
virtual |
Definition at line 888 of file conductor.cpp.
References conductor_pen, and path().
Referenced by calculateTextItemPosition(), and ConductorTextItem::mouseMoveEvent().
|
override |
Dessine le conducteur sans antialiasing.
qp | Le QPainter a utiliser pour dessiner le conducteur |
options | Les options de style pour le conducteur |
qw | Le QWidget sur lequel on dessine |
Definition at line 473 of file conductor.cpp.
References Alert, ConductorProperties::color, ConductorProperties::cond_size, conductor_brush, conductor_pen, diagram(), SingleLineProperties::draw(), QET::Horizontal, junctions(), ConductorProperties::m_bicolor, ConductorProperties::m_color_2, ConductorProperties::m_dash_size, m_mouse_over, m_properties, middleSegment(), must_highlight_, Normal, path(), ConductorProperties::Single, ConductorProperties::singleLineProperties, ConductorProperties::style, ConductorProperties::type, and QET::Vertical.
QPainterPath Conductor::path | ( | ) | const |
Definition at line 1454 of file conductor.cpp.
References m_path.
Referenced by length(), nearShape(), paint(), segmentsToPath(), setPath(), and shape().
|
private |
Conductor::pathFromXml Generate the path from xml file.
e |
Definition at line 1038 of file conductor.cpp.
References generateConductorPath(), modified_path, pointsToSegments(), saveProfile(), segmentsToPath(), terminal1, and terminal2.
Referenced by fromXml().
|
private |
Regenere les segments de ce conducteur a partir de la liste de points passee en parametre
points_list | Liste de points a utiliser pour generer les segments |
Definition at line 942 of file conductor.cpp.
References deleteSegments(), and segments.
Referenced by generateConductorPath(), pathFromXml(), and updateConductorPath().
QPointF Conductor::posForText | ( | Qt::Orientations & | flag | ) |
Conductor::posForText Calculate and return the better pos for text.
flag | : flag is used to know if text pos is near of a vertical or horizontal conductor segment. |
Definition at line 1182 of file conductor.cpp.
References QET::Horizontal, ConductorSegment::isFirstSegment(), ConductorSegment::isHorizontal(), ConductorSegment::length(), length(), ConductorSegment::middle(), ConductorSegment::previousSegment(), segments, and QET::Vertical.
Referenced by calculateTextItemPosition().
ConductorProfile Conductor::profile | ( | Qt::Corner | path_type | ) | const |
Definition at line 1406 of file conductor.cpp.
References conductor_profiles.
ConductorProfilesGroup Conductor::profiles | ( | ) | const |
Definition at line 1867 of file conductor.cpp.
References conductor_profiles.
ConductorProperties Conductor::properties | ( | ) | const |
Referenced by setProfiles().
|
signal |
void Conductor::refreshText | ( | ) |
Conductor::refreshText Refresh the text of this conductor. recalcule and set the text according to the formula.
Definition at line 1415 of file conductor.cpp.
References diagram(), autonum::AssignVariables::formulaToLabel(), m_autoNum_seq, ConductorProperties::m_formula, m_freeze_label, m_properties, m_text_item, DiagramTextItem::setPlainText(), and ConductorProperties::text.
Referenced by setSequenceNum(), and setUpConnectionForFormula().
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.
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. |
Definition at line 1603 of file conductor.cpp.
References Terminal::conductors(), relatedPotentialTerminal(), terminal1, and terminal2.
Referenced by calculateTextItemPosition(), displayedTextChanged(), ConductorCreator::existingPotential(), NewConductorPotentialSelector::getPotential(), longuestConductorInPotential(), Terminal::mouseReleaseEvent(), PotentialSelectorDialog::on_buttonBox_accepted(), DiagramContent::operator+=(), ConductorPropertiesDialog::PropertiesDialog(), and setPropertyToPotential().
|
private |
Conductor::removeHandler Remove the handlers of this item.
Definition at line 849 of file conductor.cpp.
References m_handler_vector.
Referenced by handlerMouseReleaseEvent(), itemChange(), segmentsToPath(), and ~Conductor().
|
inline |
Definition at line 123 of file conductor.h.
References m_autoNum_seq.
Referenced by ConductorXmlRetroCompatibility::loadSequential(), ConductorAutoNumerotation::numerateNewConductor(), and ConductorAutoNumerotation::numeratePotential().
|
private |
Sauvegarde le profil courant du conducteur pour l'utiliser ulterieurement dans priv_modifieConductor.
Definition at line 1349 of file conductor.cpp.
References before_mov_text_pos_, conductor_profiles, currentPathType(), diagram(), m_text_item, and pos.
Referenced by handlerMouseReleaseEvent(), and pathFromXml().
|
overrideprotected |
watched | |
event |
Definition at line 694 of file conductor.cpp.
References editProperty(), handlerMouseMoveEvent(), handlerMousePressEvent(), handlerMouseReleaseEvent(), m_handler_vector, m_vector_index, and QetGraphicsHandlerItem::Type.
|
private |
type | Type de Segments |
Definition at line 900 of file conductor.cpp.
References QET::Both, segmentsList(), and type().
Referenced by updatePath().
const QList< ConductorSegment * > Conductor::segmentsList | ( | ) | const |
Definition at line 1134 of file conductor.cpp.
References segments.
Referenced by handlerMousePressEvent(), handlerPoints(), junctions(), segmentsCount(), and toXml().
|
private |
Conductor::segmentsToPath Generate the QPainterPath from the list of points.
Definition at line 175 of file conductor.cpp.
References addHandler(), adjusteHandlerPos(), handlerPoints(), m_handler_vector, m_moving_segment, path(), removeHandler(), segments, and setPath().
Referenced by generateConductorPath(), handlerMouseMoveEvent(), pathFromXml(), and updateConductorPath().
|
private |
Genere une liste de points a partir des segments de ce conducteur
Definition at line 914 of file conductor.cpp.
References segments.
Referenced by junctions().
|
inline |
Definition at line 122 of file conductor.h.
References m_autoNum_seq.
void Conductor::setFreezeLabel | ( | bool | freeze | ) |
Conductor::setFreezeLabel Freeze this conductor label if true Unfreeze this conductor label if false.
freeze |
Definition at line 1985 of file conductor.cpp.
References ConductorProperties::m_formula, m_freeze_label, m_properties, and setUpConnectionForFormula().
Referenced by Diagram::freezeConductors(), and MultiPasteDialog::on_m_button_box_accepted().
|
virtual |
hl | true pour mettre le conducteur en evidence, false sinon |
Definition at line 1552 of file conductor.cpp.
References must_highlight_.
void Conductor::setPath | ( | const QPainterPath & | path | ) |
Definition at line 1444 of file conductor.cpp.
References m_path, and path().
Referenced by segmentsToPath().
void Conductor::setProfile | ( | const ConductorProfile & | cp, |
Qt::Corner | path_type | ||
) |
Applique un nouveau profil a ce conducteur
cp | Profil a appliquer a ce conducteur |
path_type | Type de trajet pour lequel ce profil convient |
Definition at line 1388 of file conductor.cpp.
References calculateTextItemPosition(), conductor_profiles, currentPathType(), generateConductorPath(), modified_path, ConductorProperties::Multi, terminal1, terminal2, type(), and updateConductorPath().
void Conductor::setProfiles | ( | const ConductorProfilesGroup & | cpg | ) |
cpg | : the new profils of conductor |
Definition at line 1875 of file conductor.cpp.
References calculateTextItemPosition(), conductor_profiles, currentPathType(), generateConductorPath(), modified_path, ConductorProperties::Multi, properties(), terminal1, terminal2, type(), and updateConductorPath().
void Conductor::setProperties | ( | const ConductorProperties & | property | ) |
Definition at line 1495 of file conductor.cpp.
References calculateTextItemPosition(), diagram(), DiagramTextItem::font, autonum::AssignVariables::formulaToLabel(), m_autoNum_seq, ConductorProperties::m_formula, m_properties, ConductorProperties::m_show_text, m_text_item, ConductorProperties::Multi, propertiesChange(), DiagramTextItem::setFont(), DiagramTextItem::setPlainText(), setUpConnectionForFormula(), ConductorProperties::text, ConductorProperties::text_size, and ConductorProperties::type.
Referenced by Conductor(), ConductorCreator::ConductorCreator(), fromXml(), ConductorAutoNumerotation::numerateNewConductor(), ConductorAutoNumerotation::numeratePotential(), DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements(), and setPropertyToPotential().
void Conductor::setPropertyToPotential | ( | const ConductorProperties & | property, |
bool | only_text = false |
||
) |
Conductor::setPropertiesToPotential.
properties | |
only_text | Set to conductor and every conductors in the same potential of . If 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 |
Definition at line 1467 of file conductor.cpp.
References ConductorProperties::m_formula, ConductorProperties::m_function, m_properties, ConductorProperties::m_tension_protocol, properties, relatedPotentialConductors(), setProperties(), and ConductorProperties::text.
void Conductor::setSequenceNum | ( | const autonum::sequentialNumbers & | sn | ) |
Definition at line 1672 of file conductor.cpp.
References m_autoNum_seq, and refreshText().
Referenced by ConductorCreator::ConductorCreator().
|
private |
Conductor::setUpConnectionForFormula setup connection according to the variable of formula.
old_formula | |
new_formula |
Definition at line 1684 of file conductor.cpp.
References diagram(), m_freeze_label, Diagram::project(), QETProject::projectDiagramsOrderChanged(), and refreshText().
Referenced by setFreezeLabel(), and setProperties().
|
override |
Definition at line 873 of file conductor.cpp.
References conductor_pen, m_mouse_over, and path().
Referenced by boundingRect().
|
private |
offset | Longueur a repartir entre les segments |
segments_list | Segments sur lesquels il faut repartir la longueur |
precision | seuil en-deca duquel on considere qu'il ne reste rien a repartir |
Definition at line 285 of file conductor.cpp.
References getSign(), and length().
Referenced by updateConductorPath().
ConductorTextItem * Conductor::textItem | ( | ) | const |
4
Definition at line 564 of file conductor.cpp.
References m_text_item.
Referenced by calculateTextItemPosition().
QDomElement Conductor::toXml | ( | QDomDocument & | dom_document, |
QHash< Terminal *, int > & | table_adr_id | ||
) | const |
Exporte les caracteristiques du conducteur sous forme d'une element XML.
d | 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 |
Definition at line 991 of file conductor.cpp.
References length(), m_autoNum_seq, m_freeze_label, m_properties, m_text_item, modified_path, pos, segmentsList(), terminal1, terminal2, autonum::sequentialNumbers::toXml(), ConductorTextItem::wasMovedByUser(), and ConductorTextItem::wasRotateByUser().
|
inlineoverride |
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a conductor.
Definition at line 75 of file conductor.h.
References Type.
Referenced by bends(), ConductorAutoNumerotation::numerate(), segmentsCount(), setProfile(), and setProfiles().
|
private |
Gere les updates
p1 | Coordonnees du point d'amarrage de la borne 1 |
o1 | Orientation de la borne 1 |
p2 | Coordonnees du point d'amarrage de la borne 2 |
o2 | Orientation de la borne 2 |
Definition at line 216 of file conductor.cpp.
References QET::Both, conductor_profiles, currentPathType(), getCoeff(), getSign(), ConductorProfile::height(), ConductorProfile::horizontalSegments(), ConductorProfile::isNull(), pointsToSegments(), ConductorProfile::segments, ConductorProfile::segmentsCount(), segmentsToPath(), shareOffsetBetweenSegments(), ConductorProfile::verticalSegments(), and ConductorProfile::width().
Referenced by setProfile(), setProfiles(), and 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.
rect | Rectangle a mettre a jour |
Definition at line 159 of file conductor.cpp.
References calculateTextItemPosition(), conductor_profiles, currentPathType(), generateConductorPath(), segmentsCount(), terminal1, terminal2, and updateConductorPath().
Referenced by Terminal::updateConductor(), and updatePathAnimate().
|
inline |
Definition at line 82 of file conductor.h.
References updatePath().
|
static |
Methode de validation d'element XML
e | Un element XML sense represente un Conducteur |
Definition at line 573 of file conductor.cpp.
Referenced by Diagram::fromXml().
|
private |
Definition at line 169 of file conductor.h.
Referenced by handlerMousePressEvent(), and saveProfile().
|
staticprivate |
Definition at line 184 of file conductor.h.
Referenced by Conductor(), and paint().
|
staticprivate |
QPen et QBrush objects used to draw conductors.
Definition at line 183 of file conductor.h.
Referenced by Conductor(), nearShape(), paint(), and shape().
|
private |
conductor profile: "photography" of what the conductor is supposed to look like - there is one profile per kind of traject
Definition at line 176 of file conductor.h.
Referenced by Conductor(), profile(), profiles(), saveProfile(), setProfile(), setProfiles(), updateConductorPath(), and updatePath().
|
private |
Whether the current profile should be saved as soon as possible.
Definition at line 173 of file conductor.h.
Referenced by handlerMouseMoveEvent(), and handlerMouseReleaseEvent().
|
private |
Definition at line 128 of file conductor.h.
Referenced by fromXml(), refreshText(), rSequenceNum(), sequenceNum(), setProperties(), setSequenceNum(), and toXml().
|
private |
Definition at line 180 of file conductor.h.
Referenced by fromXml(), refreshText(), setFreezeLabel(), setUpConnectionForFormula(), and toXml().
|
private |
Definition at line 155 of file conductor.h.
Referenced by addHandler(), adjusteHandlerPos(), handlerMousePressEvent(), removeHandler(), sceneEventFilter(), and segmentsToPath().
|
private |
Definition at line 157 of file conductor.h.
Referenced by hoverEnterEvent(), hoverLeaveEvent(), paint(), and shape().
|
private |
Definition at line 168 of file conductor.h.
Referenced by handlerMouseMoveEvent(), and handlerMousePressEvent().
|
private |
Attributs related to mouse interaction.
Definition at line 165 of file conductor.h.
Referenced by handlerMouseMoveEvent(), handlerMousePressEvent(), handlerMouseReleaseEvent(), and segmentsToPath().
|
private |
Definition at line 186 of file conductor.h.
|
private |
Definition at line 167 of file conductor.h.
Referenced by Conductor(), and itemChange().
|
private |
Functional properties.
Definition at line 159 of file conductor.h.
Referenced by calculateTextItemPosition(), Conductor(), displayedTextChanged(), paint(), refreshText(), setFreezeLabel(), setProperties(), setPropertyToPotential(), and toXml().
|
private |
Text input for non simple, non-singleline conductors.
Definition at line 161 of file conductor.h.
Referenced by calculateTextItemPosition(), Conductor(), displayedTextChanged(), fromXml(), handlerMousePressEvent(), refreshText(), saveProfile(), setProperties(), textItem(), and toXml().
|
private |
Definition at line 179 of file conductor.h.
Referenced by Conductor(), and isValid().
|
private |
Definition at line 156 of file conductor.h.
Referenced by handlerMousePressEvent(), handlerMouseReleaseEvent(), and sceneEventFilter().
|
private |
Whether the conductor was manually modified by users.
Definition at line 171 of file conductor.h.
Referenced by handlerMouseMoveEvent(), pathFromXml(), setProfile(), setProfiles(), and toXml().
|
private |
Definition at line 166 of file conductor.h.
|
private |
Define whether and how the conductor should be highlighted.
Definition at line 178 of file conductor.h.
Referenced by highlight(), paint(), and setHighlighted().
|
staticprivate |
Definition at line 185 of file conductor.h.
Referenced by Conductor().
|
private |
Segments composing the conductor.
Definition at line 163 of file conductor.h.
Referenced by bends(), deleteSegments(), middleSegment(), pointsToSegments(), posForText(), segmentsList(), segmentsToPath(), and segmentsToPoints().
Terminal* Conductor::terminal1 |
Definition at line 67 of file conductor.h.
Referenced by Terminal::addConductor(), Diagram::addItem(), Conductor(), currentPathType(), NewConductorPotentialSelector::NewConductorPotentialSelector(), pathFromXml(), relatedConductors(), relatedPotentialConductors(), Diagram::removeItem(), setProfile(), setProfiles(), toXml(), updatePath(), and ~Conductor().
Terminal* Conductor::terminal2 |
Definition at line 68 of file conductor.h.
Referenced by Terminal::addConductor(), Diagram::addItem(), Conductor(), currentPathType(), NewConductorPotentialSelector::NewConductorPotentialSelector(), pathFromXml(), relatedConductors(), relatedPotentialConductors(), Diagram::removeItem(), setProfile(), setProfiles(), toXml(), updatePath(), and ~Conductor().
|
readwrite |
Definition at line 47 of file conductor.h.
|
readwrite |
Definition at line 46 of file conductor.h.
Referenced by calculateTextItemPosition(), handlerMousePressEvent(), MoveElementsCommand::move(), saveProfile(), and toXml().
|
readwrite |
Definition at line 48 of file conductor.h.
Referenced by DynamicTextItemDelegate::availableInfo(), ConductorPropertiesDialog::ConductorPropertiesDialog(), displayedTextChanged(), ElementsMover::endMovement(), SearchAndReplaceWidget::fillItemsList(), NewConductorPotentialSelector::getPotential(), LinkReportPotentialSelector::LinkReportPotentialSelector(), Terminal::mouseReleaseEvent(), ConductorAutoNumerotation::numeratePotential(), PotentialSelectorDialog::on_buttonBox_accepted(), ConductorPropertiesDialog::PropertiesDialog(), SearchAndReplaceWorker::replaceAdvanced(), SearchAndReplaceWidget::searchTerms(), and setPropertyToPotential().
|
readwrite |
Definition at line 49 of file conductor.h.
Referenced by NewConductorPotentialSelector::getPotential(), Terminal::mouseReleaseEvent(), and PotentialSelectorDialog::on_buttonBox_accepted().