QElectroTech
0.70
|
#include <element.h>
Public Types | |
enum | kind { Simple = 1, NextReport = 2, PreviousReport = 4, AllReport = 6, Master = 8, Slave = 16, Terminale = 32 } |
The kind enum Used to know the kind of this element (master, slave, report ect...) More... | |
enum | { Type = UserType + 1000 } |
Signals | |
void | linkedElementChanged () |
void | elementInfoChange (DiagramContext old_info, DiagramContext new_info) |
void | textAdded (DynamicElementTextItem *deti) |
void | textRemoved (DynamicElementTextItem *deti) |
void | textsGroupAdded (ElementTextItemGroup *group) |
void | textsGroupAboutToBeRemoved (ElementTextItemGroup *group) |
void | textAddedToGroup (DynamicElementTextItem *text, ElementTextItemGroup *group) |
void | textRemovedFromGroup (DynamicElementTextItem *text, ElementTextItemGroup *group) |
Public Member Functions | |||
Element (const ElementsLocation &location, QGraphicsItem *=nullptr, int *state=nullptr, Element::kind link_type=Element::Simple) | |||
Element::Element. More... | |||
~Element () override | |||
Element::~Element. More... | |||
int | type () const override | ||
QList< Terminal * > | terminals () const | ||
Element::terminals. More... | |||
QList< Conductor * > | conductors () const | ||
Element::conductors. More... | |||
DiagramContext | elementInformations () const | ||
DiagramContext | kindInformations () const | ||
autonum::sequentialNumbers | sequenceStruct () const | ||
autonum::sequentialNumbers & | rSequenceStruct () | ||
bool | isFreezeLabel () const | ||
virtual void | setHighlighted (bool) | ||
void | displayHelpLine (bool b=true) | ||
Element::displayHelpLine Display the help line of each terminal if b is true. More... | |||
QSize | size () const | ||
QPixmap | pixmap () | ||
Element::pixmap. More... | |||
QPoint | setHotspot (QPoint) | ||
QPoint | hotspot () const | ||
void | editProperty () override | ||
virtual bool | fromXml (QDomElement &, QHash< int, Terminal *> &, bool=false) | ||
Element::fromXml Import the parameters of this element from a xml document. When call this function ensure this element is already in a scene, because the dynamic text item and element text item group (in the xml file) are created in this function and need a diagram for create their Xref, when this element is linked to another. If not the Xref can be not displayed, until the next call of update Xref of the group or text item. More... | |||
virtual QDomElement | toXml (QDomDocument &, QHash< Terminal *, int > &) const | ||
QUuid | uuid () const | ||
Element::uuid. More... | |||
int | orientation () const | ||
void | addDynamicTextItem (DynamicElementTextItem *deti=nullptr) | ||
Element::addDynamiqueTextItem Add as a dynamic text item of this element, is reparented to this If is null, a new DynamicElementTextItem is created and added to this element. More... | |||
void | removeDynamicTextItem (DynamicElementTextItem *deti) | ||
Element::removeDynamicTextItem Remove , no matter if is a child of this element or a child of a group of this element. Set he parent item of to 0, is not deleted. More... | |||
QList< DynamicElementTextItem * > | dynamicTextItems () const | ||
Element::dynamicTextItems. More... | |||
bool | isFree () const | ||
virtual void | linkToElement (Element *) | ||
virtual void | unlinkAllElements () | ||
virtual void | unlinkElement (Element *) | ||
QList< Element * > | linkedElements () | ||
Element::linkedElements. More... | |||
virtual kind | linkType () const | ||
void | newUuid () | ||
void | paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override | ||
Element::paint. More... | |||
QRectF | boundingRect () const override | ||
will renamed to name1 or name2 etc.... | |||
Element::addTextGroup Create and add an element text item group to this element. If this element already have a group with the same name, then
| |||
ElementTextItemGroup * | addTextGroup (const QString &name) | ||
void | addTextGroup (ElementTextItemGroup *group) | ||
Element::addTextGroup. More... | |||
void | removeTextGroup (ElementTextItemGroup *group) | ||
Element::removeTextGroup Remove the text group from this element, and set the parent of group to 0. group is not deleted. All texts owned by the group will be reparented to this element. More... | |||
Public Member Functions inherited from QetGraphicsItem | |||
QetGraphicsItem (QGraphicsItem *parent=nullptr) | |||
QetGraphicsItem::QetGraphicsItem Default constructor. More... | |||
~QetGraphicsItem () override=0 | |||
Diagram * | diagram () const | ||
QetGraphicsItem::diagram return the diagram of this item. More... | |||
virtual void | setPos (const QPointF &p) | ||
QetGraphicsItem::setPos set the position of the item to p. More... | |||
virtual void | setPos (qreal x, qreal y) | ||
QetGraphicsItem::setPos set the position of the item. More... | |||
virtual bool | isMovable () const | ||
virtual void | setMovable (bool movable) | ||
QET::GraphicsItemState | state () const | ||
QetGraphicsItem::state. More... | |||
Static Public Member Functions | |
static bool | valideXml (QDomElement &) |
Protected Member Functions | |
void | drawAxes (QPainter *, const QStyleOptionGraphicsItem *) |
void | setSize (int, int) |
Element::setSize Define the size of the element. The size must be a multiple of 10. If not, the dimensions indicated will be arrrondies to higher tens. More... | |
Protected Member Functions inherited from QetGraphicsItem | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
QetGraphicsItem::mousePressEvent handle the mouse click. More... | |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override |
QetGraphicsItem::mouseDoubleClickEvent handle the mouse double click. More... | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
QetGraphicsItem::mouseMoveEvent handle mouse movement. More... | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
QetGraphicsItem::mouseReleaseEvent handle mouse release click. More... | |
Protected Attributes | |
QHash< DynamicElementTextItem *, QPointF > | m_converted_text_from_xml_description |
QList< Element * > | connected_elements |
QList< QUuid > | tmp_uuids_link |
QUuid | m_uuid |
kind | m_link_type = Element::Simple |
DiagramContext | m_element_informations |
DiagramContext | m_kind_informations |
autonum::sequentialNumbers | m_autoNum_seq |
bool | m_freeze_label = false |
QString | m_F_str |
ElementsLocation | m_location |
NamesList | m_names |
QList< Terminal * > | m_terminals |
const QPicture | m_picture |
const QPicture | m_low_zoom_picture |
Protected Attributes inherited from QetGraphicsItem | |
bool | is_movable_ |
bool | m_first_move |
bool | snap_to_grid_ |
QPointF | m_mouse_to_origin_movement |
QET::GraphicsItemState | m_state = QET:: GIOK |
Private Member Functions | |
Element (const Element &) | |
void | drawSelection (QPainter *, const QStyleOptionGraphicsItem *) |
void | drawHighlight (QPainter *, const QStyleOptionGraphicsItem *) |
bool | buildFromXml (const QDomElement &, int *=nullptr) |
Element::buildFromXml Build this element from an xml description. More... | |
bool | parseElement (const QDomElement &dom) |
Element::parseElement Parse the element of the xml description of this element. More... | |
bool | parseInput (const QDomElement &dom_element) |
Element::parseInput Parse the input (old text field) the parsed input are converted to dynamic text field, this function is only here to keep compatibility with old text. More... | |
DynamicElementTextItem * | parseDynamicText (const QDomElement &dom_element) |
Element::parseDynamicText Create the dynamic text field describ in . More... | |
Terminal * | parseTerminal (const QDomElement &dom_element) |
Private Attributes | |
bool | m_must_highlight = false |
QSize | dimensions |
QPoint | hotspot_coord |
bool | m_mouse_over = false |
QString | m_prefix |
QList< DynamicElementTextItem * > | m_dynamic_text_list |
QList< ElementTextItemGroup * > | m_texts_group |
Friends | |
class | DiagramEventAddElement |
or nullptr if this element | |||
| |||
QList< QPair< Terminal *, Terminal * > > | AlignedFreeTerminals () const | ||
Element::AlignedFreeTerminals. More... | |||
virtual void | setElementInformations (DiagramContext dc) | ||
Element::setElementInformations Set new information for this element. If new information is different of current infotmation emit . More... | |||
void | setUpFormula (bool code_letter=true) | ||
Element::setUpFormula Set up the formula used to create the label of this element. More... | |||
void | setPrefix (QString) | ||
Element::setPrefix set Element Prefix. More... | |||
QString | getPrefix () const | ||
Element::getPrefix get Element Prefix. More... | |||
void | freezeLabel (bool freeze) | ||
Element::freezeLabel Freeze this element label. More... | |||
void | freezeNewAddedElement () | ||
Element::freezeNewAddedElement Freeze this label if needed. More... | |||
QString | name () const override | ||
Element::name. More... | |||
ElementsLocation | location () const | ||
ElementTextItemGroup * | textGroup (const QString &name) const | ||
QList< ElementTextItemGroup * > | textGroups () const | ||
Element::textGroups. More... | |||
bool | addTextToGroup (DynamicElementTextItem *text, ElementTextItemGroup *group) | ||
Element::addTextToGroup Add the text to the group ; If isn't owned by this element return false. The text must be a text of this element. More... | |||
bool | removeTextFromGroup (DynamicElementTextItem *text, ElementTextItemGroup *group) | ||
Element::removeTextFromGroup Remove the text from the group , en reparent to this element. More... | |||
virtual void | initLink (QETProject *) | ||
Element::initLink Initialise the link between this element and other elements. This method can be call once because init the link according to uuid store in a private list, after link, the list is clear, so call another time do nothing. More... | |||
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override | ||
Element::mouseMoveEvent. More... | |||
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override | ||
Element::mouseReleaseEvent. More... | |||
void | hoverEnterEvent (QGraphicsSceneHoverEvent *) override | ||
void | hoverLeaveEvent (QGraphicsSceneHoverEvent *) override | ||
anonymous enum |
enum Element::kind |
Element::Element | ( | const ElementsLocation & | location, |
QGraphicsItem * | parent = nullptr , |
||
int * | state = nullptr , |
||
Element::kind | link_type = Element::Simple |
||
) |
location,location | of this element |
parent,parent | graphics item |
state,state | of the instanciation |
Definition at line 71 of file element.cpp.
References buildFromXml(), autonum::elementPrefixForLocation(), ElementsLocation::exist(), ElementsLocation::isElement(), location(), m_uuid, setPrefix(), QetGraphicsItem::state(), and ElementsLocation::xml().
|
override |
Definition at line 114 of file element.cpp.
References m_dynamic_text_list, and m_terminals.
|
private |
void Element::addDynamicTextItem | ( | DynamicElementTextItem * | deti = nullptr | ) |
Element::addDynamiqueTextItem Add as a dynamic text item of this element, is reparented to this If is null, a new DynamicElementTextItem is created and added to this element.
deti |
Definition at line 1146 of file element.cpp.
References m_dynamic_text_list, and textAdded().
Referenced by fromXml(), parseDynamicText(), AddElementTextCommand::redo(), removeTextFromGroup(), and DeleteQGraphicsItemCommand::undo().
ElementTextItemGroup * Element::addTextGroup | ( | const QString & | name | ) |
Definition at line 1209 of file element.cpp.
References m_texts_group, name(), textGroup(), and textsGroupAdded().
Referenced by fromXml().
void Element::addTextGroup | ( | ElementTextItemGroup * | group | ) |
group | add group to the group of this element. the group must not be owned by an element. |
Definition at line 1240 of file element.cpp.
References m_texts_group, ElementTextItemGroup::parentElement(), and textsGroupAdded().
bool Element::addTextToGroup | ( | DynamicElementTextItem * | text, |
ElementTextItemGroup * | group | ||
) |
Element::addTextToGroup Add the text to the group ; If isn't owned by this element return false. The text must be a text of this element.
Definition at line 1310 of file element.cpp.
References ElementTextItemGroup::addToGroup(), m_dynamic_text_list, m_texts_group, textAddedToGroup(), and textRemoved().
Referenced by ElementTextItemGroup::fromXml(), fromXml(), and DeleteQGraphicsItemCommand::undo().
Element::AlignedFreeTerminals.
Definition at line 1355 of file element.cpp.
References Terminal::conductors(), and terminals().
Referenced by ElementsMover::endMovement().
|
override |
Definition at line 205 of file element.cpp.
References dimensions, and hotspot_coord.
Referenced by centerToBottomDiagram(), drawHighlight(), and drawSelection().
|
private |
Element::buildFromXml Build this element from an xml description.
xml_def_elmt | |
state | Optional pointer which define the status of build 0 - evreything all right 4 - xml isn't a "definition" 5 - attribute of the definition isn't present or valid 6 - the definition is empty 7 - parsing of a xml node who describe a graphical part failed. 8 - No part of the drawing could be loaded |
Definition at line 350 of file element.cpp.
References QET::attributeIsAnInteger(), NamesList::fromXml(), DiagramContext::fromXml(), ElementPictureFactory::getPictures(), QET::GIBuildingFromXml, QET::GIOK, ElementPictureFactory::instance(), m_element_informations, m_kind_informations, m_location, m_low_zoom_picture, m_names, m_picture, QetGraphicsItem::m_state, name(), parseElement(), setHotspot(), setSize(), QetGraphicsItem::state(), QET::Icons::tr, and QET::version.
Referenced by Element().
QList< Conductor * > Element::conductors | ( | ) | const |
Definition at line 134 of file element.cpp.
References m_terminals.
Referenced by ConductorCreator::existingPotential(), LinkReportPotentialSelector::LinkReportPotentialSelector(), PotentialSelectorDialog::on_buttonBox_accepted(), and LinkElementCommand::redo().
void Element::displayHelpLine | ( | bool | b = true | ) |
Element::displayHelpLine Display the help line of each terminal if b is true.
b |
Definition at line 172 of file element.cpp.
References Terminal::drawHelpLine(), and terminals().
|
protected |
Dessine un petit repere (axes x et y) relatif a l'element
painter | Le QPainter a utiliser pour dessiner les axes |
options | Les options de style a prendre en compte |
Definition at line 273 of file element.cpp.
|
private |
Dessine le cadre de selection de l'element de maniere systematiquement non antialiasee.
painter | Le QPainter a utiliser pour dessiner les bornes. |
options | Les options de style a prendre en compte |
Definition at line 315 of file element.cpp.
References boundingRect().
Referenced by paint().
|
private |
Dessine le cadre de selection de l'element de maniere systematiquement non antialiasee.
painter | Le QPainter a utiliser pour dessiner les bornes. |
options | Les options de style a prendre en compte |
Definition at line 292 of file element.cpp.
References boundingRect().
Referenced by paint().
QList< DynamicElementTextItem * > Element::dynamicTextItems | ( | ) | const |
Definition at line 1197 of file element.cpp.
References m_dynamic_text_list.
Referenced by ImportElementTextPattern::apply(), ElementTextItemGroup::fromXml(), SearchAndReplaceWidget::searchTerms(), and AddElementTextCommand::~AddElementTextCommand().
|
overridevirtual |
Reimplemented from QetGraphicsItem.
Definition at line 145 of file element.cpp.
References QetGraphicsItem::diagram(), and ElementPropertiesWidget::findEditClicked().
|
signal |
|
inline |
Definition at line 89 of file element.h.
References m_element_informations.
Referenced by SearchAndReplaceWidget::addElement(), DynamicTextItemDelegate::availableInfo(), DynamicElementTextItem::elementInfoChanged(), DynamicElementTextModel::itemDataChanged(), DynamicElementTextModel::itemsForText(), SearchAndReplaceWorker::replaceAdvanced(), SearchAndReplaceWidget::searchTerms(), DynamicElementTextItem::setCompositeText(), DynamicTextItemDelegate::setModelData(), DynamicElementTextItem::setupFormulaConnection(), and DynamicElementTextItem::updateLabel().
void Element::freezeLabel | ( | bool | freeze | ) |
Element::freezeLabel Freeze this element label.
Definition at line 1545 of file element.cpp.
References m_freeze_label.
Referenced by Diagram::freezeElements(), freezeNewAddedElement(), and Diagram::unfreezeElements().
void Element::freezeNewAddedElement | ( | ) |
Element::freezeNewAddedElement Freeze this label if needed.
Definition at line 1554 of file element.cpp.
References QetGraphicsItem::diagram(), and freezeLabel().
|
virtual |
Element::fromXml Import the parameters of this element from a xml document. When call this function ensure this element is already in a scene, because the dynamic text item and element text item group (in the xml file) are created in this function and need a diagram for create their Xref, when this element is linked to another. If not the Xref can be not displayed, until the next call of update Xref of the group or text item.
e | : the dom element where the parameter is stored |
table_id_adr | : Reference to the mapping table between IDs of the XML file and the addresses in memory. If the import succeeds, it must be add the right couples (id, address). |
handle_inputs_rotation | : apply the rotation of this element to his child text |
Since the commit 4791, the value used as "label" and "formula" is stored in differents keys (instead of the same key, "label" in previous version), so, if "label" contain "%" (Use variable value), and "formula" does not exist, this mean the label was made before commit 4791 (0.51 dev). So we swap the value stored in "label" to "formula" as expected. remove this code at version 0.7 or more (probably useless).
During the devel of the version 0.7, the "old text" was replaced by the dynamic element text item. When open a project made befor the 0.7, we must to reproduce the same visual when the label are not empty and visible, and comment are not empty and visible and/or location are not empty and visible. we create a text group with inside the needed texts, label and comment and/or location.
Definition at line 647 of file element.cpp.
References addDynamicTextItem(), addTextGroup(), addTextToGroup(), DiagramContext::addValue(), DiagramContext::contains(), QetGraphicsItem::diagram(), DynamicElementTextItem::ElementInfo, QET::findInDomElement(), DiagramTextItem::font, autonum::sequentialNumbers::fromXml(), DiagramContext::fromXml(), ElementTextItemGroup::fromXml(), DynamicElementTextItem::fromXml(), QET::GILoadingFromXml, QET::GIOK, DiagramContext::keyMustShow(), XRefProperties::Label, ElementXmlRetroCompatibility::loadSequential(), location(), m_autoNum_seq, m_converted_text_from_xml_description, m_dynamic_text_list, m_element_informations, m_freeze_label, m_kind_informations, m_link_type, m_prefix, QetGraphicsItem::m_state, m_uuid, Master, NextReport, PreviousReport, ElementTextItemGroup::setAlignment(), setElementInformations(), DiagramTextItem::setFont(), DynamicElementTextItem::setFrame(), ElementTextItemGroup::setHoldToBottomPage(), DynamicElementTextItem::setInfoName(), ElementTextItemGroup::setPos(), ElementTextItemGroup::setRotation(), DynamicElementTextItem::setTextFrom(), DynamicElementTextItem::setTextWidth(), ElementTextItemGroup::setVerticalAdjustment(), tmp_uuids_link, QET::Icons::tr, Terminal::valideXml(), DiagramContext::value(), ElementTextItemGroup::xmlTaggName(), and DynamicElementTextItem::xmlTaggName().
Referenced by Diagram::fromXml().
QString Element::getPrefix | ( | ) | const |
Element::getPrefix get Element Prefix.
Definition at line 1529 of file element.cpp.
References m_prefix.
Referenced by autonum::AssignVariables::AssignVariables().
QPoint Element::hotspot | ( | ) | const |
Definition at line 254 of file element.cpp.
References hotspot_coord.
Referenced by ElementsTreeView::startElementDrag().
|
overrideprotected |
When mouse over element change m_mouse_over to true (used in paint() function ) Also highlight linked elements
e | QGraphicsSceneHoverEvent |
Definition at line 1461 of file element.cpp.
References linkedElements(), m_mouse_over, name(), and setHighlighted().
|
overrideprotected |
When mouse over element leave the position change m_mouse_over to false(used in paint() function ) Also un-highlight linked elements
e | QGraphicsSceneHoverEvent |
Definition at line 1478 of file element.cpp.
References linkedElements(), m_mouse_over, and setHighlighted().
|
virtual |
Element::initLink Initialise the link between this element and other elements. This method can be call once because init the link according to uuid store in a private list, after link, the list is clear, so call another time do nothing.
prj,ownership | project of this element and other element to be linked |
Reimplemented in MasterElement, SimpleElement, and TerminalElement.
Definition at line 1381 of file element.cpp.
References ElementProvider::fromUuids(), linkToElement(), and tmp_uuids_link.
Referenced by TerminalElement::initLink(), SimpleElement::initLink(), and MasterElement::initLink().
|
inline |
Definition at line 201 of file element.h.
References connected_elements.
Referenced by CrossRefItem::fillCrossRef(), ElementProvider::freeElement(), NewConductorPotentialSelector::getPotential(), LinkElementCommand::isLinkable(), LinkReportPotentialSelector::LinkReportPotentialSelector(), SlaveElement::linkToElement(), ReportElement::linkToElement(), PotentialSelectorDialog::on_buttonBox_accepted(), CrossRefItem::setUpCrossBoundingRect(), toXml(), SlaveElement::unlinkAllElements(), ReportElement::unlinkAllElements(), and MasterElement::unlinkAllElements().
|
inline |
Definition at line 101 of file element.h.
References m_freeze_label.
Referenced by DynamicElementTextItem::setupFormulaConnection().
|
inline |
Definition at line 91 of file element.h.
References m_kind_informations.
Referenced by MasterElement::aboutDeleteXref(), ElementTextItemGroup::autoPos(), CrossRefItem::drawAsContacts(), CrossRefItem::elementPositionText(), CrossRefItem::init(), MasterElement::linkToElement(), CrossRefItem::NCElements(), CrossRefItem::NOElements(), CrossRefItem::updateProperties(), ElementTextItemGroup::updateXref(), and MasterElement::xrefPropertiesChanged().
|
signal |
Referenced by ElementTextItemGroup::ElementTextItemGroup(), DynamicElementTextItem::itemChange(), SlaveElement::linkToElement(), ReportElement::linkToElement(), MasterElement::linkToElement(), LinkSingleElementWidget::setElement(), MasterPropertiesWidget::setElement(), ElementTextItemGroup::setHoldToBottomPage(), CrossRefItem::setUpConnection(), SlaveElement::unlinkAllElements(), ReportElement::unlinkAllElements(), MasterElement::unlinkAllElements(), SlaveElement::unlinkElement(), and MasterElement::unlinkElement().
|
inline |
Definition at line 229 of file element.h.
References comparPos(), and connected_elements.
Referenced by CrossRefItem::drawAsContacts(), DynamicElementTextItem::elementUseForInfo(), ConductorCreator::existingPotential(), NewConductorPotentialSelector::getPotential(), hoverEnterEvent(), hoverLeaveEvent(), LinkElementCommand::isLinkable(), CrossRefItem::linkedChanged(), LinkElementCommand::LinkElementCommand(), LinkReportPotentialSelector::LinkReportPotentialSelector(), LinkElementCommand::makeLink(), ElementTextItemGroup::mouseDoubleClickEvent(), CrossRefItem::NCElements(), CrossRefItem::NOElements(), DeleteQGraphicsItemCommand::redo(), CrossRefItem::updateLabel(), and ElementTextItemGroup::updateXref().
|
inlinevirtual |
Reimplemented in MasterElement, ReportElement, and SlaveElement.
Definition at line 133 of file element.h.
Referenced by initLink(), LinkReportPotentialSelector::LinkReportPotentialSelector(), ReportElement::linkToElement(), MasterElement::linkToElement(), and LinkElementCommand::makeLink().
|
inlinevirtual |
Definition at line 138 of file element.h.
References m_link_type.
Referenced by SearchAndReplaceWidget::addElement(), ElementTextItemGroup::autoPos(), DynamicTextItemDelegate::availableInfo(), DynamicElementTextItem::elementUseForInfo(), ElementProvider::find(), ElementProvider::freeElement(), NewConductorPotentialSelector::getPotential(), LinkElementCommand::isLinkable(), LinkReportPotentialSelector::LinkReportPotentialSelector(), SlaveElement::linkToElement(), ReportElement::linkToElement(), MasterElement::linkToElement(), ElementTextItemGroup::mouseDoubleClickEvent(), PotentialSelectorDialog::on_buttonBox_accepted(), LinkElementCommand::redo(), ElementPropertiesWidget::setElement(), ElementTextItemGroup::setHoldToBottomPage(), CompositeTextEditDialog::setUpComboBox(), setUpFormula(), LinkElementCommand::setUpNewLink(), and ElementTextItemGroup::updateXref().
ElementsLocation Element::location | ( | ) | const |
Definition at line 1569 of file element.cpp.
References m_location.
Referenced by Element(), fromXml(), and ExportDialog::generateDxf().
|
overrideprotected |
event |
Definition at line 1433 of file element.cpp.
References QetGraphicsItem::mouseMoveEvent(), and terminals().
|
overrideprotected |
event |
Definition at line 1446 of file element.cpp.
References QetGraphicsItem::mouseReleaseEvent(), and terminals().
|
overridevirtual |
Reimplemented from QetGraphicsItem.
Definition at line 1565 of file element.cpp.
References ElementsLocation::baseName(), m_location, m_names, and NamesList::name().
Referenced by DiagramEventAddElement::addElement(), addTextGroup(), buildFromXml(), hoverEnterEvent(), DynamicElementTextItemEditor::on_m_add_group_clicked(), and textGroup().
|
inline |
Indicate the current orientation of this element O = 0° 1 = 90° 2 = 180° 3 = 270°
Definition at line 213 of file element.h.
References QET::correctAngle().
Referenced by toXml().
|
override |
painter | |
options | |
widget |
Definition at line 184 of file element.cpp.
References drawHighlight(), drawSelection(), m_low_zoom_picture, m_mouse_over, m_must_highlight, and m_picture.
|
private |
Element::parseDynamicText Create the dynamic text field describ in .
dom_element |
Definition at line 550 of file element.cpp.
References addDynamicTextItem(), DynamicElementTextItem::fromXml(), DynamicElementTextItem::m_uuid, and DynamicElementTextItem::xmlTaggName().
Referenced by parseElement().
|
private |
Element::parseElement Parse the element of the xml description of this element.
dom |
Definition at line 484 of file element.cpp.
References parseDynamicText(), parseInput(), and parseTerminal().
Referenced by buildFromXml().
|
private |
Element::parseInput Parse the input (old text field) the parsed input are converted to dynamic text field, this function is only here to keep compatibility with old text.
dom_element |
Definition at line 500 of file element.cpp.
References QET::attributeIsAnInteger(), QET::attributeIsAReal(), DynamicElementTextItem::ElementInfo, DiagramTextItem::font, m_converted_text_from_xml_description, DiagramTextItem::setFont(), DynamicElementTextItem::setInfoName(), DynamicElementTextItem::setText(), DynamicElementTextItem::setTextFrom(), and size().
Referenced by parseElement().
|
private |
Definition at line 565 of file element.cpp.
References QET::attributeIsAReal(), Terminal::dockConductor(), Qet::East, m_terminals, Qet::North, Qet::South, QET::Icons::Terminal, and Qet::West.
Referenced by parseElement().
QPixmap Element::pixmap | ( | ) |
Definition at line 262 of file element.cpp.
References ElementPictureFactory::instance(), m_location, and ElementPictureFactory::pixmap().
Referenced by ElementsTreeView::startElementDrag().
void Element::removeDynamicTextItem | ( | DynamicElementTextItem * | deti | ) |
Element::removeDynamicTextItem Remove , no matter if is a child of this element or a child of a group of this element. Set he parent item of to 0, is not deleted.
deti |
Definition at line 1168 of file element.cpp.
References m_dynamic_text_list, m_texts_group, removeTextFromGroup(), and textRemoved().
Referenced by DeleteQGraphicsItemCommand::redo(), and AddElementTextCommand::undo().
bool Element::removeTextFromGroup | ( | DynamicElementTextItem * | text, |
ElementTextItemGroup * | group | ||
) |
Element::removeTextFromGroup Remove the text from the group , en reparent to this element.
Definition at line 1331 of file element.cpp.
References addDynamicTextItem(), m_texts_group, ElementTextItemGroup::removeFromGroup(), textRemovedFromGroup(), and ElementTextItemGroup::texts().
Referenced by DeleteQGraphicsItemCommand::redo(), removeDynamicTextItem(), and removeTextGroup().
void Element::removeTextGroup | ( | ElementTextItemGroup * | group | ) |
Element::removeTextGroup Remove the text group from this element, and set the parent of group to 0. group is not deleted. All texts owned by the group will be reparented to this element.
name |
Definition at line 1257 of file element.cpp.
References m_texts_group, removeTextFromGroup(), textsGroupAboutToBeRemoved(), and DynamicElementTextItem::Type.
|
inline |
Definition at line 96 of file element.h.
References m_autoNum_seq.
Referenced by CrossRefItem::AddExtraInfo(), DynamicElementTextItem::elementInfoChanged(), nomenclature::getElementInfo(), ElementXmlRetroCompatibility::loadSequential(), DynamicElementTextItem::reportReplacedCompositeText(), DynamicElementTextItem::updateLabel(), DynamicElementTextItem::updateReportText(), and ElementTextItemGroup::updateXref().
|
inline |
Definition at line 95 of file element.h.
References m_autoNum_seq.
|
virtual |
Element::setElementInformations Set new information for this element. If new information is different of current infotmation emit .
dc |
Definition at line 1399 of file element.cpp.
References elementInfoChange(), and m_element_informations.
Referenced by fromXml().
|
virtual |
hl | true pour mettre l'element en evidence, false sinon |
Definition at line 162 of file element.cpp.
References m_must_highlight.
Referenced by hoverEnterEvent(), hoverLeaveEvent(), LinkSingleElementWidget::LinkSingleElementWidget(), ElementTextItemGroup::mouseMoveEvent(), DynamicElementTextItem::mouseMoveEvent(), ElementTextItemGroup::mouseReleaseEvent(), LinkSingleElementWidget::on_m_show_linked_pb_clicked(), LinkSingleElementWidget::on_m_tree_widget_itemDoubleClicked(), LinkSingleElementWidget::setElement(), ReportElement::unlinkAllElements(), SlaveElement::unlinkElement(), MasterElement::unlinkElement(), and LinkSingleElementWidget::~LinkSingleElementWidget().
QPoint Element::setHotspot | ( | QPoint | hs | ) |
Definit le hotspot de l'element par rapport au coin superieur gauche de son rectangle delimitant. Necessite que la taille ait deja ete definie
hs | Coordonnees du hotspot |
Definition at line 238 of file element.cpp.
References dimensions, and hotspot_coord.
Referenced by buildFromXml().
void Element::setPrefix | ( | QString | prefix | ) |
Element::setPrefix set Element Prefix.
Definition at line 1537 of file element.cpp.
References m_prefix.
Referenced by Element().
|
protected |
Element::setSize Define the size of the element. The size must be a multiple of 10. If not, the dimensions indicated will be arrrondies to higher tens.
wid | |
hei |
Definition at line 217 of file element.cpp.
References dimensions.
Referenced by buildFromXml().
void Element::setUpFormula | ( | bool | code_letter = true | ) |
Element::setUpFormula Set up the formula used to create the label of this element.
if true set tagged text to code letter (ex K for coil) with condition : formula is empty, text tagged "label" is emptty or "_"; |
Definition at line 1494 of file element.cpp.
References QETProject::addElementAutoNum(), DiagramContext::addValue(), AllReport, autonum::sequentialNumbers::clear(), QetGraphicsItem::diagram(), QETProject::elementAutoNum(), QETProject::elementAutoNumCurrentFormula(), QETProject::elementCurrentAutoNum(), elementInfoChange(), autonum::AssignVariables::formulaToLabel(), linkType(), m_autoNum_seq, m_element_informations, m_freeze_label, NumerotationContextCommands::next(), Diagram::project(), autonum::setSequential(), and Slave.
QSize Element::size | ( | ) | const |
Definition at line 229 of file element.cpp.
References dimensions.
Referenced by parseInput(), and ReportElement::~ReportElement().
QList< Terminal * > Element::terminals | ( | ) | const |
Definition at line 124 of file element.cpp.
References m_terminals.
Referenced by AlignedFreeTerminals(), displayHelpLine(), NewConductorPotentialSelector::getPotential(), mouseMoveEvent(), mouseReleaseEvent(), relatedPotentialTerminal(), DynamicElementTextItem::setPotentialConductor(), DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements(), toXml(), and ReportElement::~ReportElement().
|
signal |
Referenced by addDynamicTextItem(), and DynamicElementTextModel::DynamicElementTextModel().
|
signal |
Referenced by addTextToGroup(), and DynamicElementTextModel::DynamicElementTextModel().
ElementTextItemGroup * Element::textGroup | ( | const QString & | name | ) | const |
Definition at line 1285 of file element.cpp.
References m_texts_group, and name().
Referenced by addTextGroup().
QList< ElementTextItemGroup * > Element::textGroups | ( | ) | const |
Definition at line 1298 of file element.cpp.
References m_texts_group.
Referenced by ImportElementTextPattern::apply(), and SearchAndReplaceWidget::searchTerms().
|
signal |
Referenced by addTextToGroup(), DynamicElementTextModel::DynamicElementTextModel(), and removeDynamicTextItem().
|
signal |
Referenced by DynamicElementTextModel::DynamicElementTextModel(), and removeTextFromGroup().
|
signal |
Referenced by DynamicElementTextModel::DynamicElementTextModel(), and removeTextGroup().
|
signal |
Referenced by addTextGroup(), and DynamicElementTextModel::DynamicElementTextModel().
|
virtual |
Permet d'exporter l'element en XML
document | Document XML a utiliser |
table_adr_id | Table de correspondance entre les adresses des bornes et leur id dans la representation XML ; cette table completee par cette methode |
Definition at line 1021 of file element.cpp.
References connected_elements, isFree(), DiagramContext::keys(), m_autoNum_seq, m_dynamic_text_list, m_element_informations, m_freeze_label, m_location, m_prefix, m_texts_group, orientation(), ElementsLocation::path(), terminals(), autonum::sequentialNumbers::toXml(), DiagramContext::toXml(), and uuid().
Referenced by ExportElementTextPattern::xmlConf().
|
inlineoverride |
|
inlinevirtual |
Reimplemented in MasterElement, ReportElement, and SlaveElement.
Definition at line 134 of file element.h.
Referenced by LinkReportPotentialSelector::LinkReportPotentialSelector(), LinkElementCommand::makeLink(), and Diagram::removeItem().
|
inlinevirtual |
Reimplemented in MasterElement, ReportElement, and SlaveElement.
Definition at line 135 of file element.h.
Referenced by LinkElementCommand::makeLink().
|
inline |
Definition at line 221 of file element.h.
References m_uuid.
Referenced by ElementProvider::fromUuids(), and toXml().
|
static |
Permet de savoir si un element XML (QDomElement) represente bien un element
e | Le QDomElement a valide |
Definition at line 614 of file element.cpp.
Referenced by Diagram::fromXml().
|
friend |
|
protected |
Definition at line 171 of file element.h.
Referenced by isFree(), linkedElements(), SlaveElement::linkToElement(), ReportElement::linkToElement(), MasterElement::linkToElement(), toXml(), SlaveElement::unlinkAllElements(), ReportElement::unlinkAllElements(), MasterElement::unlinkAllElements(), SlaveElement::unlinkElement(), and MasterElement::unlinkElement().
|
private |
Definition at line 190 of file element.h.
Referenced by boundingRect(), setHotspot(), setSize(), and size().
|
private |
Definition at line 191 of file element.h.
Referenced by boundingRect(), hotspot(), and setHotspot().
|
protected |
Definition at line 178 of file element.h.
Referenced by fromXml(), rSequenceStruct(), sequenceStruct(), setUpFormula(), and toXml().
|
protected |
Definition at line 168 of file element.h.
Referenced by DiagramEventAddElement::addElement(), fromXml(), and parseInput().
|
private |
Definition at line 194 of file element.h.
Referenced by addDynamicTextItem(), DiagramEventAddElement::addElement(), addTextToGroup(), dynamicTextItems(), fromXml(), removeDynamicTextItem(), toXml(), and ~Element().
|
protected |
Definition at line 177 of file element.h.
Referenced by buildFromXml(), elementInformations(), fromXml(), setElementInformations(), setUpFormula(), and toXml().
|
protected |
Definition at line 179 of file element.h.
Referenced by freezeLabel(), fromXml(), isFreezeLabel(), setUpFormula(), and toXml().
|
protected |
Definition at line 177 of file element.h.
Referenced by buildFromXml(), fromXml(), and kindInformations().
|
protected |
Definition at line 174 of file element.h.
Referenced by fromXml(), and linkType().
|
protected |
Definition at line 182 of file element.h.
Referenced by buildFromXml(), location(), name(), pixmap(), and toXml().
|
protected |
Definition at line 186 of file element.h.
Referenced by buildFromXml(), and paint().
|
private |
Definition at line 192 of file element.h.
Referenced by hoverEnterEvent(), hoverLeaveEvent(), and paint().
|
private |
Definition at line 189 of file element.h.
Referenced by paint(), and setHighlighted().
|
protected |
Definition at line 183 of file element.h.
Referenced by buildFromXml(), and name().
|
protected |
Definition at line 185 of file element.h.
Referenced by buildFromXml(), and paint().
|
private |
Definition at line 193 of file element.h.
Referenced by fromXml(), getPrefix(), setPrefix(), and toXml().
|
protected |
Definition at line 184 of file element.h.
Referenced by conductors(), parseTerminal(), terminals(), and ~Element().
|
private |
Definition at line 195 of file element.h.
Referenced by addTextGroup(), addTextToGroup(), removeDynamicTextItem(), removeTextFromGroup(), removeTextGroup(), textGroup(), textGroups(), and toXml().
|
protected |
|
protected |
Definition at line 172 of file element.h.
Referenced by fromXml(), and initLink().