ATLAS Offline Software
Loading...
Searching...
No Matches
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*)),
153 theclass,SLOT(swap(VP1CustomTourFrameWidget*,VP1CustomTourFrameWidget*)));
154 connect(frame,SIGNAL(frameEnableStateChanged()),theclass,SLOT(enabledFrameListChanged()));
155}
VP1CustomTourEditor * theclass
QList< VP1CustomTourFrameWidget * > frames
void swap(VP1CustomTourFrameWidget *, VP1CustomTourFrameWidget *)

◆ 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);
183 theclass->enabledFrameListChanged();
184 if (save)
185 frameHolderWidget->setUpdatesEnabled(true);
186
187}
Ui::VP1CustomTourEditorForm ui

◆ 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}
const QByteArray & camState() const

◆ 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: