18#ifndef ELEMENT_SCENE_H
19#define ELEMENT_SCENE_H
20#include "../NameList/nameslist.h"
21#include "../diagramcontext.h"
22#include "../qgimanager.h"
24#include "../properties/elementdata.h"
106 virtual int xGrid()
const;
107 virtual int yGrid()
const;
108 virtual void setGrid(
int,
int);
110 virtual const QDomDocument
toXml(
bool =
true);
112 virtual void fromXml(
const QDomDocument &,
113 const QPointF & = QPointF(),
116 virtual void reset();
117 virtual QList<CustomElementPart *>
primitives()
const;
118 virtual QList<QGraphicsItem *>
133 void addItems(QVector<QGraphicsItem *> items);
182Q_DECLARE_OPERATORS_FOR_FLAGS(ElementScene::ItemOptions)
The CustomElementGraphicPart class This class is the base for all home-made primitive like line,...
Definition customelementgraphicpart.h:36
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition customelementpart.h:40
Definition eseventinterface.h:30
The ElementData class WARNING This class inherit from PropertiesInterface but only fromXml is actuall...
Definition elementdata.h:32
The ElementEditionCommand class ElementEditionCommand is the base class for all commands classes invo...
Definition editorcommands.h:47
Definition elementprimitivedecorator.h:42
The ElementScene class This class is the canvas allowing the visual edition of an electrical element....
Definition elementscene.h:46
QUndoStack m_undo_stack
Definition elementscene.h:75
void mouseMoveEvent(QGraphicsSceneMouseEvent *) override
ElementScene::mouseMoveEvent.
Definition elementscene.cpp:116
QGIManager m_qgi_manager
ElementData. Actually in transition with old data storage.
Definition elementscene.h:74
QUndoStack & undoStack()
ElementScene::undoStack.
Definition elementscene.cpp:633
ElementPrimitiveDecorator * m_decorator
Decorator item displayed when at least one item is selected.
Definition elementscene.h:87
~ElementScene() override
ElementScene::~ElementScene.
Definition elementscene.cpp:98
void elementInfoChanged()
virtual const QDomDocument toXml(bool=true)
ElementScene::toXml Export this element as a xml file.
Definition elementscene.cpp:413
void slot_deselectAll()
ElementScene::slot_deselectAll deselect all item.
Definition elementscene.cpp:811
ElementScene::Behavior behavior() const
Definition elementscene.cpp:367
QRectF elementContentBoundingRect(const ElementContent &) const
ElementScene::elementContentBoundingRect.
Definition elementscene.cpp:1120
Behavior m_behavior
Definition elementscene.h:78
void slot_editAuthorInformations()
ElementScene::slot_editAuthorInformations Starts a dialog to edit the additional information of this ...
Definition elementscene.cpp:857
QRectF m_defined_paste_area
Definition elementscene.h:82
void keyPressEvent(QKeyEvent *event) override
ElementScene::keyPressEvent manage key press event.
Definition elementscene.cpp:213
ElementContent loadContent(const QDomDocument &)
ElementScene::loadContent Create and load the content describe in the xml document.
Definition elementscene.cpp:1139
virtual ElementContent selectedContent() const
ElementScene::selectedContent.
Definition elementscene.cpp:1055
void pasteAreaDefined(const QRectF &)
Signal emitted when users have defined the copy/paste area.
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
ElementScene::mouseDoubleClickEvent.
Definition elementscene.cpp:193
void drawForeground(QPainter *, const QRectF &) override
ElementScene::drawForeground Draws the background of the editor, ie the hotspot indicator.
Definition elementscene.cpp:308
virtual void fromXml(const QDomDocument &, const QPointF &=QPointF(), bool=true, ElementContent *=nullptr)
ElementScene::fromXml Imports the element described in an XML document. If a position is specified,...
Definition elementscene.cpp:555
bool containsTerminals() const
ElementScene::containsTerminals.
Definition elementscene.cpp:616
void needZoomFit()
Signal emitted when need zoomFit.
void initPasteArea()
ElementScene::initPasteArea Initializes the paste area.
Definition elementscene.cpp:1273
QString m_last_copied
Definition elementscene.h:84
QETElementEditor * editor() const
ElementScene::editor.
Definition elementscene.cpp:719
void setElementData(ElementData data)
Definition elementscene.cpp:85
void partsZValueChanged()
Signal emitted when the zValue of one or several parts change.
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override
ElementScene::contextMenuEvent Display the context menu event, only if behavior are Normal.
Definition elementscene.cpp:291
QPointF snapToGrid(QPointF point)
ElementScene::snapToGrid Rounds the coordinates of the point passed as a parameter so that this point...
Definition elementscene.cpp:1301
static bool zValueLessThan(QGraphicsItem *, QGraphicsItem *)
ElementScene::zValueLessThan.
Definition elementscene.cpp:1314
virtual QList< QGraphicsItem * > zItems(ItemOptions options=ItemOptions(SortByZValue|IncludeTerminals|SelectedOrNot)) const
ElementScene::zItems.
Definition elementscene.cpp:981
void stackAction(ElementEditionCommand *)
ElementScene::stackAction Push the provided command on the undo stack.
Definition elementscene.cpp:1402
QGIManager & qgiManager()
ElementScene::qgiManager.
Definition elementscene.cpp:643
ESEventInterface * m_event_interface
Definition elementscene.h:77
QPointer< CustomElementGraphicPart > m_single_selected_item
Definition elementscene.h:92
virtual int yGrid() const
ElementScene::yGrid.
Definition elementscene.cpp:387
void addPrimitive(QGraphicsItem *)
ElementScene::addPrimitive Add a primitive to the scene by wrapping it within an ElementPrimitiveDeco...
Definition elementscene.cpp:1262
virtual void reset()
ElementScene::reset Remove all QGraphicsItems in the scene and clear the undo stack.
Definition elementscene.cpp:1087
bool wasCopiedFromThisElement(const QString &)
ElementScene::wasCopiedFromThisElement.
Definition elementscene.cpp:670
void centerElementToOrigine()
ElementScene::centerElementToOrigine try to center better is possible the element to the scene (the c...
Definition elementscene.cpp:1324
int m_y_grid
Definition elementscene.h:90
void addItems(QVector< QGraphicsItem * > items)
ElementScene::addItems Add items to the scene and emit partsAdded. Prefer always use this method inst...
Definition elementscene.cpp:731
void slot_editNames()
ElementScene::slot_editNames Launch a dialog for edit the names of the edited element.
Definition elementscene.cpp:931
void setEventInterface(ESEventInterface *event_interface)
ElementScene::setEventInterface Set a new event interface.
Definition elementscene.cpp:331
virtual void setGrid(int, int)
ElementScene::setGrid.
Definition elementscene.cpp:399
void slot_selectAll()
ElementScene::slot_selectAll Select all items.
Definition elementscene.cpp:802
int m_x_grid
Definition elementscene.h:89
ElementData m_element_data
Definition elementscene.h:73
void slot_delete()
ElementScene::slot_delete Delete selected items.
Definition elementscene.cpp:835
virtual QRectF boundingRectFromXml(const QDomDocument &)
ElementScene::boundingRectFromXml.
Definition elementscene.cpp:513
Behavior
Definition elementscene.h:52
@ AddPart
Definition elementscene.h:52
@ PasteArea
Definition elementscene.h:52
@ Normal
Definition elementscene.h:52
friend class ChangePropertiesCommand
Definition elementscene.h:47
void mousePressEvent(QGraphicsSceneMouseEvent *) override
ElementScene::mousePressEvent.
Definition elementscene.cpp:147
void setBehavior(ElementScene::Behavior)
ElementScene::setBehavior Modify the current behavior of this scene.
Definition elementscene.cpp:362
void clearEventInterface()
ElementScene::clearEventInterface Clear the current event interface.
Definition elementscene.cpp:347
void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override
ElementScene::mouseReleaseEvent.
Definition elementscene.cpp:166
ElementScene(const ElementScene &)
virtual void getPasteArea(const QRectF &)
ElementScene::getPasteArea.
Definition elementscene.cpp:1072
void slot_select(const ElementContent &)
ElementScene::slot_select Select the item in content, every others items in the scene are deselected.
Definition elementscene.cpp:772
void removeItems(QVector< QGraphicsItem * > items)
ElementScene::removeItems Remove items from the scene and emit partsRemoved. Prefer always use this m...
Definition elementscene.cpp:747
void slot_invertSelection()
ElementScene::slot_invertSelection Inverse Selection.
Definition elementscene.cpp:821
void partsRemoved()
Signal emitted after one or several parts were removed.
void copy()
ElementScene::copy Handles the fact of copying the selection = exporting it as XML to the clipboard.
Definition elementscene.cpp:697
ElementContent addContent(const ElementContent &)
ElementScene::addContent Add content content to this element.
Definition elementscene.cpp:1211
QMutex * m_decorator_lock
Definition elementscene.h:153
ElementContent addContentAtPos(const ElementContent &, const QPointF &)
ElementScene::addContentAtPos Add content content to this element.
Definition elementscene.cpp:1232
virtual int xGrid() const
ElementScene::xGrid.
Definition elementscene.cpp:377
ItemOption
Definition elementscene.h:53
@ SelectedOrNot
Definition elementscene.h:59
@ NonSelected
Definition elementscene.h:58
@ SortByZValue
Definition elementscene.h:54
@ IncludeTerminals
Definition elementscene.h:55
@ Selected
Definition elementscene.h:57
@ IncludeHelperItems
Definition elementscene.h:56
void partsAdded()
Signal emitted after one or several parts were added.
QETElementEditor * m_element_editor
Definition elementscene.h:79
static bool clipboardMayContainElement()
ElementScene::clipboardMayContainElement.
Definition elementscene.cpp:653
virtual QList< CustomElementPart * > primitives() const
ElementScene::primitives.
Definition elementscene.cpp:962
QGraphicsRectItem * m_paste_area
Definition elementscene.h:81
ElementData elementData()
ElementScene::elementData.
Definition elementscene.cpp:81
void managePrimitivesGroups()
ElementScene::managePrimitivesGroups Ensure the decorator is adequately shown, hidden or updated so i...
Definition elementscene.cpp:1352
QRectF elementSceneGeometricRect() const
ElementScene::elementSceneGeometricRect.
Definition elementscene.cpp:595
void cut()
ElementScene::cut Handles the fact of cutting the selection = exporting it in XML to the clipboard th...
Definition elementscene.cpp:682
void slot_editProperties()
ElementScene::slot_editProperties Open dialog to edit the element properties.
Definition elementscene.cpp:914
Definition qetelementeditor.h:39
Definition qgimanager.h:30
QList< QGraphicsItem * > ElementContent
Definition elementcontent.h:30