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

The Diagram class This class represents an electric diagram. It manages its various child elements, conductors and texts and handles their graphic rendering. More...

#include <diagram.h>

Inherits QGraphicsScene.

Collaboration diagram for Diagram:
Collaboration graph

Public Types

enum  BorderOptions { EmptyBorder, TitleBlock, Columns }
 The BorderOptions enum Represents available options when rendering a particular diagram: EmptyBorder: display border only TitleBlock: display title block Columns: display columns. More...
 
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 &)
 Diagram::titleChanged emit(diagramTitleChanged(this, title));. More...
 
void titleBlockTemplateChanged (const QString &)
 Diagram::titleBlockTemplateChanged 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. More...
 
void titleBlockTemplateRemoved (const QString &, const QString &=QString())
 Diagram::titleBlockTemplateRemoved 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() More...
 
void setTitleBlockTemplate (const QString &)
 Diagram::setTitleBlockTemplate Set the template to use to render the title block of this diagram. More...
 
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 ()
 Diagram::selectAll Select all schema objects. More...
 
void deselectAll ()
 Diagram::deselectAll Deselects all selected objects. More...
 
void invertSelection ()
 Diagram::invertSelection Reverses the selection state of all schema objects Inverse l'etat de selection de tous les objets du schema. More...
 

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 edit an element from the diagram. More...
 
void diagramActivated ()
 

Public Member Functions

QUuid uuid ()
 Diagram::uuid. 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...
 
QETProjectproject () const
 Diagram::project. More...
 
int folioIndex () const
 Diagram::folioIndex. More...
 
qreal declaredQElectroTechVersion (bool=true) const
 Diagram::declaredQElectroTechVersion. More...
 
void showMe ()
 
bool isReadOnly () const
 Diagram::isReadOnly. More...
 
void setConductor (bool)
 Diagram::setConductor Display or hide the conductor setter, i.e. a dashed conductor stub which appears when creating a conductor between two terminals. More...
 
void setConductorStart (QPointF)
 Diagram::setConductorStart Set the start point of the conductor setter. More...
 
void setConductorStop (QPointF)
 Diagram::setConductorStop Set the end point of the conductor setter. More...
 
QList< QSet< Conductor * > > potentials ()
 Diagram::potential. More...
 
QDomDocument toXml (bool=true)
 Diagram::toXml Exports all or part of the schema. More...
 
bool initFromXml (QDomElement &, QPointF=QPointF(), bool=true, DiagramContent *=nullptr)
 Diagram::initFromXml Imports the described schema in an XML element. This method delegates its work to Diagram :: fromXml If the import is successful, this method also initializes the XML document internal allowing to manage the recording of this diagram in the project to which it belongs. More...
 
bool fromXml (QDomDocument &, QPointF=QPointF(), bool=true, DiagramContent *=nullptr)
 Diagram::fromXml Imports the described schema into an XML document. If a position is specified, the imported elements are positioned so that the upper left corner of the smallest rectangle that can surround them all (the bounding rect) is at this position. More...
 
bool fromXml (QDomElement &, QPointF=QPointF(), bool=true, DiagramContent *=nullptr)
 Diagram::fromXml Imports the described schema in an XML element. If a position is specified, the imported elements are positioned in such a way that the upper left corner of the smallest rectangle that can surround them all (the bounding rect) either at this position. More...
 
void folioSequentialsToXml (QHash< QString, QStringList > *, QDomElement *, const QString &, const QString &, QDomDocument *)
 Diagram::folioSequentialsToXml Add folio sequential to QDomElement. 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 Reimplemented from QGraphicsScene::removeItem(QGraphicsItem *item) Do some specific operation if item need it (for exemple an element) More...
 
ExportProperties applyProperties (const ExportProperties &)
 Diagram::applyProperties This method allows you to apply new rendering options while accessing the current rendering properties. More...
 
void setDisplayGrid (bool)
 Diagram::setDisplayGrid Set whether the diagram grid should be drawn. More...
 
bool displayGrid ()
 Diagram::displayGrid. More...
 
void setUseBorder (bool)
 Diagram::setUseBorder 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. More...
 
bool useBorder ()
 Diagram::useBorder. More...
 
void setBorderOptions (BorderOptions)
 Diagram::setBorderOptions Set the rendering options for the diagram border (including rows/colums headers and the title block) More...
 
BorderOptions borderOptions ()
 Diagram::borderOptions. More...
 
DiagramPosition convertPosition (const QPointF &)
 Diagram::convertPosition. More...
 
bool drawTerminals () const
 Diagram::drawTerminals. More...
 
void setDrawTerminals (bool)
 Diagram::setDrawTerminals Defines whether or not to display the terminals. More...
 
bool drawColoredConductors () const
 Diagram::drawColoredConductors. More...
 
void setDrawColoredConductors (bool)
 Diagram::setDrawColoredConductors Defines whether or not to respect the colors of the conductors. If not, the conductors are all drawn in black. More...
 
QString title () const
 Diagram::title. More...
 
bool toPaintDevice (QPaintDevice &, int=-1, int=-1, Qt::AspectRatioMode=Qt::KeepAspectRatio)
 
QSize imageSize () const
 Diagram::imageSize Allows you to know the dimensions that the image generated by the toImage() method will have. More...
 
bool isEmpty () const
 Diagram::isEmpty An empty schema contains no element, conductor, or text field. More...
 
QList< Element * > elements () const
 Diagram::elements. More...
 
QList< Conductor * > conductors () const
 Diagram::conductors. More...
 
QSet< Conductor * > selectedConductors () const
 Diagram::selectedConductors. More...
 
DiagramContent content () const
 Diagram::content. More...
 
bool canRotateSelection () const
 Diagram::canRotateSelection. More...
 
ElementsMoverelementsMover ()
 Diagram::elementsMover. More...
 
ElementTextsMoverelementTextsMover ()
 Diagram::elementTextsMover. More...
 
bool usesElement (const ElementsLocation &)
 Diagram::usesElement Used to find out if an element is used on a schema. More...
 
bool usesTitleBlockTemplate (const QString &)
 Diagram::usesTitleBlockTemplate. More...
 
QUndoStack & undoStack ()
 Diagram::undoStack. More...
 
QGIManagerqgiManager ()
 Diagram::qgiManager. More...
 
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 option. More...
 

Static Public Member Functions

static bool clipboardMayContainDiagram ()
 Diagram::clipboardMayContainDiagram. More...
 
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
 Diagram::drawBackground Draw the background of the diagram, ie the grid. More...
 
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 (QETProject *project)
 Diagram::Diagram Constructor. More...
 
 ~Diagram () override
 Diagram::~Diagram Destructor. More...
 
 Diagram (const Diagram &diagram)
 

Private Attributes

friend DiagramFolioList
 
friend QETProject
 
QGraphicsLineItem * conductor_setter_
 
ElementsMover m_elements_mover
 
ElementTextsMover m_element_texts_mover
 
QGIManagerqgi_manager_
 
QETProjectm_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
 
DiagramEventInterfacem_event_interface
 
bool m_freeze_new_elements
 
bool m_freeze_new_conductors_
 
QUuid m_uuid = QUuid::createUuid()
 

Detailed Description

The Diagram class This class represents an electric diagram. It manages its various child elements, conductors and texts and handles their graphic rendering.

Member Enumeration Documentation

◆ BorderOptions

The BorderOptions enum Represents available options when rendering a particular diagram: EmptyBorder: display border only TitleBlock: display title block Columns: display columns.

Enumerator
EmptyBorder 
TitleBlock 
Columns 

◆ NumerotationType

Represents available option of Numerotation type.

Enumerator
Conductors 

Constructor & Destructor Documentation

◆ Diagram() [1/2]

Diagram::Diagram ( QETProject project)
private

Diagram::Diagram Constructor.

Parameters
project: The project of this diagram and also parent QObject
Here is the call graph for this function:

◆ ~Diagram()

Diagram::~Diagram ( )
overrideprivate

Diagram::~Diagram Destructor.

Here is the call graph for this function:

◆ Diagram() [2/2]

Diagram::Diagram ( const Diagram diagram)
private

Member Function Documentation

◆ addItem()

void Diagram::addItem ( QGraphicsItem *  item)
virtual

Diagram::addItem Réimplemented from QGraphicsScene::addItem(QGraphicsItem *item) Do some specific operation if item need it (for exemple an element)

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

◆ adjustSceneRect

void Diagram::adjustSceneRect ( )
slot

Diagram::adjustSceneRect Recalcul and adjust the size of the scene.

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

◆ applyProperties()

ExportProperties Diagram::applyProperties ( const ExportProperties new_properties)

Diagram::applyProperties This method allows you to apply new rendering options while accessing the current rendering properties.

Parameters
new_properties: New rendering options to apply
Returns
rendering options before applying new_properties
Here is the call graph for this function:

◆ borderOptions()

Diagram::BorderOptions Diagram::borderOptions ( )
inline

Diagram::borderOptions.

Returns
The rendering optios for the diagram border
See also
setBorderOptions
Here is the call graph for this function:

◆ canRotateSelection()

bool Diagram::canRotateSelection ( ) const

Diagram::canRotateSelection.

Returns
True if a least one of selected items can be rotated
Here is the caller graph for this function:

◆ changeZValue()

void Diagram::changeZValue ( QET::DepthOption  option)

Diagram::changeZValue Change the Z value of the current selected item, according to option.

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

◆ clearEventInterface()

void Diagram::clearEventInterface ( )

Diagram::clearEventInterface Clear the current event interface.

◆ clipboardMayContainDiagram()

bool Diagram::clipboardMayContainDiagram ( )
static

Diagram::clipboardMayContainDiagram.

Returns
true if the clipboard appears to contain a schema
Here is the caller graph for this function:

◆ conductors()

QList< Conductor * > Diagram::conductors ( ) const

Diagram::conductors.

Returns
the list containing all conductors
Here is the caller graph for this function:

◆ conductorsAutonumName()

QString Diagram::conductorsAutonumName ( ) const

Diagram::conductorsAutonumName.

Returns
the name of autonum to use.
Here is the caller graph for this function:

◆ content()

DiagramContent Diagram::content ( ) const

Diagram::content.

Returns
The content of the diagram. The conductors are all seated in conductorsToMove.
Here is the caller graph for this function:

◆ convertPosition()

DiagramPosition Diagram::convertPosition ( const QPointF &  pos)

Diagram::convertPosition.

Parameters
pos: Cartesian position (ex: 10.3, 45.2) to transform into position in the grid (ex: B2)
Returns
a position in the grid corresponding to pos
Here is the call graph for this function:
Here is the caller graph for this function:

◆ declaredQElectroTechVersion()

qreal Diagram::declaredQElectroTechVersion ( bool  fallback_to_project = true) const

Diagram::declaredQElectroTechVersion.

Parameters
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.
Returns
the declared QElectroTech version of this diagram
Here is the caller graph for this function:

◆ deselectAll

void Diagram::deselectAll ( )
slot

Diagram::deselectAll Deselects all selected objects.

Here is the call graph for this function:

◆ diagramActivated

void Diagram::diagramActivated ( )
signal
Here is the caller graph for this function:

◆ diagramTitleChanged

void Diagram::diagramTitleChanged ( Diagram ,
const QString &   
)
signal
Here is the caller graph for this function:

◆ displayGrid()

bool Diagram::displayGrid ( )
inline

Diagram::displayGrid.

Returns
draw_grid_ true if the grid is drawn, false otherwise.
Here is the caller graph for this function:

◆ drawBackground()

void Diagram::drawBackground ( QPainter *  p,
const QRectF &  r 
)
overrideprotected

Diagram::drawBackground Draw the background of the diagram, ie the grid.

Parameters
p: The QPainter to use for drawing
r: The rectangle of the area to be drawn
Here is the call graph for this function:

◆ drawColoredConductors()

bool Diagram::drawColoredConductors ( ) const
inline

Diagram::drawColoredConductors.

Returns
true if conductors colors are rendered, false otherwise.
Here is the caller graph for this function:

◆ drawTerminals()

bool Diagram::drawTerminals ( ) const
inline

Diagram::drawTerminals.

Returns
true if terminals are rendered, false otherwise
Here is the caller graph for this function:

◆ editElementRequired

void Diagram::editElementRequired ( const ElementsLocation )
signal

Signal emitted when users wish to edit an element from the diagram.

Here is the caller graph for this function:

◆ elements()

QList< Element * > Diagram::elements ( ) const

Diagram::elements.

Returns
the list containing all elements
Here is the caller graph for this function:

◆ elementsMover()

ElementsMover & Diagram::elementsMover ( )

Diagram::elementsMover.

Returns
Here is the caller graph for this function:

◆ elementTextsMover()

ElementTextsMover & Diagram::elementTextsMover ( )

Diagram::elementTextsMover.

Returns
Here is the caller graph for this function:

◆ findElementRequired

void Diagram::findElementRequired ( const ElementsLocation )
signal

Signal emitted when users wish to locate an element from the diagram within elements collection

Here is the caller graph for this function:

◆ folioIndex()

int Diagram::folioIndex ( ) const

Diagram::folioIndex.

Returns
the folio number of this diagram within its parent project, or -1 if it is has no parent project
Here is the caller graph for this function:

◆ folioSequentialsFromXml()

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.

Parameters
rootcontaining all folio sequentials
hash: to be loaded with content
folioSeqtype
seqtype
typeof sequential
autonumFolioSeqType
Here is the call graph for this function:
Here is the caller graph for this function:

◆ folioSequentialsToXml()

void Diagram::folioSequentialsToXml ( QHash< QString, QStringList > *  hash,
QDomElement *  domElement,
const QString &  seq_type,
const QString &  type,
QDomDocument *  doc 
)

Diagram::folioSequentialsToXml Add folio sequential to QDomElement.

Parameters
hashto retrieve content with content
domElementto add attributes
seq_typetype
type
doc
Here is the caller graph for this function:

◆ freezeConductors()

void Diagram::freezeConductors ( bool  freeze)

Diagram::freezeConductors Freeze every existent conductor label.

Here is the call graph for this function:

◆ freezeElements()

void Diagram::freezeElements ( bool  freeze)

Diagram::freezeElements Freeze every existent element label.

Here is the call graph for this function:

◆ freezeNewConductors()

bool Diagram::freezeNewConductors ( )

Diagram::freezeNewConductors.

Returns
current freeze new conductor status .
Here is the caller graph for this function:

◆ freezeNewElements()

bool Diagram::freezeNewElements ( )

Diagram::freezeNewElements.

Returns
current freeze new element status .

◆ fromXml() [1/2]

bool Diagram::fromXml ( QDomDocument &  document,
QPointF  position = QPointF(),
bool  consider_informations = true,
DiagramContent content_ptr = nullptr 
)

Diagram::fromXml Imports the described schema into an XML document. If a position is specified, the imported elements are positioned so that the upper left corner of the smallest rectangle that can surround them all (the bounding rect) is at this position.

Parameters
document: The XML document to analyze
position: The position of the diagram matters
consider_informations: If true, additional information (author, title, ...) will be taken into account
content_ptr: if this pointer to a DiagramContent is different from 0, it will be filled with the content added to the schema by the fromXml
Returns
true if the import was successful, false otherwise
Here is the caller graph for this function:

◆ fromXml() [2/2]

bool Diagram::fromXml ( QDomElement &  document,
QPointF  position = QPointF(),
bool  consider_informations = true,
DiagramContent content_ptr = nullptr 
)

Diagram::fromXml Imports the described schema in an XML element. If a position is specified, the imported elements are positioned in such a way that the upper left corner of the smallest rectangle that can surround them all (the bounding rect) either at this position.

Parameters
document: The XML document to analyze
position: The position of the diagram matters
consider_informations: If true, additional information (author, title, ...) will be taken into account
content_ptr: if this pointer to a DiagramContent is different from 0, it will be filled with the content added to the schema by the fromXml
Returns
true if the import was successful, false otherwise
Here is the call graph for this function:

◆ imageSize()

QSize Diagram::imageSize ( ) const

Diagram::imageSize Allows you to know the dimensions that the image generated by the toImage() method will have.

Returns
The size of the image generated by toImage()
Here is the call graph for this function:

◆ initFromXml()

bool Diagram::initFromXml ( QDomElement &  document,
QPointF  position = QPointF(),
bool  consider_informations = true,
DiagramContent content_ptr = nullptr 
)

Diagram::initFromXml Imports the described schema in an XML element. This method delegates its work to Diagram :: fromXml If the import is successful, this method also initializes the XML document internal allowing to manage the recording of this diagram in the project to which it belongs.

See also
Diagram::fromXml
Parameters
document: The XML document to analyze
position: The position of the diagram matters
consider_informations: If true, additional information (author, title, ...) will be taken into account
content_ptr: if this pointer to a DiagramContent is different from 0, it will be filled with the content added to the schema by the fromXml
Returns
true if the import was successful, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertFolioSeqHash()

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.

Parameters
hash: to be accessed
title: autonum title
type: to be treated
nc: Context to be manipulated
Here is the call graph for this function:
Here is the caller graph for this function:

◆ invertSelection

void Diagram::invertSelection ( )
slot

Diagram::invertSelection Reverses the selection state of all schema objects Inverse l'etat de selection de tous les objets du schema.

Here is the call graph for this function:

◆ isEmpty()

bool Diagram::isEmpty ( ) const

Diagram::isEmpty An empty schema contains no element, conductor, or text field.

Returns
true if the schema is considered empty, false otherwise.
Here is the caller graph for this function:

◆ isReadOnly()

bool Diagram::isReadOnly ( ) const

Diagram::isReadOnly.

Returns
true if this diagram is read only. This method is same has call Diagram::project() -> isReadOnly()
Here is the caller graph for this function:

◆ keyPressEvent()

void Diagram::keyPressEvent ( QKeyEvent *  event)
overrideprotected

Diagram::keyPressEvent This event is managed by diagram event interface if any. Else move selected elements.

Parameters
event
Here is the call graph for this function:

◆ keyReleaseEvent()

void Diagram::keyReleaseEvent ( QKeyEvent *  e)
overrideprotected

Diagram::keyReleaseEvent This event is managed by diagram event interface if any. Else move selected element.

Parameters
e
Here is the call graph for this function:

◆ loadCndFolioSeq

void Diagram::loadCndFolioSeq ( )
slot

Diagram::loadCndFolioSeq This class loads all conductor folio sequential variables related to the current autonum.

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

◆ loadElmtFolioSeq

void Diagram::loadElmtFolioSeq ( )
slot

Diagram::loadElmtFolioSeq This class loads all folio sequential variables related to the current autonum.

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

◆ loadFolioSeqHash()

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.

Parameters
hash: to be accessed
title: autonum title
type: to be treated
nc: Context to be manipulated
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseDoubleClickEvent()

void Diagram::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Diagram::mouseDoubleClickEvent This event is managed by diagram event interface if any.

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

◆ mouseMoveEvent()

void Diagram::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Diagram::mouseMoveEvent This event is managed by diagram event interface if any.

Parameters
event
Here is the call graph for this function:

◆ mousePressEvent()

void Diagram::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Diagram::mousePressEvent This event is managed by diagram event interface if any.

Parameters
event
Here is the call graph for this function:

◆ mouseReleaseEvent()

void Diagram::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

Diagram::mouseReleaseEvent This event is managed by diagram event interface if any.

Parameters
event
Here is the call graph for this function:

◆ potentials()

QList< QSet< Conductor * > > Diagram::potentials ( )

Diagram::potential.

Returns
all potential in the diagram each potential are in the QList and each conductors of one potential are in the QSet
Here is the call graph for this function:

◆ project()

QETProject * Diagram::project ( ) const

Diagram::project.

Returns
the project to which this schema belongs or 0 if it is an independent schema.
Here is the caller graph for this function:

◆ qgiManager()

QGIManager & Diagram::qgiManager ( )
inline

Diagram::qgiManager.

Returns
the diagram graphics item manager
Here is the caller graph for this function:

◆ refreshContents()

void Diagram::refreshContents ( )

Diagram::refreshContents refresh all content of diagram.

  • refresh conductor text.
  • linking the elements waiting to be linked
  • Refresh the connection of the dynamic element text item (use for text with source of text label)
Here is the call graph for this function:

◆ removeItem()

void Diagram::removeItem ( QGraphicsItem *  item)
virtual

Diagram::removeItem Reimplemented from QGraphicsScene::removeItem(QGraphicsItem *item) Do some specific operation if item need it (for exemple an element)

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

◆ selectAll

void Diagram::selectAll ( )
slot

Diagram::selectAll Select all schema objects.

Here is the call graph for this function:

◆ selectedConductors()

QSet< Conductor * > Diagram::selectedConductors ( ) const

Diagram::selectedConductors.

Returns
the list of conductors selected on the diagram
Here is the caller graph for this function:

◆ setBorderOptions()

void Diagram::setBorderOptions ( Diagram::BorderOptions  bo)
inline

Diagram::setBorderOptions Set the rendering options for the diagram border (including rows/colums headers and the title block)

Parameters
boEnabled options ORed together
See also
BorderOptions
Here is the call graph for this function:

◆ setConductor()

void Diagram::setConductor ( bool  adding)
inline

Diagram::setConductor Display or hide the conductor setter, i.e. a dashed conductor stub which appears when creating a conductor between two terminals.

Parameters
addingtrue add conductor ,false remove conductor

◆ setConductorsAutonumName()

void Diagram::setConductorsAutonumName ( const QString &  name)

Diagram::setConductorsAutonumName.

Parameters
name: name of autonum to use.
Here is the caller graph for this function:

◆ setConductorStart()

void Diagram::setConductorStart ( QPointF  start)
inline

Diagram::setConductorStart Set the start point of the conductor setter.

Parameters
startthe point (in scene coordinates) which the newly created conductor should start from.

◆ setConductorStop()

void Diagram::setConductorStop ( QPointF  end)
inline

Diagram::setConductorStop Set the end point of the conductor setter.

Parameters
endthe point (in scene coordinates) upon to which the newly created conductor should be drawn.

◆ setDisplayGrid()

void Diagram::setDisplayGrid ( bool  dg)
inline

Diagram::setDisplayGrid Set whether the diagram grid should be drawn.

Parameters
dgtrue to render the grid, false otherwise.
Here is the caller graph for this function:

◆ setDrawColoredConductors()

void Diagram::setDrawColoredConductors ( bool  dcc)

Diagram::setDrawColoredConductors Defines whether or not to respect the colors of the conductors. If not, the conductors are all drawn in black.

Parameters
dcctrue to respect the colors, false otherwise
Here is the caller graph for this function:

◆ setDrawTerminals()

void Diagram::setDrawTerminals ( bool  dt)

Diagram::setDrawTerminals Defines whether or not to display the terminals.

Parameters
dt: true to display the bounds, false otherwise
Here is the caller graph for this function:

◆ setEventInterface()

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.

Parameters
event_interface
Here is the caller graph for this function:

◆ setFreezeNewConductors()

void Diagram::setFreezeNewConductors ( bool  b)

Diagram::setfreezeNewConductors Set new conductor label to be frozen.

◆ setFreezeNewElements()

void Diagram::setFreezeNewElements ( bool  b)

Diagram::freezeNewElements Set new element label to be frozen.

◆ setTitleBlockTemplate

void Diagram::setTitleBlockTemplate ( const QString &  template_name)
slot

Diagram::setTitleBlockTemplate Set the template to use to render the title block of this diagram.

Parameters
template_nameName of the title block template.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUseBorder()

void Diagram::setUseBorder ( bool  ub)
inline

Diagram::setUseBorder 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.

Parameters
ubtrue to take the border into account, false otherwise
Here is the caller graph for this function:

◆ showDiagram

void Diagram::showDiagram ( Diagram )
signal
Here is the caller graph for this function:

◆ showMe()

void Diagram::showMe ( )
inline
Here is the caller graph for this function:

◆ snapToGrid()

QPointF Diagram::snapToGrid ( const QPointF &  p)
static

Diagram::snapToGrid Return a nearest snap point of p.

Parameters
ppoint to find the nearest snaped point
Returns
Here is the caller graph for this function:

◆ title()

QString Diagram::title ( ) const

Diagram::title.

Returns
title of the titleblock
Here is the call graph for this function:
Here is the caller graph for this function:

◆ titleBlockTemplateChanged

void Diagram::titleBlockTemplateChanged ( const QString &  template_name)
slot

Diagram::titleBlockTemplateChanged 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.

Parameters
template_nameName of the title block template that has changed
Here is the call graph for this function:

◆ titleBlockTemplateRemoved

void Diagram::titleBlockTemplateRemoved ( const QString &  template_name,
const QString &  new_template = QString() 
)
slot

Diagram::titleBlockTemplateRemoved 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()

Parameters
template_nameName of the title block template that has changed
new_template(Optional) Name of the title block template to use instead
Here is the call graph for this function:

◆ titleChanged

void Diagram::titleChanged ( const QString &  title)
slot

Diagram::titleChanged emit(diagramTitleChanged(this, title));.

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

◆ toPaintDevice()

bool Diagram::toPaintDevice ( QPaintDevice &  pix,
int  width = -1,
int  height = -1,
Qt::AspectRatioMode  aspectRatioMode = Qt::KeepAspectRatio 
)

Exporte le schema vers une image

Returns
Une QImage representant le schema
Here is the call graph for this function:

◆ toXml()

QDomDocument Diagram::toXml ( bool  whole_content = true)

Diagram::toXml Exports all or part of the schema.

Parameters
whole_content: Boolean (to true by default) indicating if the generated XML must represent the entire schema or only the selected content
Returns
An XML Document (QDomDocument)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ undoStack()

QUndoStack & Diagram::undoStack ( )
inline

Diagram::undoStack.

Returns
the diagram undo stack
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unfreezeElements()

void Diagram::unfreezeElements ( )

Diagram::unfreezeElements Unfreeze every existent element label.

Here is the call graph for this function:

◆ updateLabels

void Diagram::updateLabels ( )
slot

Diagram::updateLabels Update elements and conductors that reference folio field in their labels.

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

◆ useBorder()

bool Diagram::useBorder ( )
inline

Diagram::useBorder.

Returns
use_border_ true if the border is rendered and take into account, false otherwise.
Here is the caller graph for this function:

◆ usedTitleBlockTemplateChanged

void Diagram::usedTitleBlockTemplateChanged ( const QString &  )
signal
Here is the caller graph for this function:

◆ usesElement()

bool Diagram::usesElement ( const ElementsLocation location)

Diagram::usesElement Used to find out if an element is used on a schema.

Parameters
location: Location of an element
Returns
true if the location element is used on this schema, false otherwise
Here is the call graph for this function:

◆ usesTitleBlockTemplate()

bool Diagram::usesTitleBlockTemplate ( const QString &  name)

Diagram::usesTitleBlockTemplate.

Parameters
name: a title block template name
Returns
true if the provided template is used by this diagram, false otherwise.
Here is the call graph for this function:

◆ uuid()

QUuid Diagram::uuid ( )

Diagram::uuid.

Returns
the uuid of this diagram
Here is the caller graph for this function:

◆ wheelEvent()

void Diagram::wheelEvent ( QGraphicsSceneWheelEvent *  event)
overrideprotected

Diagram::wheelEvent This event is managed by diagram event interface if any.

Parameters
event
Here is the call graph for this function:

Member Data Documentation

◆ background_color

QColor Diagram::background_color = Qt::white
static

background color of diagram

Diagram::background_color static variable to keep track of present background color of the diagram.

◆ border_and_titleblock

BorderTitleBlock Diagram::border_and_titleblock

Diagram dimensions and title block.

◆ conductor_setter_

QGraphicsLineItem* Diagram::conductor_setter_
private

◆ defaultConductorProperties

ConductorProperties Diagram::defaultConductorProperties

Default properties for new conductors.

◆ diagram_qet_version_

qreal Diagram::diagram_qet_version_
private

◆ DiagramFolioList

friend Diagram::DiagramFolioList
private

◆ draw_colored_conductors_

bool Diagram::draw_colored_conductors_
private

◆ draw_grid_

bool Diagram::draw_grid_
private

◆ draw_terminals_

bool Diagram::draw_terminals_
private

◆ m_cnd_hundredfolio_max

QHash<QString, QStringList> Diagram::m_cnd_hundredfolio_max

◆ m_cnd_tenfolio_max

QHash<QString, QStringList> Diagram::m_cnd_tenfolio_max

◆ m_cnd_unitfolio_max

QHash<QString, QStringList> Diagram::m_cnd_unitfolio_max

Hash containing max values for folio sequential autonums in this diagram.

◆ m_conductors_autonum_name

QString Diagram::m_conductors_autonum_name
private

◆ m_element_texts_mover

ElementTextsMover Diagram::m_element_texts_mover
private

◆ m_elements_mover

ElementsMover Diagram::m_elements_mover
private

◆ m_elmt_hundredfolio_max

QHash<QString, QStringList> Diagram::m_elmt_hundredfolio_max

◆ m_elmt_tenfolio_max

QHash<QString, QStringList> Diagram::m_elmt_tenfolio_max

◆ m_elmt_unitfolio_max

QHash<QString, QStringList> Diagram::m_elmt_unitfolio_max

Hash containing max values for folio sequential autonums in this diagram.

◆ m_event_interface

DiagramEventInterface* Diagram::m_event_interface
private

◆ m_freeze_new_conductors_

bool Diagram::m_freeze_new_conductors_
private

◆ m_freeze_new_elements

bool Diagram::m_freeze_new_elements
private

◆ m_project

QETProject* Diagram::m_project
private

◆ m_uuid

QUuid Diagram::m_uuid = QUuid::createUuid()
private

◆ margin

const qreal Diagram::margin = 5.0
static

margin around the diagram

◆ QETProject

friend Diagram::QETProject
private

◆ qgi_manager_

QGIManager* Diagram::qgi_manager_
private

◆ use_border_

bool Diagram::use_border_
private

◆ xGrid

int Diagram::xGrid = 10
static

abscissa grid step size

◆ xKeyGrid

int Diagram::xKeyGrid = 10
static

Key grid x step size.

◆ xKeyGridFine

int Diagram::xKeyGridFine = 1
static

Key grid fine x step size.

◆ xml_document_

QDomDocument Diagram::xml_document_
private

◆ yGrid

int Diagram::yGrid = 10
static

ordinate grid step size

◆ yKeyGrid

int Diagram::yKeyGrid = 10
static

Key grid y step size.

◆ yKeyGridFine

int Diagram::yKeyGridFine = 1
static

Key grid fine y step size.


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