Version: 8.3.0
YACS::HMI::Scene Class Reference

#include <Scene.hxx>

Inheritance diagram for YACS::HMI::Scene:
Collaboration diagram for YACS::HMI::Scene:

Public Member Functions

 Scene (QObject *parent=0)
 
virtual ~Scene ()
 
void setZoom (bool zooming)
 
bool isZooming ()
 

Static Public Attributes

static bool _straightLinks = false
 
static bool _autoComputeLinks = true
 
static bool _simplifyLinks = true
 
static bool _force2NodesLink = true
 
static bool _addRowCols = true
 

Protected Member Functions

virtual void helpEvent (QGraphicsSceneHelpEvent *event)
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent)
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent)
 
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent)
 

Protected Attributes

bool _zooming
 

Detailed Description

Definition at line 30 of file Scene.hxx.

Constructor & Destructor Documentation

Scene::Scene ( QObject parent = 0)

Definition at line 43 of file Scene.cxx.

References _zooming.

43  : QGraphicsScene(parent)
44 {
45  _zooming = false;
46 }
Scene::~Scene ( )
virtual

Definition at line 48 of file Scene.cxx.

49 {
50 }

Member Function Documentation

void Scene::helpEvent ( QGraphicsSceneHelpEvent *  event)
protectedvirtual

Definition at line 69 of file Scene.cxx.

References DEBTRACE, and YACS::HMI::SceneTextItem::getToolTip().

70 {
71  DEBTRACE("Scene::helpEvent");
72  QGraphicsItem *qit = itemAt(event->scenePos(), QTransform());
73  SceneItem * item = dynamic_cast<SceneItem*>(qit);
74  if (item)
75  {
76  QToolTip::showText(event->screenPos(), item->getToolTip());
77  return;
78  }
79  SceneTextItem * itemt = dynamic_cast<SceneTextItem*>(qit);
80  if (itemt)
81  {
82  QToolTip::showText(event->screenPos(), itemt->getToolTip());
83  return;
84  }
85  QToolTip::hideText();
86 }
bool Scene::isZooming ( )

check if mouse move event can be used for selection or node displacement.

See Also
setZoom()

Definition at line 64 of file Scene.cxx.

References _zooming.

Referenced by YACS::HMI::SceneObserverItem::mousePressEvent(), YACS::HMI::SceneCtrlPortItem::mousePressEvent(), YACS::HMI::SceneNodeItem::mousePressEvent(), and YACS::HMI::SceneItem::mousePressEvent().

65 {
66  return _zooming;
67 }
void Scene::mouseMoveEvent ( QGraphicsSceneMouseEvent *  mouseEvent)
protectedvirtual

Definition at line 110 of file Scene.cxx.

111 {
112  //QGraphicsScene::mouseMoveEvent(mouseEvent);
113  QGraphicsScene::mouseMoveEvent(mouseEvent);
114 
115 }
void Scene::mousePressEvent ( QGraphicsSceneMouseEvent *  mouseEvent)
protectedvirtual

Definition at line 88 of file Scene.cxx.

References DEBTRACE, and YACS::HMI::AbstractSceneItem::getLabel().

89 {
90  //DEBTRACE("Scene::mousePressEvent");
91  QGraphicsScene::mousePressEvent(mouseEvent);
92  QGraphicsItem *qit = mouseGrabberItem();
93  if (qit)
94  {
95  //DEBTRACE(qit);
96  SceneItem *item = dynamic_cast<SceneItem*>(qit);
97  if (item)
98  DEBTRACE("mouseGrabberItem " <<item->handlesChildEvents()
99  << " " << item->getLabel().toStdString());
100  }
101 // QList<QGraphicsItem*> selItems = items(mouseEvent->scenePos());
102 }
void Scene::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  mouseEvent)
protectedvirtual

Definition at line 104 of file Scene.cxx.

References _zooming.

105 {
106  _zooming = false;
107  QGraphicsScene::mouseReleaseEvent(mouseEvent);
108 }
void Scene::setZoom ( bool  zooming)

to notify scene when mouse actions must not be used for selection or node displacement, typically when mouse is used to adjust the view, like zoom or recenter of the view.

Definition at line 56 of file Scene.cxx.

References _zooming.

Referenced by YACS::HMI::GraphicsView::onViewFitArea(), YACS::HMI::GraphicsView::onViewPan(), and YACS::HMI::GraphicsView::onViewZoom().

57 {
58  _zooming = zooming;
59 }

Member Data Documentation

bool Scene::_addRowCols = true
static
bool Scene::_force2NodesLink = true
static

Definition at line 39 of file Scene.hxx.

Referenced by YACS::HMI::SceneLinkItem::setPath().

bool Scene::_simplifyLinks = true
static

Definition at line 38 of file Scene.hxx.

Referenced by YACS::HMI::SceneLinkItem::setPath().

bool Scene::_straightLinks = false
static

Definition at line 36 of file Scene.hxx.

Referenced by YACS::HMI::SceneLinkItem::setShape().

bool YACS::HMI::Scene::_zooming
protected

Definition at line 51 of file Scene.hxx.

Referenced by isZooming(), mouseReleaseEvent(), Scene(), and setZoom().


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