ATLAS Offline Software
Loading...
Searching...
No Matches
IVP12DSystem.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// //
7// Implementation of class IVP12DSystem //
8// //
9// Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> //
10// //
11// Initial version: April 2007 //
12// //
14
17#include <cassert>
18
19//Default implementations that do not do anything:
23
24//____________________________________________________________________
26public:
27 QSet<VP1GraphicsItemCollection*> collections;
28};
29
30
31//____________________________________________________________________
32IVP12DSystem::IVP12DSystem(const QString & name, const QString & information, const QString & contact_info)
34{
35}
36
37//____________________________________________________________________
39{
40 delete m_d; m_d=0;
41}
42
43//____________________________________________________________________
45{
46 assert(!m_d->collections.contains(ic)
47 &&"IVP12DSystem::registerItemCollection Error: Item collection registered twice");
48 m_d->collections<<ic;
49 connect(ic,SIGNAL(itemPicked(QGraphicsItem*)),this,SLOT(itemPickedPrivate(QGraphicsItem*)));
50 connect(ic,SIGNAL(itemGotEvent(QGraphicsItem*,QEvent*)),this,SLOT(itemGotEventPrivate(QGraphicsItem*,QEvent*)));
51 connect(ic,SIGNAL(selectionChanged(QList<QGraphicsItem*>)),this,SLOT(selectionChangedPrivate(QList<QGraphicsItem*>)));
52}
53
54//____________________________________________________________________
55const QSet<VP1GraphicsItemCollection*>& IVP12DSystem::getItemCollections()
56{
57 return m_d->collections;
58}
59
60//____________________________________________________________________
61void IVP12DSystem::itemPickedPrivate(QGraphicsItem*item)
62{
63 VP1GraphicsItemCollection * ic = static_cast<VP1GraphicsItemCollection*>(sender());
64 assert(ic&&ic->interactionMode()==VP1GraphicsItemCollection::SINGLEPICKS);
65 itemPicked(ic,item);
67}
68
69//____________________________________________________________________
70void IVP12DSystem::itemGotEventPrivate(QGraphicsItem*item,QEvent*event)
71{
72 VP1GraphicsItemCollection * ic = static_cast<VP1GraphicsItemCollection*>(sender());
73 assert(ic&&ic->interactionMode()==VP1GraphicsItemCollection::EVENTS);
74 itemGotEvent(ic,item,event);
76}
77
78//____________________________________________________________________
79void IVP12DSystem::selectionChangedPrivate(const QList<QGraphicsItem*>& items)
80{
81 VP1GraphicsItemCollection * ic = static_cast<VP1GraphicsItemCollection*>(sender());
82 assert(ic&&ic->interactionMode()==VP1GraphicsItemCollection::SELECTIONS);
83 selectionChanged(ic,items);
85}
QSet< VP1GraphicsItemCollection * > collections
virtual void itemPicked(VP1GraphicsItemCollection *, QGraphicsItem *)
virtual void selectionChanged(VP1GraphicsItemCollection *, QList< QGraphicsItem * >)
void selectionChangedPrivate(const QList< QGraphicsItem * > &)
IVP12DSystem(const QString &name, const QString &information, const QString &contact_info)
void itemGotEventPrivate(QGraphicsItem *, QEvent *)
virtual void itemGotEvent(VP1GraphicsItemCollection *, QGraphicsItem *, QEvent *)
virtual ~IVP12DSystem()
void itemFromSystemSelected()
const QSet< VP1GraphicsItemCollection * > & getItemCollections()
void registerItemCollection(VP1GraphicsItemCollection *)
void itemPickedPrivate(QGraphicsItem *)
const QString & name() const
IVP1System(const QString &name, const QString &information, const QString &contact_info)
const QString & information() const
const QString & contact_info() const