ATLAS Offline Software
Classes | Public Slots | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
VP12DExaminerViewer Class Reference

#include <VP12DExaminerViewer.h>

Inheritance diagram for VP12DExaminerViewer:
Collaboration diagram for VP12DExaminerViewer:

Classes

class  Imp
 

Public Slots

void setPickMode ()
 
void setChangeViewMode ()
 
void setSeekMode ()
 
void setShownView (QString)
 

Signals

void currentViewAboutToChange (VP1GraphicsView *)
 
void currentViewChanged ()
 

Public Member Functions

 VP12DExaminerViewer (QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags())
 
 VP12DExaminerViewer (const QList< QPair< QString, QString > > &views, QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags())
 
virtual ~VP12DExaminerViewer ()
 
bool isSingleViewMode () const
 
VP1GraphicsViewview () const
 
VP1GraphicsViewview (const QString &view_id) const
 
QString currentView () const
 
QStringList viewIDs () const
 
QList< QPair< QString, QString > > viewIDsAndIconUrls () const
 

Private Slots

void changeViewButtonClicked ()
 

Private Member Functions

 VP12DExaminerViewer (const VP12DExaminerViewer &)
 
VP12DExaminerVieweroperator= (const VP12DExaminerViewer &)
 

Private Attributes

Impm_d
 

Detailed Description

Definition at line 26 of file VP12DExaminerViewer.h.

Constructor & Destructor Documentation

◆ VP12DExaminerViewer() [1/3]

VP12DExaminerViewer::VP12DExaminerViewer ( QWidget *  parent = 0,
Qt::WindowFlags  f = Qt::WindowFlags() 
)

Definition at line 89 of file VP12DExaminerViewer.cxx.

90  : QWidget(parent,f), m_d(new Imp)
91 {
92  m_d->theclass=this;
93  m_d->singleviewmode = true;
94 
95  m_d->init1();
96 
97  //Add graphicsview:
98  m_d->ui->stackedWidget_views->insertWidget(m_d->ui->stackedWidget_views->count(),new VP1GraphicsView);
99 
100  //Setup viewchangebuttons:
101  m_d->ui->widget_viewchangebuttons->hide();
102 
103  m_d->init2();
104 }

◆ VP12DExaminerViewer() [2/3]

VP12DExaminerViewer::VP12DExaminerViewer ( const QList< QPair< QString, QString > > &  views,
QWidget *  parent = 0,
Qt::WindowFlags  f = Qt::WindowFlags() 
)

Definition at line 107 of file VP12DExaminerViewer.cxx.

109  : QWidget(parent,f), m_d(new Imp)
110 {
111  if (!views.count())
112  std::cout<<"VP12DExaminerViewer ERROR: Using multimode constructor with empty list of requested views!"<<std::endl;
113 
114 
115  m_d->theclass=this;
116  m_d->singleviewmode = false;
117 
118  m_d->init1();
119 
120  //Setup layout for the buttons used to change the views:
121  QVBoxLayout *layout = new QVBoxLayout;
122  layout->setSpacing(0);
123  layout->setContentsMargins(0, 0, 0, 0);
124  QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
125  sizePolicy.setHorizontalStretch(0);
126  sizePolicy.setVerticalStretch(0);
127  m_d->ui->widget_viewchangebuttons->setLayout(layout);
128 
129  //Add graphicsviews:
131  VP1GraphicsView * firstview(0);
132  for (int i = 0; i<views.count();++i) {
133 
135  if (!firstview)
136  firstview=view;
137 
138  m_d->multiviews_viewid2view.insert(views.at(i).first,view);
139 
140  m_d->ui->stackedWidget_views->insertWidget(m_d->ui->stackedWidget_views->count(),view);
141  //Add button:
142  QPushButton* button = new QPushButton(m_d->ui->widget_viewchangebuttons);
143  button->setToolTip(views.at(i).first);
144  button->setSizePolicy(sizePolicy);
145  button->setMinimumSize(QSize(30, 30));
146  button->setMaximumSize(QSize(30, 30));
147  button->setFocusPolicy(Qt::NoFocus);
148  button->setIcon(QIcon(views.at(i).second));
149  button->setIconSize(QSize(30, 30));
150  button->setCheckable(false);
151  layout->addWidget(button);
152  //connect button here and put it in button -> view_id map:
153  connect(button,SIGNAL(clicked()),this,SLOT(changeViewButtonClicked()));
154  m_d->button2viewid.insert(button,views.at(i).first);
155  }
156 
157  QSpacerItem * spacerItem = new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
158  layout->addItem(spacerItem);
159 
160  if (firstview)
161  m_d->ui->stackedWidget_views->setCurrentWidget(firstview);
162  else
163  std::cout<<"VP12DExaminerViewer WARNING: View is NULL"<<std::endl;
164 
165  m_d->init2();
166 
167 // VP1GraphicsView a(a);
168 }

◆ ~VP12DExaminerViewer()

VP12DExaminerViewer::~VP12DExaminerViewer ( )
virtual

Definition at line 189 of file VP12DExaminerViewer.cxx.

190 {
191  delete m_d; m_d=0;
192 }

◆ VP12DExaminerViewer() [3/3]

VP12DExaminerViewer::VP12DExaminerViewer ( const VP12DExaminerViewer )
private

Member Function Documentation

◆ changeViewButtonClicked

void VP12DExaminerViewer::changeViewButtonClicked ( )
privateslot

Definition at line 320 of file VP12DExaminerViewer.cxx.

321 {
322  QPushButton * button = static_cast<QPushButton*>(sender());
323  if (!button||!m_d->button2viewid.contains(button))
324  return;
325  setShownView(m_d->button2viewid[button]);
326 }

◆ currentView()

QString VP12DExaminerViewer::currentView ( ) const

Definition at line 276 of file VP12DExaminerViewer.cxx.

277 {
278  if (m_d->singleviewmode)
279  return "";
280 
281  VP1GraphicsView* currentview = view();
282  if (!currentview)
283  return "";
284 
286  for(it = m_d->multiviews_viewid2view.begin(); it!=itE; ++it) {
287  if (it.value()==currentview)
288  return it.key();
289  }
290 
291  return "";
292 }

◆ currentViewAboutToChange

void VP12DExaminerViewer::currentViewAboutToChange ( VP1GraphicsView )
signal

◆ currentViewChanged

void VP12DExaminerViewer::currentViewChanged ( )
signal

◆ isSingleViewMode()

bool VP12DExaminerViewer::isSingleViewMode ( ) const

Definition at line 270 of file VP12DExaminerViewer.cxx.

271 {
272  return m_d->singleviewmode;
273 }

◆ operator=()

VP12DExaminerViewer& VP12DExaminerViewer::operator= ( const VP12DExaminerViewer )
private

◆ setChangeViewMode

void VP12DExaminerViewer::setChangeViewMode ( )
slot

Definition at line 232 of file VP12DExaminerViewer.cxx.

233 {
234  m_d->ui->pushButton_pick->setChecked(false);
235  m_d->ui->pushButton_changeview->setChecked(true);
237 }

◆ setPickMode

void VP12DExaminerViewer::setPickMode ( )
slot

Definition at line 224 of file VP12DExaminerViewer.cxx.

225 {
226  m_d->ui->pushButton_pick->setChecked(true);
227  m_d->ui->pushButton_changeview->setChecked(false);
229 }

◆ setSeekMode

void VP12DExaminerViewer::setSeekMode ( )
slot

Definition at line 240 of file VP12DExaminerViewer.cxx.

241 {
243 }

◆ setShownView

void VP12DExaminerViewer::setShownView ( QString  viewid)
slot

Definition at line 295 of file VP12DExaminerViewer.cxx.

296 {
297  if (m_d->singleviewmode)
298  return;
299 
300  if (!m_d->multiviews_viewid2view.contains(viewid))
301  return;
302 
303  VP1GraphicsView* oldview = view();
304  VP1GraphicsView* newview = m_d->multiviews_viewid2view[viewid];
305  if (!oldview||!newview)
306  return;
307  if (oldview==newview)
308  return;
309 
310  currentViewAboutToChange(newview);
311 
312  m_d->disconnectButtonsFromView(oldview);
313  m_d->ui->stackedWidget_views->setCurrentWidget(newview);
314  m_d->connectButtonsToView(newview);
315 
317 }

◆ view() [1/2]

VP1GraphicsView * VP12DExaminerViewer::view ( ) const

Definition at line 195 of file VP12DExaminerViewer.cxx.

195  {
196  return static_cast<VP1GraphicsView *>(m_d->ui->stackedWidget_views->currentWidget());
197  // return m_d->view;
198 }

◆ view() [2/2]

VP1GraphicsView * VP12DExaminerViewer::view ( const QString &  view_id) const

Definition at line 201 of file VP12DExaminerViewer.cxx.

202 {
203  if (m_d->singleviewmode||!m_d->multiviews_viewid2view.contains(view_id))
204  return 0;
205 
206  return m_d->multiviews_viewid2view[view_id];
207 }

◆ viewIDs()

QStringList VP12DExaminerViewer::viewIDs ( ) const

Definition at line 246 of file VP12DExaminerViewer.cxx.

247 {
248  if (m_d->singleviewmode)
249  return QStringList();
250 
251  QStringList l;
253  for(it = m_d->multiviews_viewid2view.begin(); it!=itE; ++it) {
254  l << it.key();
255  }
256 
257  return l;
258 }

◆ viewIDsAndIconUrls()

QList< QPair< QString, QString > > VP12DExaminerViewer::viewIDsAndIconUrls ( ) const

Definition at line 261 of file VP12DExaminerViewer.cxx.

262 {
263  if (m_d->singleviewmode)
264  return QList<QPair<QString,QString> >();
265 
267 }

Member Data Documentation

◆ m_d

Imp* VP12DExaminerViewer::m_d
private

Definition at line 66 of file VP12DExaminerViewer.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
VP12DExaminerViewer::Imp::theclass
VP12DExaminerViewer * theclass
Definition: VP12DExaminerViewer.cxx:28
VP12DExaminerViewer::Imp::disconnectButtonsFromView
void disconnectButtonsFromView(VP1GraphicsView *)
Definition: VP12DExaminerViewer.cxx:180
VP12DExaminerViewer::setShownView
void setShownView(QString)
Definition: VP12DExaminerViewer.cxx:295
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
skel.it
it
Definition: skel.GENtoEVGEN.py:396
VP12DExaminerViewer::view
VP1GraphicsView * view() const
Definition: VP12DExaminerViewer.cxx:195
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
VP12DExaminerViewer::currentViewChanged
void currentViewChanged()
VP12DExaminerViewer::Imp::init1
void init1()
Definition: VP12DExaminerViewer.cxx:55
TruthTest.itE
itE
Definition: TruthTest.py:25
VP1GraphicsView::PICK
@ PICK
Definition: VP1GraphicsView.h:37
VP1GraphicsView::SEEK
@ SEEK
Definition: VP1GraphicsView.h:37
lumiFormat.i
int i
Definition: lumiFormat.py:85
VP12DExaminerViewer::Imp::ui
Ui::VP12DExaminerViewerForm * ui
Definition: VP12DExaminerViewer.cxx:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VP12DExaminerViewer::changeViewButtonClicked
void changeViewButtonClicked()
Definition: VP12DExaminerViewer.cxx:320
hist_file_dump.f
f
Definition: hist_file_dump.py:135
VP12DExaminerViewer::m_d
Imp * m_d
Definition: VP12DExaminerViewer.h:65
VP12DExaminerViewer::Imp::button2viewid
QMap< QPushButton *, QString > button2viewid
Definition: VP12DExaminerViewer.cxx:44
VP12DExaminerViewer::Imp::init2
void init2()
Definition: VP12DExaminerViewer.cxx:76
VP12DExaminerViewer::Imp::singleviewmode
bool singleviewmode
Definition: VP12DExaminerViewer.cxx:30
VP12DExaminerViewer::Imp::setModeAllViews
void setModeAllViews(VP1GraphicsView::Mode)
Definition: VP12DExaminerViewer.cxx:210
VP12DExaminerViewer::Imp::connectButtonsToView
void connectButtonsToView(VP1GraphicsView *)
Definition: VP12DExaminerViewer.cxx:171
VP12DExaminerViewer::currentViewAboutToChange
void currentViewAboutToChange(VP1GraphicsView *)
VP12DExaminerViewer::Imp::multiviews_viewidAndIconUrl
QList< QPair< QString, QString > > multiviews_viewidAndIconUrl
Definition: VP12DExaminerViewer.cxx:42
VP12DExaminerViewer::Imp::multiviews_viewid2view
QMap< QString, VP1GraphicsView * > multiviews_viewid2view
Definition: VP12DExaminerViewer.cxx:43
VP1GraphicsView
Definition: VP1GraphicsView.h:22
VP1GraphicsView::CHANGEVIEW
@ CHANGEVIEW
Definition: VP1GraphicsView.h:37