ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
VP1CustomTourEditor::Imp Class Reference
Collaboration diagram for VP1CustomTourEditor::Imp:

Public Member Functions

void updateFrameListVisuals ()
 
void updateFrameStepControlsEnablement ()
 
void updateFrameSnapshot (VP1CustomTourFrameWidget *)
 
int countEnabledFrames (int &nEnabledPerspectiveFrames, int &nEnabledOrthographicFrames) const
 
void addFrame (VP1CustomTourFrameWidget *frame)
 

Public Attributes

VP1CustomTourEditortheclass
 
Ui::VP1CustomTourEditorForm ui
 
VP1ExaminerViewerviewer
 
QWidget * frameHolderWidget
 
QList< VP1CustomTourFrameWidget * > frames
 
QList< QObject * > objectsToDisableWhenTourUnavailable
 

Detailed Description

Definition at line 39 of file VP1CustomTourEditor.cxx.

Member Function Documentation

◆ addFrame()

void VP1CustomTourEditor::Imp::addFrame ( VP1CustomTourFrameWidget frame)

Definition at line 144 of file VP1CustomTourEditor.cxx.

145 {
146  // std::cout<<"VP1CustomTourEditor::Imp::addFrame %= "<<frame->clipVolumePercentOfATLAS()<<std::endl;
147  frames << frame;
148  connect(frame,SIGNAL(requestStepToEarlier()),theclass,SLOT(frameStepToEarlier()));
149  connect(frame,SIGNAL(requestStepToLater()),theclass,SLOT(frameStepToLater()));
150  connect(frame,SIGNAL(requestDelete()),theclass,SLOT(frameDelete()));
151  connect(frame,SIGNAL(requestShow()),theclass,SLOT(frameShow()));
152  connect(frame,SIGNAL(requestSwap(VP1CustomTourFrameWidget*,VP1CustomTourFrameWidget*)),
154  connect(frame,SIGNAL(frameEnableStateChanged()),theclass,SLOT(enabledFrameListChanged()));
155 }

◆ countEnabledFrames()

int VP1CustomTourEditor::Imp::countEnabledFrames ( int &  nEnabledPerspectiveFrames,
int &  nEnabledOrthographicFrames 
) const

Definition at line 348 of file VP1CustomTourEditor.cxx.

350 {
351  nEnabledPerspectiveFrames = 0;
352  nEnabledOrthographicFrames = 0;
353  for (VP1CustomTourFrameWidget*frame : frames) {
354  if (frame->frameIsEnabled()) {
355  if (frame->camStateIsPerspective())
356  ++nEnabledPerspectiveFrames;
357  else
358  ++nEnabledOrthographicFrames;
359  }
360  }
361  return nEnabledPerspectiveFrames+nEnabledOrthographicFrames;
362 }

◆ updateFrameListVisuals()

void VP1CustomTourEditor::Imp::updateFrameListVisuals ( )

Definition at line 158 of file VP1CustomTourEditor.cxx.

159 {
160  bool save = frameHolderWidget->updatesEnabled();
161  if (save)
162  frameHolderWidget->setUpdatesEnabled(false);
163  int sliderpos=ui.scrollArea->verticalScrollBar()->value();
164  for (QObject * o : frameHolderWidget->children()) {
165  if (o->isWidgetType()) {
166  static_cast<QWidget*>(o)->setVisible(false);
167  o->setParent(0);
168  }
169  }
170  delete frameHolderWidget->layout();
171  QVBoxLayout * vlayout = new QVBoxLayout;
172  for (VP1CustomTourFrameWidget*frame : frames) {
173  vlayout->addWidget(frame);
174  frame->setParent(frameHolderWidget);
175  frame->setVisible(true);
176  }
177  vlayout->addStretch(1);
178  frameHolderWidget->setLayout(vlayout);
180  sliderpos=std::max(ui.scrollArea->verticalScrollBar()->minimum(),
181  std::min(ui.scrollArea->verticalScrollBar()->maximum(),sliderpos));
182  ui.scrollArea->verticalScrollBar()->setValue(sliderpos);
184  if (save)
185  frameHolderWidget->setUpdatesEnabled(true);
186 
187 }

◆ updateFrameSnapshot()

void VP1CustomTourEditor::Imp::updateFrameSnapshot ( VP1CustomTourFrameWidget frame)

Definition at line 339 of file VP1CustomTourEditor.cxx.

340 {
341  QPixmap pm = viewer->getSnapShotFromCamState(frame->camStateIsPerspective(),frame->camState(),
342  frame->snapShotWidth(),frame->snapShotHeight());
343  if (!pm.isNull())
344  frame->setSnapshot(pm);
345 }

◆ updateFrameStepControlsEnablement()

void VP1CustomTourEditor::Imp::updateFrameStepControlsEnablement ( )

Definition at line 264 of file VP1CustomTourEditor.cxx.

265 {
266  for (int i = 0; i < frames.count(); ++i) {
267  VP1CustomTourFrameWidget*frame = frames.at(i);
268  bool earlier(true), later(true);
269  if (i==0)
270  earlier = false;
271  if (i==frames.count()-1)
272  later = false;
273  frame->setStepToEarlierControlsEnabled(earlier);
274  frame->setStepToLaterControlsEnabled(later);
275  }
276 }

Member Data Documentation

◆ frameHolderWidget

QWidget* VP1CustomTourEditor::Imp::frameHolderWidget

Definition at line 44 of file VP1CustomTourEditor.cxx.

◆ frames

QList<VP1CustomTourFrameWidget*> VP1CustomTourEditor::Imp::frames

Definition at line 45 of file VP1CustomTourEditor.cxx.

◆ objectsToDisableWhenTourUnavailable

QList<QObject*> VP1CustomTourEditor::Imp::objectsToDisableWhenTourUnavailable

Definition at line 46 of file VP1CustomTourEditor.cxx.

◆ theclass

VP1CustomTourEditor* VP1CustomTourEditor::Imp::theclass

Definition at line 41 of file VP1CustomTourEditor.cxx.

◆ ui

Ui::VP1CustomTourEditorForm VP1CustomTourEditor::Imp::ui

Definition at line 42 of file VP1CustomTourEditor.cxx.

◆ viewer

VP1ExaminerViewer* VP1CustomTourEditor::Imp::viewer

Definition at line 43 of file VP1CustomTourEditor.cxx.


The documentation for this class was generated from the following file:
max
#define max(a, b)
Definition: cfImp.cxx:41
VP1CustomTourEditor::Imp::ui
Ui::VP1CustomTourEditorForm ui
Definition: VP1CustomTourEditor.cxx:42
VP1CustomTourEditor::Imp::updateFrameStepControlsEnablement
void updateFrameStepControlsEnablement()
Definition: VP1CustomTourEditor.cxx:264
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
VP1CustomTourFrameWidget::snapShotWidth
static int snapShotWidth()
Definition: VP1CustomTourFrameWidget.h:48
VP1CustomTourEditor::enabledFrameListChanged
void enabledFrameListChanged()
Definition: VP1CustomTourEditor.cxx:366
VP1CustomTourFrameWidget::setStepToLaterControlsEnabled
void setStepToLaterControlsEnabled(bool)
Definition: VP1CustomTourFrameWidget.cxx:203
checkTP.save
def save(self, fileName="./columbo.out")
Definition: checkTP.py:178
VP1CustomTourEditor::frameShow
void frameShow()
Definition: VP1CustomTourEditor.cxx:232
VP1ExaminerViewer::getSnapShotFromCamState
QPixmap getSnapShotFromCamState(bool camStateIsPerspective, QByteArray camState, int width, int height, bool transp=false)
Definition: VP1ExaminerViewer.cxx:1788
lumiFormat.i
int i
Definition: lumiFormat.py:92
VP1CustomTourEditor::swap
void swap(VP1CustomTourFrameWidget *, VP1CustomTourFrameWidget *)
Definition: VP1CustomTourEditor.cxx:279
VP1CustomTourEditor::Imp::frameHolderWidget
QWidget * frameHolderWidget
Definition: VP1CustomTourEditor.cxx:44
VP1CustomTourEditor::Imp::viewer
VP1ExaminerViewer * viewer
Definition: VP1CustomTourEditor.cxx:43
VP1CustomTourFrameWidget::setStepToEarlierControlsEnabled
void setStepToEarlierControlsEnabled(bool)
Definition: VP1CustomTourFrameWidget.cxx:197
min
#define min(a, b)
Definition: cfImp.cxx:40
VP1CustomTourEditor::Imp::frames
QList< VP1CustomTourFrameWidget * > frames
Definition: VP1CustomTourEditor.cxx:45
VP1CustomTourFrameWidget::camState
QByteArray camState() const
Definition: VP1CustomTourFrameWidget.cxx:191
VP1CustomTourEditor::frameStepToLater
void frameStepToLater()
Definition: VP1CustomTourEditor.cxx:204
VP1CustomTourEditor::frameStepToEarlier
void frameStepToEarlier()
Definition: VP1CustomTourEditor.cxx:190
VP1CustomTourEditor::frameDelete
void frameDelete()
Definition: VP1CustomTourEditor.cxx:220
VP1CustomTourFrameWidget::setSnapshot
void setSnapshot(QPixmap)
Definition: VP1CustomTourFrameWidget.cxx:255
VP1CustomTourEditor::Imp::theclass
VP1CustomTourEditor * theclass
Definition: VP1CustomTourEditor.cxx:41
VP1CustomTourFrameWidget::snapShotHeight
static int snapShotHeight()
Definition: VP1CustomTourFrameWidget.h:49
VP1CustomTourFrameWidget
Definition: VP1CustomTourFrameWidget.h:23
VP1CustomTourFrameWidget::camStateIsPerspective
bool camStateIsPerspective() const
Definition: VP1CustomTourFrameWidget.cxx:185