Developer Documentation
VSI::GraphicsScene Class Reference

#include <Plugin-VSI/scene/graphicsScene.hh>

Inheritance diagram for VSI::GraphicsScene:

Public Slots

void contentChange ()
 handle content changes
 
void clearScene (bool _start=false)
 clear the whole scene (_start = keep start element)
 

Signals

void contentChanged ()
 Informs about content changes.
 

Public Member Functions

 GraphicsScene (VSI::Context *_ctx, ElementFunction *_function=NULL)
 Constructor.
 
 ~GraphicsScene ()
 Destructor. More...
 
GraphicsViewgraphicsView ()
 Graphics view of the scene.
 
qreal getNewZ ()
 Returns a new Z value that is above all elements.
 
void moveElements (qreal _dx, qreal _dy, bool _selected=false)
 Moves all elements.
 
void scaleElements (qreal _delta)
 Scale all elements with scaling center in the center of the scene.
 
void scaleElements (qreal _delta, QPointF _center)
 Scale all elements with scaling center _canter.
 
void addElement (SceneElement *_element)
 Add the element to the scene.
 
bool removeElement (SceneElement *_element)
 Remove the element from the scene.
 
void mouseMove (QPointF _pos)
 Redirect mouse movement to tools area.
 
void mouseRelease (QPointF _pos, QGraphicsItem *_item)
 Redirect mouse release to tools area.
 
QRectF elementsBoundingRect ()
 Bounding rectangle of all scene elements.
 
ElementAreaelementArea () const
 Element area.
 
const QList< SceneElement * > & elements () const
 Scene elements. More...
 
QString generateCode (QString &errors, bool _codeOnly=false)
 Generate textual script code (_codeOnly = only pure code block)
 
WayFindwayFind ()
 WayFind object.
 
void saveToXml (QDomDocument &_doc, QDomElement &_root)
 Save to xml.
 
void loadFromXml (QXmlQuery &_xml)
 Load from xml.
 
ElementFunctionfunction ()
 Associated function.
 
void setActiveConnection (Connection *_conn)
 Sets the active connection.
 

Protected Member Functions

virtual void drawBackground (QPainter *_painter, const QRectF &_rect)
 
void dragEnterEvent (QGraphicsSceneDragDropEvent *_event)
 
void dragLeaveEvent (QGraphicsSceneDragDropEvent *_event)
 
void dragMoveEvent (QGraphicsSceneDragDropEvent *_event)
 
void dropEvent (QGraphicsSceneDragDropEvent *_event)
 
void mousePressEvent (QGraphicsSceneMouseEvent *_event)
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *_event)
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *_event)
 

Private Slots

void updateConnections ()
 
void sceneResized (const QRectF &_rect)
 

Private Member Functions

QString updateConnections (SceneElement *_from, bool _isStart)
 
bool validMimeData (const QMimeData *)
 
QString mimeDataElementName (const QMimeData *)
 
QPoint mimeDataPoint (const QMimeData *)
 
void loadElement (QXmlQuery &_xml)
 
void loadConnection (QXmlQuery &_xml)
 
QList< SceneElement * > getAllElements ()
 

Private Attributes

Contextctx_
 
ElementFunctionfunction_
 
GraphicsViewview_
 
SceneElementdndElement_
 
SceneToolstools_
 
ElementAreaelementArea_
 
QGraphicsRectItem * selection_
 
QPointF selectionStart_
 
bool selectionActive_
 
bool dontMoveStart_
 
bool blockChanges_
 
ConnectionactiveConnection_
 
qreal currentZ_
 
WayFindwayFind_
 

Detailed Description

Implementation of the Qt graphics scene graph and the represatation of the visual script

Definition at line 80 of file graphicsScene.hh.

Constructor & Destructor Documentation

◆ ~GraphicsScene()

VSI::GraphicsScene::~GraphicsScene ( )

Destructor.

destructor

Definition at line 155 of file graphicsScene.cc.

Member Function Documentation

◆ elements()

const QList< SceneElement * > & VSI::GraphicsScene::elements ( ) const

Scene elements.

Bounding rectangle of all scene elements.

Definition at line 348 of file graphicsScene.cc.


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