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

#include <VP1CustomTourFrameWidget.h>

Inheritance diagram for VP1CustomTourFrameWidget:
Collaboration diagram for VP1CustomTourFrameWidget:

Classes

class  Imp
 

Signals

void requestStepToEarlier ()
 
void requestStepToLater ()
 
void requestDelete ()
 
void requestShow ()
 
void requestSwap (VP1CustomTourFrameWidget *, VP1CustomTourFrameWidget *)
 
void frameEnableStateChanged ()
 

Public Member Functions

 VP1CustomTourFrameWidget (bool camPerspective, QByteArray camState, QWidget *parent=0)
 
 VP1CustomTourFrameWidget (QByteArray serialisedFrame, QWidget *parent=0)
 
QByteArray serialise () const
 
virtual ~VP1CustomTourFrameWidget ()
 
void setStepToEarlierControlsEnabled (bool)
 
void setStepToLaterControlsEnabled (bool)
 
bool frameIsEnabled () const
 
bool zoomToFrameWithVariableSpeed () const
 
bool zoomToFrameForcedCircular () const
 
double zoomToFrameTime () const
 
double stayOnFrameTime () const
 
double clipVolumePercentOfATLAS () const
 
bool camStateIsPerspective () const
 
QByteArray camState () const
 
void setSnapshot (QPixmap)
 

Static Public Member Functions

static int snapShotWidth ()
 
static int snapShotHeight ()
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void dropEvent (QDropEvent *event)
 
void dragEnterEvent (QDragEnterEvent *event)
 

Private Slots

void buttonClicked ()
 
void frameEnabledToggled ()
 

Private Member Functions

 VP1CustomTourFrameWidget (const VP1CustomTourFrameWidget &)
 
VP1CustomTourFrameWidgetoperator= (const VP1CustomTourFrameWidget &)
 

Private Attributes

Impm_d
 

Detailed Description

Definition at line 23 of file VP1CustomTourFrameWidget.h.

Constructor & Destructor Documentation

◆ VP1CustomTourFrameWidget() [1/3]

VP1CustomTourFrameWidget::VP1CustomTourFrameWidget ( bool  camPerspective,
QByteArray  camState,
QWidget *  parent = 0 
)

Definition at line 77 of file VP1CustomTourFrameWidget.cxx.

80  : QFrame(parent), m_d(new Imp(this))
81 {
82  m_d->camPerspective = camPerspective;
84  m_d->init();
85 }

◆ VP1CustomTourFrameWidget() [2/3]

VP1CustomTourFrameWidget::VP1CustomTourFrameWidget ( QByteArray  serialisedFrame,
QWidget *  parent = 0 
)

Definition at line 88 of file VP1CustomTourFrameWidget.cxx.

90  : QFrame(parent), m_d(new Imp(this))
91 {
92  VP1Deserialise s(serialisedFrame);
93  m_d->camState = s.restoreByteArray();
94  m_d->camPerspective = s.restoreBool();
95  s.restore(m_d->ui.doubleSpinBox_zoomToFrameTime);
96  s.restore(m_d->ui.doubleSpinBox_stayOnFrameTime);
97  if (s.version()>0) {
98  s.restore(m_d->ui.doubleSpinBox_clipVolumePercentOfATLAS);
99  }
100  s.restore(m_d->ui.comboBox_approachMethod);
101  s.restore(m_d->ui.checkBox_frameEnabled);
102  QPixmap pm = s.restore<QPixmap>();
103  if (!pm.isNull())
104  m_d->ui.label_snapshot->setPixmap(pm);
105  s.warnUnrestored(this);
106  m_d->init();
107 }

◆ ~VP1CustomTourFrameWidget()

VP1CustomTourFrameWidget::~VP1CustomTourFrameWidget ( )
virtual

Definition at line 130 of file VP1CustomTourFrameWidget.cxx.

131 {
132  delete m_d;
133 }

◆ VP1CustomTourFrameWidget() [3/3]

VP1CustomTourFrameWidget::VP1CustomTourFrameWidget ( const VP1CustomTourFrameWidget )
private

Member Function Documentation

◆ buttonClicked

void VP1CustomTourFrameWidget::buttonClicked ( )
privateslot

Definition at line 136 of file VP1CustomTourFrameWidget.cxx.

137 {
138  if (sender()==m_d->ui.pushButton_moveEarlier)
139  emit requestStepToEarlier();
140  else if (sender()==m_d->ui.pushButton_moveLater)
141  emit requestStepToLater();
142  else if (sender()==m_d->ui.pushButton_remove)
143  emit requestDelete();
144  else if (sender()==m_d->ui.pushButton_show)
145  emit requestShow();
146 }

◆ camState()

QByteArray VP1CustomTourFrameWidget::camState ( ) const

Definition at line 191 of file VP1CustomTourFrameWidget.cxx.

192 {
193  return m_d->camState;
194 }

◆ camStateIsPerspective()

bool VP1CustomTourFrameWidget::camStateIsPerspective ( ) const

Definition at line 185 of file VP1CustomTourFrameWidget.cxx.

186 {
187  return m_d->camPerspective;
188 }

◆ clipVolumePercentOfATLAS()

double VP1CustomTourFrameWidget::clipVolumePercentOfATLAS ( ) const

Definition at line 179 of file VP1CustomTourFrameWidget.cxx.

180 {
181  return m_d->ui.doubleSpinBox_clipVolumePercentOfATLAS->value();
182 }

◆ dragEnterEvent()

void VP1CustomTourFrameWidget::dragEnterEvent ( QDragEnterEvent *  event)
protected

Definition at line 239 of file VP1CustomTourFrameWidget.cxx.

240 {
241  if (event->source()&&event->source()!=this && event->mimeData()->hasFormat("vp1/customtourframe"))
242  event->acceptProposedAction();
243 }

◆ dropEvent()

void VP1CustomTourFrameWidget::dropEvent ( QDropEvent *  event)
protected

Definition at line 246 of file VP1CustomTourFrameWidget.cxx.

247 {
248  QByteArray data = event->mimeData()->data("vp1/customtourframe");
249  event->acceptProposedAction();
250  VP1CustomTourFrameWidget * source = dynamic_cast<VP1CustomTourFrameWidget *>(event->source());
251  emit requestSwap(this,source);
252 }

◆ frameEnabledToggled

void VP1CustomTourFrameWidget::frameEnabledToggled ( )
privateslot

Definition at line 263 of file VP1CustomTourFrameWidget.cxx.

264 {
265  m_d->ui.label_snapshot->setEnabled(frameIsEnabled());
266  m_d->ui.label_camtypeicon->setEnabled(frameIsEnabled());
268 }

◆ frameEnableStateChanged

void VP1CustomTourFrameWidget::frameEnableStateChanged ( )
signal

◆ frameIsEnabled()

bool VP1CustomTourFrameWidget::frameIsEnabled ( ) const

Definition at line 149 of file VP1CustomTourFrameWidget.cxx.

150 {
151 
152  return m_d->ui.checkBox_frameEnabled->isChecked();
153 }

◆ mouseMoveEvent()

void VP1CustomTourFrameWidget::mouseMoveEvent ( QMouseEvent *  event)
protected

Definition at line 217 of file VP1CustomTourFrameWidget.cxx.

218 {
219  if (!(event->buttons() & Qt::LeftButton))
220  return;
221  if ((event->pos() - m_d->dragStartPosition).manhattanLength()
222  < QApplication::startDragDistance())
223  return;
224  QDrag *drag = new QDrag(this);
225  QMimeData *mimeData = new QMimeData;
226  mimeData->setData("vp1/customtourframe", QByteArray() );
227  drag->setMimeData(mimeData);//drag assumes ownership of mimeData
228 #if QTWIDGETS_VERSION >= 0x050F00
229  QPixmap pm = m_d->ui.label_snapshot->pixmap(Qt::ReturnByValue);
230 #else
231  QPixmap pm = m_d->ui.label_snapshot->pixmap() ? *(m_d->ui.label_snapshot->pixmap()) : QPixmap();
232 #endif
233  if (!pm.isNull())
234  drag->setPixmap(pm );
235  drag->exec(Qt::CopyAction | Qt::MoveAction);
236 }

◆ mousePressEvent()

void VP1CustomTourFrameWidget::mousePressEvent ( QMouseEvent *  event)
protected

Definition at line 209 of file VP1CustomTourFrameWidget.cxx.

210 {
211  if (event->button() == Qt::LeftButton)
212  m_d->dragStartPosition = event->pos();
213  QFrame::mousePressEvent(event);
214 }

◆ operator=()

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

◆ requestDelete

void VP1CustomTourFrameWidget::requestDelete ( )
signal

◆ requestShow

void VP1CustomTourFrameWidget::requestShow ( )
signal

◆ requestStepToEarlier

void VP1CustomTourFrameWidget::requestStepToEarlier ( )
signal

◆ requestStepToLater

void VP1CustomTourFrameWidget::requestStepToLater ( )
signal

◆ requestSwap

void VP1CustomTourFrameWidget::requestSwap ( VP1CustomTourFrameWidget ,
VP1CustomTourFrameWidget  
)
signal

◆ serialise()

QByteArray VP1CustomTourFrameWidget::serialise ( ) const

Definition at line 110 of file VP1CustomTourFrameWidget.cxx.

111 {
112  VP1Serialise s(1/*version*/);
113  s.save(m_d->camState);
114  s.save(m_d->camPerspective);
115  s.save(m_d->ui.doubleSpinBox_zoomToFrameTime);
116  s.save(m_d->ui.doubleSpinBox_stayOnFrameTime);
117  s.save(m_d->ui.doubleSpinBox_clipVolumePercentOfATLAS);
118  s.save(m_d->ui.comboBox_approachMethod);
119  s.save(m_d->ui.checkBox_frameEnabled);
120 #if QTWIDGETS_VERSION >= 0x050F00
121  s.save(m_d->ui.label_snapshot->pixmap(Qt::ReturnByValue));
122 #else
123  s.save(m_d->ui.label_snapshot->pixmap() ? *(m_d->ui.label_snapshot->pixmap()) : QPixmap());
124 #endif
125  s.warnUnsaved(this);
126  return s.result();
127 }

◆ setSnapshot()

void VP1CustomTourFrameWidget::setSnapshot ( QPixmap  pm)

Definition at line 255 of file VP1CustomTourFrameWidget.cxx.

256 {
257  if (pm.isNull())
258  return;
259  m_d->ui.label_snapshot->setPixmap(pm);
260 }

◆ setStepToEarlierControlsEnabled()

void VP1CustomTourFrameWidget::setStepToEarlierControlsEnabled ( bool  b)

Definition at line 197 of file VP1CustomTourFrameWidget.cxx.

198 {
199  m_d->ui.pushButton_moveEarlier->setVisible(b);
200 }

◆ setStepToLaterControlsEnabled()

void VP1CustomTourFrameWidget::setStepToLaterControlsEnabled ( bool  b)

Definition at line 203 of file VP1CustomTourFrameWidget.cxx.

204 {
205  m_d->ui.pushButton_moveLater->setVisible(b);
206 }

◆ snapShotHeight()

static int VP1CustomTourFrameWidget::snapShotHeight ( )
inlinestatic

Definition at line 49 of file VP1CustomTourFrameWidget.h.

49 { return 90; }

◆ snapShotWidth()

static int VP1CustomTourFrameWidget::snapShotWidth ( )
inlinestatic

Definition at line 48 of file VP1CustomTourFrameWidget.h.

48 { return 90; }

◆ stayOnFrameTime()

double VP1CustomTourFrameWidget::stayOnFrameTime ( ) const

Definition at line 173 of file VP1CustomTourFrameWidget.cxx.

174 {
175  return m_d->ui.doubleSpinBox_stayOnFrameTime->value();
176 }

◆ zoomToFrameForcedCircular()

bool VP1CustomTourFrameWidget::zoomToFrameForcedCircular ( ) const

Definition at line 161 of file VP1CustomTourFrameWidget.cxx.

162 {
163  return m_d->ui.comboBox_approachMethod->currentIndex()==2;
164 }

◆ zoomToFrameTime()

double VP1CustomTourFrameWidget::zoomToFrameTime ( ) const

Definition at line 167 of file VP1CustomTourFrameWidget.cxx.

168 {
169  return m_d->ui.doubleSpinBox_zoomToFrameTime->value();
170 }

◆ zoomToFrameWithVariableSpeed()

bool VP1CustomTourFrameWidget::zoomToFrameWithVariableSpeed ( ) const

Definition at line 156 of file VP1CustomTourFrameWidget.cxx.

157 {
158  return m_d->ui.comboBox_approachMethod->currentIndex()==0;
159 }

Member Data Documentation

◆ m_d

Imp* VP1CustomTourFrameWidget::m_d
private

Definition at line 74 of file VP1CustomTourFrameWidget.h.


The documentation for this class was generated from the following files:
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
VP1Serialise
Definition: VP1Serialise.h:45
VP1CustomTourFrameWidget::Imp::dragStartPosition
QPoint dragStartPosition
Definition: VP1CustomTourFrameWidget.cxx:36
VP1CustomTourFrameWidget::frameEnableStateChanged
void frameEnableStateChanged()
VP1CustomTourFrameWidget::requestSwap
void requestSwap(VP1CustomTourFrameWidget *, VP1CustomTourFrameWidget *)
VP1CustomTourFrameWidget::requestShow
void requestShow()
VP1CustomTourFrameWidget::requestStepToLater
void requestStepToLater()
VP1CustomTourFrameWidget::requestDelete
void requestDelete()
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
VP1CustomTourFrameWidget::Imp::camPerspective
bool camPerspective
Definition: VP1CustomTourFrameWidget.cxx:37
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VP1Deserialise
Definition: VP1Deserialise.h:44
VP1CustomTourFrameWidget::m_d
Imp * m_d
Definition: VP1CustomTourFrameWidget.h:73
VP1CustomTourFrameWidget::requestStepToEarlier
void requestStepToEarlier()
VP1CustomTourFrameWidget::camState
QByteArray camState() const
Definition: VP1CustomTourFrameWidget.cxx:191
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
VP1CustomTourFrameWidget::Imp::camState
QByteArray camState
Definition: VP1CustomTourFrameWidget.cxx:38
VP1CustomTourFrameWidget::Imp::init
void init()
Definition: VP1CustomTourFrameWidget.cxx:67
copySelective.source
string source
Definition: copySelective.py:32
VP1CustomTourFrameWidget::frameIsEnabled
bool frameIsEnabled() const
Definition: VP1CustomTourFrameWidget.cxx:149
VP1CustomTourFrameWidget
Definition: VP1CustomTourFrameWidget.h:23
VP1CustomTourFrameWidget::Imp::ui
Ui::VP1CustomTourFrameWidgetForm ui
Definition: VP1CustomTourFrameWidget.cxx:35