QElectroTech
0.70
|
#include <diagram.h>
Public Types | |
enum | BorderOptions { EmptyBorder, TitleBlock, Columns } |
enum | NumerotationType { Conductors } |
Represents available option of Numerotation type. More... | |
Public Slots | |
void | adjustSceneRect () |
Diagram::adjustSceneRect Recalcul and adjust the size of the scene. More... | |
void | titleChanged (const QString &) |
void | titleBlockTemplateChanged (const QString &) |
void | titleBlockTemplateRemoved (const QString &, const QString &=QString()) |
void | setTitleBlockTemplate (const QString &) |
void | updateLabels () |
Diagram::updateLabels Update elements and conductors that reference folio field in their labels. More... | |
void | loadElmtFolioSeq () |
Diagram::loadElmtFolioSeq This class loads all folio sequential variables related to the current autonum. More... | |
void | loadCndFolioSeq () |
Diagram::loadCndFolioSeq This class loads all conductor folio sequential variables related to the current autonum. More... | |
void | selectAll () |
void | deselectAll () |
void | invertSelection () |
Signals | |
void | showDiagram (Diagram *) |
void | usedTitleBlockTemplateChanged (const QString &) |
void | diagramTitleChanged (Diagram *, const QString &) |
void | findElementRequired (const ElementsLocation &) |
void | editElementRequired (const ElementsLocation &) |
Signal emitted when users wish to locate an element from the diagram within elements collection. More... | |
void | diagramActivated () |
Signal emitted when users wish to edit an element from the diagram. More... | |
Public Member Functions | |
Diagram (QETProject *project) | |
Diagram::Diagram Constructor. More... | |
~Diagram () override | |
Diagram::~Diagram Destructor. More... | |
void | setEventInterface (DiagramEventInterface *event_interface) |
Diagram::setEventInterface Set event_interface has current interface. Diagram become the ownership of event_interface If there is a previous interface, they will be delete before and call init() to the new interface. More... | |
void | clearEventInterface () |
Diagram::clearEventInterface Clear the current event interface. More... | |
QString | conductorsAutonumName () const |
Diagram::conductorsAutonumName. More... | |
void | setConductorsAutonumName (const QString &name) |
Diagram::setConductorsAutonumName. More... | |
QETProject * | project () const |
void | setProject (QETProject *) |
Diagram::setProject Set parent project of this diagram, project also become the parent QObject of this diagram. More... | |
int | folioIndex () const |
qreal | declaredQElectroTechVersion (bool=true) const |
void | showMe () |
bool | isReadOnly () const |
Diagram::isReadOnly. More... | |
void | setConductor (bool) |
void | setConductorStart (QPointF) |
void | setConductorStop (QPointF) |
QList< QSet< Conductor * > > | potentials () |
Diagram::potential. More... | |
QDomDocument | toXml (bool=true) |
bool | initFromXml (QDomElement &, QPointF=QPointF(), bool=true, DiagramContent *=nullptr) |
bool | fromXml (QDomDocument &, QPointF=QPointF(), bool=true, DiagramContent *=nullptr) |
bool | fromXml (QDomElement &, QPointF=QPointF(), bool=true, DiagramContent *=nullptr) |
void | folioSequentialsToXml (QHash< QString, QStringList > *, QDomElement *, const QString &, const QString &, QDomDocument *) |
Diagram::folioSequentialsToXml. More... | |
void | folioSequentialsFromXml (const QDomElement &, QHash< QString, QStringList > *, const QString &, const QString &, const QString &, const QString &) |
Diagram::folioSequentialsFromXml Load folio sequential from QDomElement. More... | |
void | refreshContents () |
Diagram::refreshContents refresh all content of diagram. More... | |
virtual void | addItem (QGraphicsItem *item) |
Diagram::addItem Réimplemented from QGraphicsScene::addItem(QGraphicsItem *item) Do some specific operation if item need it (for exemple an element) More... | |
virtual void | removeItem (QGraphicsItem *item) |
Diagram::removeItem Réimplemented from QGraphicsScene::removeItem(QGraphicsItem *item) Do some specific operation if item need it (for exemple an element) More... | |
ExportProperties | applyProperties (const ExportProperties &) |
void | setDisplayGrid (bool) |
bool | displayGrid () |
void | setUseBorder (bool) |
bool | useBorder () |
void | setBorderOptions (BorderOptions) |
BorderOptions | borderOptions () |
DiagramPosition | convertPosition (const QPointF &) |
bool | drawTerminals () const |
void | setDrawTerminals (bool) |
bool | drawColoredConductors () const |
void | setDrawColoredConductors (bool) |
QString | title () const |
bool | toPaintDevice (QPaintDevice &, int=-1, int=-1, Qt::AspectRatioMode=Qt::KeepAspectRatio) |
QSize | imageSize () const |
bool | isEmpty () const |
QList< Element * > | elements () const |
QList< Conductor * > | conductors () const |
Diagram::conductors Return the list containing all conductors. More... | |
QSet< Conductor * > | selectedConductors () const |
DiagramContent | content () const |
bool | canRotateSelection () const |
Diagram::canRotateSelection. More... | |
ElementsMover & | elementsMover () |
ElementTextsMover & | elementTextsMover () |
bool | usesElement (const ElementsLocation &) |
bool | usesTitleBlockTemplate (const QString &) |
QUndoStack & | undoStack () |
QGIManager & | qgiManager () |
void | freezeElements (bool freeze) |
Diagram::freezeElements Freeze every existent element label. More... | |
void | unfreezeElements () |
Diagram::unfreezeElements Unfreeze every existent element label. More... | |
void | setFreezeNewElements (bool) |
Diagram::freezeNewElements Set new element label to be frozen. More... | |
bool | freezeNewElements () |
Diagram::freezeNewElements. More... | |
void | freezeConductors (bool freeze) |
Diagram::freezeConductors Freeze every existent conductor label. More... | |
void | setFreezeNewConductors (bool) |
Diagram::setfreezeNewConductors Set new conductor label to be frozen. More... | |
bool | freezeNewConductors () |
Diagram::freezeNewConductors. More... | |
void | insertFolioSeqHash (QHash< QString, QStringList > *hash, const QString &title, const QString &seq, NumerotationContext *nc) |
Diagram::insertFolioSeqHash This class inserts a stringlist containing all sequential variables related to an autonum in a QHash. More... | |
void | loadFolioSeqHash (QHash< QString, QStringList > *hash, const QString &title, const QString &seq, NumerotationContext *nc) |
Diagram::loadFolioSeqHash This class loads all folio sequential variables related to the current autonum. More... | |
void | changeZValue (QET::DepthOption option) |
Diagram::changeZValue Change the Z value of the current selected item, according to . More... | |
Static Public Member Functions | |
static bool | clipboardMayContainDiagram () |
static QPointF | snapToGrid (const QPointF &p) |
Diagram::snapToGrid Return a nearest snap point of p. More... | |
Public Attributes | |
ConductorProperties | defaultConductorProperties |
Default properties for new conductors. More... | |
BorderTitleBlock | border_and_titleblock |
Diagram dimensions and title block. More... | |
QHash< QString, QStringList > | m_elmt_unitfolio_max |
Hash containing max values for folio sequential autonums in this diagram. More... | |
QHash< QString, QStringList > | m_elmt_tenfolio_max |
QHash< QString, QStringList > | m_elmt_hundredfolio_max |
QHash< QString, QStringList > | m_cnd_unitfolio_max |
Hash containing max values for folio sequential autonums in this diagram. More... | |
QHash< QString, QStringList > | m_cnd_tenfolio_max |
QHash< QString, QStringList > | m_cnd_hundredfolio_max |
Static Public Attributes | |
static int | xGrid = 10 |
abscissa grid step size More... | |
static int | yGrid = 10 |
ordinate grid step size More... | |
static int | xKeyGrid = 10 |
Key grid x step size. More... | |
static int | yKeyGrid = 10 |
Key grid y step size. More... | |
static int | xKeyGridFine = 1 |
Key grid fine x step size. More... | |
static int | yKeyGridFine = 1 |
Key grid fine y step size. More... | |
static const qreal | margin = 5.0 |
margin around the diagram More... | |
static QColor | background_color = Qt::white |
background color of diagram More... | |
Protected Member Functions | |
void | drawBackground (QPainter *, const QRectF &) override |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override |
Diagram::mouseDoubleClickEvent This event is managed by diagram event interface if any. More... | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
Diagram::mousePressEvent This event is managed by diagram event interface if any. More... | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
Diagram::mouseMoveEvent This event is managed by diagram event interface if any. More... | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
Diagram::mouseReleaseEvent This event is managed by diagram event interface if any. More... | |
void | wheelEvent (QGraphicsSceneWheelEvent *event) override |
Diagram::wheelEvent This event is managed by diagram event interface if any. More... | |
void | keyPressEvent (QKeyEvent *event) override |
Diagram::keyPressEvent This event is managed by diagram event interface if any. Else move selected elements. More... | |
void | keyReleaseEvent (QKeyEvent *) override |
Diagram::keyReleaseEvent This event is managed by diagram event interface if any. Else move selected element. More... | |
Private Member Functions | |
Diagram (const Diagram &diagram) | |
Private Attributes | |
QGraphicsLineItem * | conductor_setter_ |
ElementsMover | m_elements_mover |
ElementTextsMover | m_element_texts_mover |
QGIManager * | qgi_manager_ |
QETProject * | m_project |
QDomDocument | xml_document_ |
qreal | diagram_qet_version_ |
bool | draw_grid_ |
bool | use_border_ |
bool | draw_terminals_ |
bool | draw_colored_conductors_ |
QString | m_conductors_autonum_name |
DiagramEventInterface * | m_event_interface |
bool | m_freeze_new_elements |
bool | m_freeze_new_conductors_ |
This class represents an electric diagram. It manages its various child elements, conductors and texts and handles their graphic rendering.
Diagram::Diagram | ( | QETProject * | project | ) |
Diagram::Diagram Constructor.
project | : The project of this diagram and also parent QObject |
Definition at line 57 of file diagram.cpp.
References adjustSceneRect(), border_and_titleblock, conductor_setter_, diagramActivated(), diagramTitleChanged(), loadCndFolioSeq(), loadElmtFolioSeq(), project(), qgi_manager_, setProject(), setTitleBlockTemplate(), titleChanged(), and updateLabels().
|
override |
Diagram::~Diagram Destructor.
Definition at line 100 of file diagram.cpp.
References conductor_setter_, m_event_interface, qgi_manager_, and undoStack().
|
private |
|
virtual |
Diagram::addItem Réimplemented from QGraphicsScene::addItem(QGraphicsItem *item) Do some specific operation if item need it (for exemple an element)
item |
Definition at line 1108 of file diagram.cpp.
References Terminal::addConductor(), Conductor::calculateTextItemPosition(), isReadOnly(), Conductor::terminal1, Conductor::terminal2, and Conductor::Type.
Referenced by fromXml(), DiagramEventAddImage::mouseMoveEvent(), DiagramEventAddShape::mousePressEvent(), PasteDiagramCommand::redo(), DeleteQGraphicsItemCommand::undo(), and DiagramEventAddShape::updateHelpCross().
|
slot |
Diagram::adjustSceneRect Recalcul and adjust the size of the scene.
Definition at line 1597 of file diagram.cpp.
References border_and_titleblock, and BorderTitleBlock::borderAndTitleBlockRect().
Referenced by Diagram(), fromXml(), MultiPasteDialog::on_m_button_box_accepted(), DiagramView::scrollOnMovement(), MultiPasteDialog::updatePreview(), and DiagramView::zoom().
ExportProperties Diagram::applyProperties | ( | const ExportProperties & | new_properties | ) |
Cette methode permet d'appliquer de nouvelles options de rendu tout en accedant aux proprietes de rendu en cours.
new_properties | Nouvelles options de rendu a appliquer |
Definition at line 1610 of file diagram.cpp.
References border_and_titleblock, QET::BorderArea, BorderTitleBlock::borderIsDisplayed(), BorderTitleBlock::displayBorder(), displayGrid(), BorderTitleBlock::displayTitleBlock(), ExportProperties::draw_border, ExportProperties::draw_colored_conductors, ExportProperties::draw_grid, ExportProperties::draw_terminals, ExportProperties::draw_titleblock, drawColoredConductors(), drawTerminals(), QET::ElementsArea, ExportProperties::exported_area, setDisplayGrid(), setDrawColoredConductors(), setDrawTerminals(), setUseBorder(), BorderTitleBlock::titleBlockIsDisplayed(), and useBorder().
|
inline |
Definition at line 329 of file diagram.h.
References border_and_titleblock, Columns, BorderTitleBlock::columnsAreDisplayed(), EmptyBorder, TitleBlock, and BorderTitleBlock::titleBlockIsDisplayed().
bool Diagram::canRotateSelection | ( | ) | const |
Definition at line 1791 of file diagram.cpp.
References IndependentTextItem::Type, ConductorTextItem::Type, DiagramImageItem::Type, DynamicElementTextItem::Type, and Element::Type.
Referenced by QETDiagramEditor::slot_updateComplexActions().
void Diagram::changeZValue | ( | QET::DepthOption | option | ) |
Diagram::changeZValue Change the Z value of the current selected item, according to .
Definition at line 1300 of file diagram.cpp.
References QET::BringForward, DiagramContent::Elements, DiagramContent::Images, DiagramContent::items(), QET::Lower, QET::Raise, DiagramContent::SelectedOnly, QET::SendBackward, DiagramContent::Shapes, QET::Icons::tr, undoStack(), and Terminal::Z.
Referenced by QETDiagramEditor::setUpActions().
void Diagram::clearEventInterface | ( | ) |
Diagram::clearEventInterface Clear the current event interface.
Definition at line 475 of file diagram.cpp.
References m_event_interface.
|
static |
Definition at line 1706 of file diagram.cpp.
Referenced by DiagramView::contextMenuEvent(), and QETDiagramEditor::slot_updatePasteAction().
QList< Conductor * > Diagram::conductors | ( | ) | const |
Diagram::conductors Return the list containing all conductors.
Definition at line 1490 of file diagram.cpp.
Referenced by freezeConductors(), potentials(), refreshContents(), toXml(), and updateLabels().
QString Diagram::conductorsAutonumName | ( | ) | const |
Diagram::conductorsAutonumName.
Definition at line 488 of file diagram.cpp.
References m_conductors_autonum_name.
Referenced by DiagramPropertiesDialog::DiagramPropertiesDialog(), ConductorAutoNumerotation::newProperties(), ConductorAutoNumerotation::numerateNewConductor(), AutoNumberingDockWidget::setActive(), and AutoNumberingDockWidget::setConductorActive().
DiagramContent Diagram::content | ( | ) | const |
Definition at line 1773 of file diagram.cpp.
References DiagramContent::m_conductors_to_move, DiagramContent::m_elements, and DiagramContent::m_text_fields.
Referenced by potentials(), and updateLabels().
DiagramPosition Diagram::convertPosition | ( | const QPointF & | pos | ) |
pos | Position cartesienne (ex : 10.3, 45.2) a transformer en position dans la grille (ex : B2) |
Definition at line 1637 of file diagram.cpp.
References border_and_titleblock, BorderTitleBlock::convertPosition(), and DiagramPosition::setPosition().
Referenced by autonum::AssignVariables::AssignVariables(), and comparPos().
qreal Diagram::declaredQElectroTechVersion | ( | bool | fallback_to_project = true | ) | const |
fallback_to_project | When a diagram does not have a declared version, this method will use the one declared by its parent project only if fallback_to_project is true. |
Definition at line 1749 of file diagram.cpp.
References diagram_qet_version_, and m_project.
Referenced by fromXml().
|
slot |
Deslectionne tous les objets selectionnes
Definition at line 1222 of file diagram.cpp.
References isEmpty().
|
signal |
Signal emitted when users wish to edit an element from the diagram.
Referenced by Diagram().
|
signal |
Referenced by Diagram(), titleChanged(), and GenericPanel::updateDiagramItem().
|
inline |
Definition at line 290 of file diagram.h.
References draw_grid_.
Referenced by applyProperties().
|
overrideprotected |
Dessine l'arriere-plan du schema, cad la grille.
p | Le QPainter a utiliser pour dessiner |
r | Le rectangle de la zone a dessiner |
Definition at line 131 of file diagram.cpp.
References background_color, border_and_titleblock, BorderTitleBlock::draw(), draw_grid_, BorderTitleBlock::insideBorderRect(), use_border_, xGrid, and yGrid.
|
inline |
Definition at line 352 of file diagram.h.
References draw_colored_conductors_.
Referenced by applyProperties().
|
inline |
Definition at line 347 of file diagram.h.
References draw_terminals_.
Referenced by applyProperties().
|
signal |
Signal emitted when users wish to locate an element from the diagram within elements collection.
Referenced by ElementPropertiesWidget::editElement().
QList< Element * > Diagram::elements | ( | ) | const |
Definition at line 1477 of file diagram.cpp.
Referenced by ElementProvider::find(), ElementProvider::freeElement(), freezeElements(), ElementProvider::fromUuids(), refreshContents(), toXml(), unfreezeElements(), and usesElement().
ElementsMover & Diagram::elementsMover | ( | ) |
Definition at line 1499 of file diagram.cpp.
References m_elements_mover.
Referenced by QetGraphicsItem::mouseMoveEvent(), DiagramTextItem::mouseMoveEvent(), QetGraphicsItem::mouseReleaseEvent(), and DiagramTextItem::mouseReleaseEvent().
ElementTextsMover & Diagram::elementTextsMover | ( | ) |
Definition at line 1503 of file diagram.cpp.
References m_element_texts_mover.
Referenced by ElementTextItemGroup::mouseMoveEvent(), DynamicElementTextItem::mouseMoveEvent(), and ElementTextItemGroup::mouseReleaseEvent().
|
signal |
Referenced by ElementPropertiesWidget::editElement(), and ElementPropertiesWidget::findInPanel().
int Diagram::folioIndex | ( | ) | const |
Definition at line 1738 of file diagram.cpp.
References m_project.
Referenced by autonum::AssignVariables::AssignVariables(), comparPos(), DiagramFolioList::drawBackground(), AutoNumberingManagementW::on_m_apply_folios_rb_clicked(), and ProjectView::updateTabTitle().
void Diagram::folioSequentialsFromXml | ( | const QDomElement & | root, |
QHash< QString, QStringList > * | hash, | ||
const QString & | folioSeq, | ||
const QString & | seq, | ||
const QString & | type, | ||
const QString & | autonumFolioSeqType | ||
) |
Diagram::folioSequentialsFromXml Load folio sequential from QDomElement.
root | containing all folio sequentials |
hash | to be loaded with content |
folioSeq | type |
seq | type |
type | of sequential |
Definition at line 1067 of file diagram.cpp.
References QET::findInDomElement(), and title().
Referenced by fromXml().
void Diagram::folioSequentialsToXml | ( | QHash< QString, QStringList > * | hash, |
QDomElement * | domElement, | ||
const QString & | seq_type, | ||
const QString & | type, | ||
QDomDocument * | doc | ||
) |
Diagram::folioSequentialsToXml.
domElement | to add attributes |
hash | to retrieve content with content |
sequential | type |
Definition at line 779 of file diagram.cpp.
Referenced by toXml().
void Diagram::freezeConductors | ( | bool | freeze | ) |
Diagram::freezeConductors Freeze every existent conductor label.
Definition at line 1571 of file diagram.cpp.
References conductors(), and Conductor::setFreezeLabel().
void Diagram::freezeElements | ( | bool | freeze | ) |
Diagram::freezeElements Freeze every existent element label.
Definition at line 1535 of file diagram.cpp.
References elements(), and Element::freezeLabel().
bool Diagram::freezeNewConductors | ( | ) |
Definition at line 1589 of file diagram.cpp.
References m_freeze_new_conductors_.
Referenced by DiagramEventAddElement::addElement(), and MultiPasteDialog::on_m_button_box_accepted().
bool Diagram::freezeNewElements | ( | ) |
Definition at line 1563 of file diagram.cpp.
References m_freeze_new_elements.
bool Diagram::fromXml | ( | QDomDocument & | document, |
QPointF | position = QPointF() , |
||
bool | consider_informations = true , |
||
DiagramContent * | content_ptr = nullptr |
||
) |
Importe le schema decrit dans un document XML. Si une position est precisee, les elements importes sont positionnes de maniere a ce que le coin superieur gauche du plus petit rectangle pouvant les entourant tous (le bounding rect) soit a cette position.
document | Le document XML a analyser |
position | La position du schema importe |
consider_informations | Si vrai, les informations complementaires (auteur, titre, ...) seront prises en compte |
content_ptr | si ce pointeur vers un DiagramContent est different de 0, il sera rempli avec le contenu ajoute au schema par le fromXml |
Definition at line 804 of file diagram.cpp.
Referenced by fromXml(), initFromXml(), DiagramView::paste(), and MultiPasteDialog::updatePreview().
bool Diagram::fromXml | ( | QDomElement & | document, |
QPointF | position = QPointF() , |
||
bool | consider_informations = true , |
||
DiagramContent * | content_ptr = nullptr |
||
) |
Importe le schema decrit dans un element XML. Si une position est precisee, les elements importes sont positionnes de maniere a ce que le coin superieur gauche du plus petit rectangle pouvant les entourant tous (le bounding rect) soit a cette position.
document | Le document XML a analyser |
position | La position du schema importe |
consider_informations | Si vrai, les informations complementaires (auteur, titre, ...) seront prises en compte |
content_ptr | si ce pointeur vers un DiagramContent est different de 0, il sera rempli avec le contenu ajoute au schema par le fromXml |
Definition at line 844 of file diagram.cpp.
References addItem(), adjustSceneRect(), border_and_titleblock, BorderTitleBlock::borderFromXml(), QET::Icons::Conductor, declaredQElectroTechVersion(), defaultConductorProperties, diagram_qet_version_, QET::findInDomElement(), folioSequentialsFromXml(), ConductorProperties::fromXml(), Element::fromXml(), fromXml(), ElementCollectionHandler::importFromProject(), ElementFactory::Instance(), Conductor::isValid(), m_cnd_hundredfolio_max, m_cnd_tenfolio_max, m_cnd_unitfolio_max, m_conductors_autonum_name, m_elmt_hundredfolio_max, m_elmt_tenfolio_max, m_elmt_unitfolio_max, m_freeze_new_conductors_, m_freeze_new_elements, m_project, ElementsLocation::path(), QETApp::project(), QETProject::ProjectParsingRunning, removeItem(), snapToGrid(), BorderTitleBlock::titleBlockFromXml(), Conductor::valideXml(), and Element::valideXml().
QSize Diagram::imageSize | ( | ) | const |
Permet de connaitre les dimensions qu'aura l'image generee par la methode toImage()
Definition at line 551 of file diagram.cpp.
References border_and_titleblock, BorderTitleBlock::borderAndTitleBlockRect(), margin, and use_border_.
bool Diagram::initFromXml | ( | QDomElement & | document, |
QPointF | position = QPointF() , |
||
bool | consider_informations = true , |
||
DiagramContent * | content_ptr = nullptr |
||
) |
Importe le schema decrit dans un element XML. Cette methode delegue son travail a Diagram::fromXml Si l'import reussit, cette methode initialise egalement le document XML interne permettant de bien gerer l'enregistrement de ce schema dans le projet auquel il appartient.
document | Le document XML a analyser |
position | La position du schema importe |
consider_informations | Si vrai, les informations complementaires (auteur, titre, ...) seront prises en compte |
content_ptr | si ce pointeur vers un DiagramContent est different de 0, il sera rempli avec le contenu ajoute au schema par le fromXml |
Definition at line 824 of file diagram.cpp.
References fromXml().
void Diagram::insertFolioSeqHash | ( | QHash< QString, QStringList > * | hash, |
const QString & | title, | ||
const QString & | type, | ||
NumerotationContext * | nc | ||
) |
Diagram::insertFolioSeqHash This class inserts a stringlist containing all sequential variables related to an autonum in a QHash.
Hash | to be accessed |
autonum | title |
sequential | to be treated |
type | to be treated |
Numerotation | Context to be manipulated |
Definition at line 1263 of file diagram.cpp.
References NumerotationContext::itemAt(), NumerotationContext::replaceValue(), NumerotationContext::size(), and title().
Referenced by loadCndFolioSeq(), and loadElmtFolioSeq().
|
slot |
Inverse l'etat de selection de tous les objets du schema
Definition at line 1231 of file diagram.cpp.
References isEmpty().
bool Diagram::isEmpty | ( | ) | const |
Definition at line 574 of file diagram.cpp.
Referenced by DiagramView::contextMenuActions(), DiagramView::contextMenuEvent(), deselectAll(), invertSelection(), DiagramEventAddImage::openDialog(), selectAll(), and toXml().
bool Diagram::isReadOnly | ( | ) | const |
Definition at line 1764 of file diagram.cpp.
References m_project.
Referenced by addItem(), keyPressEvent(), keyReleaseEvent(), DiagramEventAddShape::mousePressEvent(), removeItem(), RotateSelectionCommand::RotateSelectionCommand(), QETDiagramEditor::rowColumnGroupTriggered(), and QETDiagramEditor::slot_updateComplexActions().
|
overrideprotected |
Diagram::keyPressEvent This event is managed by diagram event interface if any. Else move selected elements.
e |
Definition at line 285 of file diagram.cpp.
References DiagramContent::All, ElementsMover::beginMovement(), ElementsMover::continueMovement(), isReadOnly(), DiagramContent::items(), DiagramEventInterface::keyPressEvent(), DiagramContent::m_elements, m_elements_mover, m_event_interface, undoStack(), xKeyGrid, xKeyGridFine, yKeyGrid, and yKeyGridFine.
|
overrideprotected |
Diagram::keyReleaseEvent This event is managed by diagram event interface if any. Else move selected element.
e |
Definition at line 418 of file diagram.cpp.
References ElementsMover::endMovement(), isReadOnly(), DiagramEventInterface::keyReleaseEvent(), m_elements_mover, and m_event_interface.
|
slot |
Diagram::loadCndFolioSeq This class loads all conductor folio sequential variables related to the current autonum.
Definition at line 1415 of file diagram.cpp.
References QETProject::addConductorAutoNum(), QETProject::conductorAutoNum(), QETProject::conductorCurrentAutoNum(), insertFolioSeqHash(), loadFolioSeqHash(), m_cnd_hundredfolio_max, m_cnd_tenfolio_max, m_cnd_unitfolio_max, autonum::numerotationContextToFormula(), project(), and title().
Referenced by Diagram(), DiagramView::DiagramView(), ProjectView::loadDiagrams(), and AutoNumberingDockWidget::on_m_conductor_cb_activated().
|
slot |
Diagram::loadElmtFolioSeq This class loads all folio sequential variables related to the current autonum.
Definition at line 1357 of file diagram.cpp.
References QETProject::addElementAutoNum(), QETProject::elementAutoNum(), QETProject::elementAutoNumCurrentFormula(), QETProject::elementCurrentAutoNum(), insertFolioSeqHash(), loadFolioSeqHash(), m_elmt_hundredfolio_max, m_elmt_tenfolio_max, m_elmt_unitfolio_max, project(), and title().
Referenced by Diagram(), DiagramView::DiagramView(), ProjectView::loadDiagrams(), and AutoNumberingDockWidget::on_m_element_cb_activated().
void Diagram::loadFolioSeqHash | ( | QHash< QString, QStringList > * | hash, |
const QString & | title, | ||
const QString & | type, | ||
NumerotationContext * | nc | ||
) |
Diagram::loadFolioSeqHash This class loads all folio sequential variables related to the current autonum.
Hash | to be accessed |
autonum | title |
sequential | to be treated |
type | to be treated |
Numerotation | Context to be manipulated |
Definition at line 1284 of file diagram.cpp.
References NumerotationContext::itemAt(), NumerotationContext::replaceValue(), NumerotationContext::size(), and title().
Referenced by loadCndFolioSeq(), and loadElmtFolioSeq().
|
overrideprotected |
Diagram::mouseDoubleClickEvent This event is managed by diagram event interface if any.
event | : |
Definition at line 189 of file diagram.cpp.
References m_event_interface, and DiagramEventInterface::mouseDoubleClickEvent().
|
overrideprotected |
Diagram::mouseMoveEvent This event is managed by diagram event interface if any.
event |
Definition at line 227 of file diagram.cpp.
References m_event_interface, and DiagramEventInterface::mouseMoveEvent().
|
overrideprotected |
Diagram::mousePressEvent This event is managed by diagram event interface if any.
event |
Definition at line 208 of file diagram.cpp.
References m_event_interface, and DiagramEventInterface::mousePressEvent().
|
overrideprotected |
Diagram::mouseReleaseEvent This event is managed by diagram event interface if any.
event |
Definition at line 246 of file diagram.cpp.
References m_event_interface, and DiagramEventInterface::mouseReleaseEvent().
QList< QSet< Conductor * > > Diagram::potentials | ( | ) |
Diagram::potential.
Definition at line 583 of file diagram.cpp.
References DiagramContent::conductors(), conductors(), and content().
QETProject * Diagram::project | ( | ) | const |
Definition at line 1716 of file diagram.cpp.
References m_project.
Referenced by MasterElement::aboutDeleteXref(), DiagramEventAddElement::addElement(), autonum::AssignVariables::assignProjectVar(), ElementTextItemGroup::autoPos(), DiagramEventAddElement::buildElement(), Diagram(), DiagramFolioList::DiagramFolioList(), DiagramPropertiesDialog::DiagramPropertiesDialog(), DiagramFolioList::drawBackground(), DiagramPropertiesDialog::editAutoFolioNum(), DiagramPropertiesDialog::editAutonum(), CrossRefItem::elementPositionText(), DiagramView::handleTitleBlockDrop(), CrossRefItem::init(), MasterElement::linkToElement(), loadCndFolioSeq(), loadElmtFolioSeq(), ConductorAutoNumerotation::newProperties(), ConductorAutoNumerotation::numerateNewConductor(), MultiPasteDialog::on_m_button_box_accepted(), refreshContents(), DynamicElementTextItem::removeConnectionForReportFormula(), DynamicElementTextItem::reportChanged(), DynamicElementTextItem::reportFormulaChanged(), DynamicElementTextItem::setConnectionForReportFormula(), MasterPropertiesWidget::setElement(), ElementTextItemGroup::setHoldToBottomPage(), setProject(), CrossRefItem::setUpConnection(), Conductor::setUpConnectionForFormula(), Element::setUpFormula(), DynamicElementTextItem::setupFormulaConnection(), undoStack(), CrossRefItem::updateProperties(), ElementTextItemGroup::updateXref(), DynamicElementTextItem::updateXref(), MasterElement::xrefPropertiesChanged(), and DiagramFolioList::~DiagramFolioList().
|
inline |
Definition at line 342 of file diagram.h.
References qgi_manager_.
Referenced by DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand(), and DeleteQGraphicsItemCommand::~DeleteQGraphicsItemCommand().
void Diagram::refreshContents | ( | ) |
Diagram::refreshContents refresh all content of diagram.
Definition at line 1089 of file diagram.cpp.
References conductors(), elements(), and project().
|
virtual |
Diagram::removeItem Réimplemented from QGraphicsScene::removeItem(QGraphicsItem *item) Do some specific operation if item need it (for exemple an element)
item |
Definition at line 1133 of file diagram.cpp.
References isReadOnly(), Terminal::removeConductor(), Conductor::terminal1, Conductor::terminal2, Conductor::Type, Element::Type, and Element::unlinkAllElements().
Referenced by fromXml(), DiagramEventAddShape::mouseReleaseEvent(), DeleteQGraphicsItemCommand::redo(), PasteDiagramCommand::undo(), MultiPasteDialog::updatePreview(), DiagramEventAddImage::~DiagramEventAddImage(), DiagramEventAddShape::~DiagramEventAddShape(), and MultiPasteDialog::~MultiPasteDialog().
|
slot |
Selectionne tous les objets du schema
Definition at line 1210 of file diagram.cpp.
References isEmpty().
QSet< Conductor * > Diagram::selectedConductors | ( | ) | const |
Definition at line 1695 of file diagram.cpp.
Referenced by QETDiagramEditor::slot_updateComplexActions().
|
inline |
Set the rendering options for the diagram border (including rows/colums headers and the title block)
bo | Enabled options ORed together |
Definition at line 319 of file diagram.h.
References border_and_titleblock, Columns, BorderTitleBlock::displayBorder(), BorderTitleBlock::displayColumns(), BorderTitleBlock::displayTitleBlock(), EmptyBorder, and TitleBlock.
|
inline |
void Diagram::setConductorsAutonumName | ( | const QString & | name | ) |
Diagram::setConductorsAutonumName.
name,name | of autonum to use. |
Definition at line 496 of file diagram.cpp.
References m_conductors_autonum_name.
Referenced by DiagramPropertiesDialog::DiagramPropertiesDialog(), and AutoNumberingDockWidget::on_m_conductor_cb_activated().
|
inline |
Set the start point of the conductor setter.
start | the point (in scene coordinates) which the newly created conductor should start from. |
Definition at line 266 of file diagram.h.
References conductor_setter_.
|
inline |
Set the end point of the conductor setter.
end | the point (in scene coordinates) upon to which the newly created conductor should be drawn. |
Definition at line 275 of file diagram.h.
References conductor_setter_.
|
inline |
Set whether the diagram grid should be drawn.
dg | true to render the grid, false otherwise. |
Definition at line 283 of file diagram.h.
References draw_grid_.
Referenced by DiagramView::adjustGridToZoom(), applyProperties(), and QETDiagramEditor::setUpActions().
void Diagram::setDrawColoredConductors | ( | bool | dcc | ) |
Definit s'il faut respecter ou non les couleurs des conducteurs. Si non, les conducteurs sont tous dessines en noir.
dcc | true pour respecter les couleurs, false sinon |
Definition at line 1688 of file diagram.cpp.
References draw_colored_conductors_.
Referenced by applyProperties().
void Diagram::setDrawTerminals | ( | bool | dt | ) |
Definit s'il faut afficher ou non les bornes
dt | true pour afficher les bornes, false sinon |
Definition at line 1675 of file diagram.cpp.
Referenced by applyProperties().
void Diagram::setEventInterface | ( | DiagramEventInterface * | event_interface | ) |
Diagram::setEventInterface Set event_interface has current interface. Diagram become the ownership of event_interface If there is a previous interface, they will be delete before and call init() to the new interface.
event_interface |
Definition at line 455 of file diagram.cpp.
References DiagramEventInterface::finish(), and m_event_interface.
Referenced by QETDiagramEditor::addItemGroupTriggered(), and DiagramView::handleElementDrop().
void Diagram::setFreezeNewConductors | ( | bool | b | ) |
Diagram::setfreezeNewConductors Set new conductor label to be frozen.
Definition at line 1581 of file diagram.cpp.
References m_freeze_new_conductors_.
void Diagram::setFreezeNewElements | ( | bool | b | ) |
Diagram::freezeNewElements Set new element label to be frozen.
Definition at line 1555 of file diagram.cpp.
References m_freeze_new_elements.
void Diagram::setProject | ( | QETProject * | project | ) |
Diagram::setProject Set parent project of this diagram, project also become the parent QObject of this diagram.
project | new project |
Definition at line 1725 of file diagram.cpp.
References m_project, and project().
Referenced by Diagram().
|
slot |
Set the template to use to render the title block of this diagram.
template_name | Name of the title block template. |
Definition at line 1195 of file diagram.cpp.
References border_and_titleblock, QETProject::embeddedTitleBlockTemplatesCollection(), TitleBlockTemplatesProjectCollection::getTemplate(), m_project, BorderTitleBlock::titleBlockTemplateName(), BorderTitleBlock::titleBlockTemplateRemoved(), and usedTitleBlockTemplateChanged().
Referenced by Diagram().
|
inline |
Set whether the diagram border (including rows/colums headers and the title block) should be rendered along with the diagram. When set to false, the size of the smallest rectangle containing all items is considered as the diagram size.
ub | true to take the border into account, false otherwise |
Definition at line 301 of file diagram.h.
References use_border_.
Referenced by applyProperties().
|
inline |
Definition at line 150 of file diagram.h.
References showDiagram().
Referenced by CrossRefItem::mouseDoubleClickEvent(), ElementTextItemGroup::mouseDoubleClickEvent(), LinkSingleElementWidget::on_m_show_linked_pb_clicked(), LinkSingleElementWidget::on_m_tree_widget_itemDoubleClicked(), RotateSelectionCommand::redo(), LinkElementCommand::redo(), RotateSelectionCommand::undo(), DeleteQGraphicsItemCommand::undo(), LinkElementCommand::undo(), and DynamicElementTextItem::zoomToLinkedElement().
|
static |
Diagram::snapToGrid Return a nearest snap point of p.
p | point to find the nearest snaped point |
Definition at line 1653 of file diagram.cpp.
Referenced by ElementTextsMover::continueMovement(), fromXml(), QetShapeItem::handlerMouseMoveEvent(), Conductor::handlerMouseMoveEvent(), QetShapeItem::insertPoint(), DiagramEventAddShape::mouseMoveEvent(), DiagramEventAddElement::mouseMoveEvent(), ConductorTextItem::mouseMoveEvent(), ElementTextItemGroup::mouseMoveEvent(), DiagramTextItem::mouseMoveEvent(), DynamicElementTextItem::mouseMoveEvent(), DiagramEventAddShape::mousePressEvent(), DiagramEventAddShape::mouseReleaseEvent(), QetShapeItem::setNextPoint(), QetGraphicsItem::setPos(), and DiagramEventAddShape::updateHelpCross().
QString Diagram::title | ( | ) | const |
Definition at line 1473 of file diagram.cpp.
References border_and_titleblock, and BorderTitleBlock::title().
Referenced by DiagramFolioList::drawBackground(), DiagramFolioList::fillRow(), folioSequentialsFromXml(), insertFolioSeqHash(), loadCndFolioSeq(), loadElmtFolioSeq(), loadFolioSeqHash(), AutoNumberingManagementW::on_m_apply_folios_rb_clicked(), FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked(), QETProject::readDiagramsXml(), titleChanged(), and ProjectView::updateTabTitle().
|
slot |
This slot may be used to inform the diagram object that the given title block template has changed. The diagram will thus flush its title block-dedicated rendering cache.
template_name | Name of the title block template that has changed |
Definition at line 1168 of file diagram.cpp.
References border_and_titleblock, BorderTitleBlock::titleBlockTemplateChanged(), and BorderTitleBlock::titleBlockTemplateName().
|
slot |
This slot has to be be used to inform this class that the given title block template is about to be removed and is no longer accessible. This class will either use the provided optional TitleBlockTemplate or the default title block provided by QETApp::defaultTitleBlockTemplate()
template_name | Name of the title block template that has changed |
new_template | (Optional) Name of the title block template to use instead |
Definition at line 1183 of file diagram.cpp.
References border_and_titleblock, QETProject::embeddedTitleBlockTemplatesCollection(), TitleBlockTemplatesProjectCollection::getTemplate(), m_project, BorderTitleBlock::titleBlockTemplateName(), and BorderTitleBlock::titleBlockTemplateRemoved().
|
slot |
Definition at line 1158 of file diagram.cpp.
References diagramTitleChanged(), and title().
Referenced by Diagram().
bool Diagram::toPaintDevice | ( | QPaintDevice & | pix, |
int | width = -1 , |
||
int | height = -1 , |
||
Qt::AspectRatioMode | aspectRatioMode = Qt::KeepAspectRatio |
||
) |
Exporte le schema vers une image
Definition at line 504 of file diagram.cpp.
References border_and_titleblock, BorderTitleBlock::borderAndTitleBlockRect(), margin, and use_border_.
QDomDocument Diagram::toXml | ( | bool | whole_content = true | ) |
Exporte tout ou partie du schema
whole_content | Booleen (a vrai par defaut) indiquant si le XML genere doit representer l'integralite du schema ou seulement le contenu selectionne |
Definition at line 604 of file diagram.cpp.
References border_and_titleblock, BorderTitleBlock::borderToXml(), conductors(), defaultConductorProperties, elements(), folioSequentialsToXml(), isEmpty(), m_cnd_hundredfolio_max, m_cnd_tenfolio_max, m_cnd_unitfolio_max, m_conductors_autonum_name, m_elmt_hundredfolio_max, m_elmt_tenfolio_max, m_elmt_unitfolio_max, m_freeze_new_conductors_, m_freeze_new_elements, m_project, QETApp::projectId(), BorderTitleBlock::titleBlockToXml(), ConductorProperties::toXml(), and QET::version.
Referenced by MultiPasteDialog::MultiPasteDialog(), and QETProject::toXml().
|
inline |
Definition at line 337 of file diagram.h.
References project(), and QETProject::undoStack().
Referenced by ImagePropertiesWidget::apply(), IndiTextPropertiesWidget::apply(), ShapeGraphicsItemPropertiesWidget::apply(), ImportElementTextPattern::apply(), ConductorAutoNumerotation::applyText(), changeZValue(), ConductorCreator::ConductorCreator(), Conductor::displayedTextChanged(), ElementTextsMover::endMovement(), IndependentTextItem::focusOutEvent(), QetShapeItem::handlerMouseReleaseEvent(), DiagramView::handleTitleBlockDrop(), QetShapeItem::insertPoint(), ElementTextItemGroup::keyPressEvent(), keyPressEvent(), DiagramEventAddShape::mouseDoubleClickEvent(), DiagramEventAddShape::mousePressEvent(), PotentialSelectorDialog::on_buttonBox_accepted(), MultiPasteDialog::on_m_button_box_accepted(), ConductorPropertiesDialog::PropertiesDialog(), QetShapeItem::removePoint(), QETDiagramEditor::rowColumnGroupTriggered(), QETDiagramEditor::selectionGroupTriggered(), and ~Diagram().
void Diagram::unfreezeElements | ( | ) |
Diagram::unfreezeElements Unfreeze every existent element label.
Definition at line 1545 of file diagram.cpp.
References elements(), and Element::freezeLabel().
|
slot |
Diagram::updateLabels Update elements and conductors that reference folio field in their labels.
Definition at line 1245 of file diagram.cpp.
References conductors(), and content().
Referenced by Diagram().
|
inline |
Definition at line 309 of file diagram.h.
References use_border_.
Referenced by applyProperties().
|
signal |
Referenced by setTitleBlockTemplate().
bool Diagram::usesElement | ( | const ElementsLocation & | location | ) |
Permet de savoir si un element est utilise sur un schema
location | Emplacement d'un element |
Definition at line 1512 of file diagram.cpp.
References elements().
bool Diagram::usesTitleBlockTemplate | ( | const QString & | name | ) |
a | title block template name |
Definition at line 1527 of file diagram.cpp.
References border_and_titleblock, and BorderTitleBlock::titleBlockTemplateName().
|
overrideprotected |
Diagram::wheelEvent This event is managed by diagram event interface if any.
event |
Definition at line 265 of file diagram.cpp.
References m_event_interface, and DiagramEventInterface::wheelEvent().
|
static |
background color of diagram
Definition at line 91 of file diagram.h.
Referenced by DiagramPrintDialog::DiagramPrintDialog(), DiagramFolioList::drawBackground(), drawBackground(), Terminal::paint(), QETDiagramEditor::setUpActions(), DiagramEventAddShape::updateHelpCross(), and DiagramPrintDialog::~DiagramPrintDialog().
BorderTitleBlock Diagram::border_and_titleblock |
Diagram dimensions and title block.
Definition at line 74 of file diagram.h.
Referenced by adjustSceneRect(), applyProperties(), autonum::AssignVariables::assignTitleBlockVar(), autonum::AssignVariables::AssignVariables(), borderOptions(), convertPosition(), Diagram(), DiagramFolioList::drawBackground(), drawBackground(), fromXml(), nomenclature::getElementInfo(), DiagramView::handleTitleBlockDrop(), imageSize(), DynamicElementTextItem::removeConnectionForReportFormula(), SearchAndReplaceWorker::replaceAdvanced(), QETDiagramEditor::rowColumnGroupTriggered(), SearchAndReplaceWidget::searchTerms(), setBorderOptions(), DynamicElementTextItem::setConnectionForReportFormula(), AutoNumberingDockWidget::setProject(), setTitleBlockTemplate(), DynamicElementTextItem::setupFormulaConnection(), title(), titleBlockTemplateChanged(), titleBlockTemplateRemoved(), toPaintDevice(), toXml(), GenericPanel::updateDiagramItem(), DiagramEventAddShape::updateHelpCross(), ProjectView::updateTabTitle(), and usesTitleBlockTemplate().
|
private |
Definition at line 102 of file diagram.h.
Referenced by Diagram(), setConductorStart(), setConductorStop(), and ~Diagram().
ConductorProperties Diagram::defaultConductorProperties |
Default properties for new conductors.
Definition at line 72 of file diagram.h.
Referenced by Conductor::Conductor(), fromXml(), and toXml().
|
private |
Definition at line 110 of file diagram.h.
Referenced by declaredQElectroTechVersion(), and fromXml().
|
private |
Definition at line 115 of file diagram.h.
Referenced by drawColoredConductors(), and setDrawColoredConductors().
|
private |
Definition at line 112 of file diagram.h.
Referenced by displayGrid(), drawBackground(), and setDisplayGrid().
|
private |
Definition at line 114 of file diagram.h.
Referenced by drawTerminals().
QHash<QString, QStringList> Diagram::m_cnd_hundredfolio_max |
Definition at line 99 of file diagram.h.
Referenced by fromXml(), loadCndFolioSeq(), and toXml().
QHash<QString, QStringList> Diagram::m_cnd_tenfolio_max |
Definition at line 98 of file diagram.h.
Referenced by fromXml(), loadCndFolioSeq(), and toXml().
QHash<QString, QStringList> Diagram::m_cnd_unitfolio_max |
Hash containing max values for folio sequential autonums in this diagram.
Definition at line 97 of file diagram.h.
Referenced by fromXml(), loadCndFolioSeq(), and toXml().
|
private |
Definition at line 117 of file diagram.h.
Referenced by conductorsAutonumName(), fromXml(), setConductorsAutonumName(), and toXml().
|
private |
Definition at line 104 of file diagram.h.
Referenced by elementTextsMover().
|
private |
Definition at line 103 of file diagram.h.
Referenced by elementsMover(), keyPressEvent(), and keyReleaseEvent().
QHash<QString, QStringList> Diagram::m_elmt_hundredfolio_max |
Definition at line 95 of file diagram.h.
Referenced by fromXml(), loadElmtFolioSeq(), autonum::setSequential(), and toXml().
QHash<QString, QStringList> Diagram::m_elmt_tenfolio_max |
Definition at line 94 of file diagram.h.
Referenced by fromXml(), loadElmtFolioSeq(), autonum::setSequential(), and toXml().
QHash<QString, QStringList> Diagram::m_elmt_unitfolio_max |
Hash containing max values for folio sequential autonums in this diagram.
Definition at line 93 of file diagram.h.
Referenced by fromXml(), loadElmtFolioSeq(), autonum::setSequential(), and toXml().
|
private |
Definition at line 118 of file diagram.h.
Referenced by clearEventInterface(), keyPressEvent(), keyReleaseEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), setEventInterface(), wheelEvent(), and ~Diagram().
|
private |
Definition at line 121 of file diagram.h.
Referenced by freezeNewConductors(), fromXml(), setFreezeNewConductors(), and toXml().
|
private |
Definition at line 120 of file diagram.h.
Referenced by freezeNewElements(), fromXml(), setFreezeNewElements(), and toXml().
|
private |
Definition at line 106 of file diagram.h.
Referenced by declaredQElectroTechVersion(), folioIndex(), fromXml(), isReadOnly(), project(), setProject(), setTitleBlockTemplate(), titleBlockTemplateRemoved(), and toXml().
|
static |
margin around the diagram
Definition at line 88 of file diagram.h.
Referenced by DiagramView::adjustSceneRect(), BorderTitleBlock::columnsRect(), ExportDialog::generateDxf(), imageSize(), BorderTitleBlock::insideBorderRect(), BorderTitleBlock::outsideBorderRect(), BorderTitleBlock::rowsRect(), toPaintDevice(), and BorderTitleBlock::updateRectangles().
|
private |
Definition at line 105 of file diagram.h.
Referenced by Diagram(), qgiManager(), and ~Diagram().
|
private |
Definition at line 113 of file diagram.h.
Referenced by drawBackground(), imageSize(), setUseBorder(), toPaintDevice(), and useBorder().
|
static |
abscissa grid step size
Definition at line 76 of file diagram.h.
Referenced by drawBackground(), Conductor::generateConductorPath(), and snapToGrid().
|
static |
|
static |
|
static |
ordinate grid step size
Definition at line 78 of file diagram.h.
Referenced by drawBackground(), Conductor::generateConductorPath(), and snapToGrid().
|
static |
|
static |