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

Public Member Functions

 StoredView (QByteArray camState, bool camPerspective, QPixmap snapShot, QString name)
 
 StoredView (QByteArray persistifiedState)
 
QString name () const
 
QByteArray camState () const
 
bool camStateIsPerspective () const
 
QPixmap snapShot () const
 
QByteArray persistifiedState () const
 
QIcon icon () const
 
bool isValid ()
 

Private Attributes

QByteArray m_camState
 
bool m_camPerspective
 
QPixmap m_snapShot
 
QString m_name
 
QIcon m_cachedIcon
 

Detailed Description

Definition at line 327 of file VP1ExaminerViewer.cxx.

Constructor & Destructor Documentation

◆ StoredView() [1/2]

VP1ExaminerViewer::Imp::StoredView::StoredView ( QByteArray  camState,
bool  camPerspective,
QPixmap  snapShot,
QString  name 
)
inline

Definition at line 329 of file VP1ExaminerViewer.cxx.

◆ StoredView() [2/2]

VP1ExaminerViewer::Imp::StoredView::StoredView ( QByteArray  persistifiedState)

Definition at line 429 of file VP1ExaminerViewer.cxx.

430 : m_camPerspective(true)
431 {
432  VP1Msg::messageVerbose("StoredView()");
433 
434  // ===> Setup stream for getting the contents of the byteArray:
435  QBuffer buffer(&persistifiedState);
436  buffer.open(QIODevice::ReadOnly);
437  QDataStream state(&buffer);
438  // ===> Check version and pass on state info to base class:
439  qint32 version;
440  state >> version;
441  if (version!=0) {
442  VP1Msg::messageDebug("VP1ExaminerViewer Warning: "
443  "Attempt to depersistify stored view ignored due to bad version!");
444  return;
445  }
446  // ===> Decode the state info:
447  state >> m_name;
448  state >> m_camState;
449  state >> m_camPerspective;
450  state >> m_snapShot;
451  if (!buffer.atEnd())
452  m_name = "";//To make isValid() return false;
453  // ===> Finish up:
454  buffer.close();
455 }

Member Function Documentation

◆ camState()

QByteArray VP1ExaminerViewer::Imp::StoredView::camState ( ) const
inline

Definition at line 333 of file VP1ExaminerViewer.cxx.

333 { return m_camState; }

◆ camStateIsPerspective()

bool VP1ExaminerViewer::Imp::StoredView::camStateIsPerspective ( ) const
inline

Definition at line 334 of file VP1ExaminerViewer.cxx.

334 { return m_camPerspective; }

◆ icon()

QIcon VP1ExaminerViewer::Imp::StoredView::icon ( ) const
inline

Definition at line 337 of file VP1ExaminerViewer.cxx.

337  {
338  if (m_cachedIcon.isNull())
339  m_cachedIcon = QIcon(m_snapShot);
340  return m_cachedIcon;
341  }

◆ isValid()

bool VP1ExaminerViewer::Imp::StoredView::isValid ( )
inline

Definition at line 342 of file VP1ExaminerViewer.cxx.

342 { return !m_name.isEmpty()&&!m_camState.isEmpty()&&!m_snapShot.isNull(); }

◆ name()

QString VP1ExaminerViewer::Imp::StoredView::name ( ) const
inline

Definition at line 332 of file VP1ExaminerViewer.cxx.

332 { return m_name; }

◆ persistifiedState()

QByteArray VP1ExaminerViewer::Imp::StoredView::persistifiedState ( ) const

Definition at line 406 of file VP1ExaminerViewer.cxx.

407 {
408  VP1Msg::messageVerbose("persistifiedState()");
409 
410  // ===> Setup stream writing to a byteArray:
411  QByteArray byteArray;
412  QBuffer buffer(&byteArray);
413  buffer.open(QIODevice::WriteOnly);
414  QDataStream out(&buffer);
415 
416  // ===> Write Data:
417  out << (qint32)0;//version
418  out << m_name;
419  out << m_camState;
421  out << m_snapShot;
422 
423  // ===> Finish up:
424  buffer.close();
425  return byteArray;
426 }

◆ snapShot()

QPixmap VP1ExaminerViewer::Imp::StoredView::snapShot ( ) const
inline

Definition at line 335 of file VP1ExaminerViewer.cxx.

335 { return m_snapShot; }

Member Data Documentation

◆ m_cachedIcon

QIcon VP1ExaminerViewer::Imp::StoredView::m_cachedIcon
mutableprivate

Definition at line 350 of file VP1ExaminerViewer.cxx.

◆ m_camPerspective

bool VP1ExaminerViewer::Imp::StoredView::m_camPerspective
private

Definition at line 347 of file VP1ExaminerViewer.cxx.

◆ m_camState

QByteArray VP1ExaminerViewer::Imp::StoredView::m_camState
private

Definition at line 346 of file VP1ExaminerViewer.cxx.

◆ m_name

QString VP1ExaminerViewer::Imp::StoredView::m_name
private

Definition at line 349 of file VP1ExaminerViewer.cxx.

◆ m_snapShot

QPixmap VP1ExaminerViewer::Imp::StoredView::m_snapShot
private

Definition at line 348 of file VP1ExaminerViewer.cxx.


The documentation for this class was generated from the following file:
VP1ExaminerViewer::Imp::StoredView::m_name
QString m_name
Definition: VP1ExaminerViewer.cxx:349
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
VP1ExaminerViewer::Imp::StoredView::m_snapShot
QPixmap m_snapShot
Definition: VP1ExaminerViewer.cxx:348
VP1ExaminerViewer::Imp::StoredView::persistifiedState
QByteArray persistifiedState() const
Definition: VP1ExaminerViewer.cxx:406
VP1ExaminerViewer::Imp::StoredView::name
QString name() const
Definition: VP1ExaminerViewer.cxx:332
VP1ExaminerViewer::Imp::StoredView::m_camState
QByteArray m_camState
Definition: VP1ExaminerViewer.cxx:346
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
VP1ExaminerViewer::Imp::StoredView::camState
QByteArray camState() const
Definition: VP1ExaminerViewer.cxx:333
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
VP1ExaminerViewer::Imp::StoredView::m_cachedIcon
QIcon m_cachedIcon
Definition: VP1ExaminerViewer.cxx:350
get_generator_info.version
version
Definition: get_generator_info.py:33
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition: VP1Msg.cxx:39
VP1ExaminerViewer::Imp::StoredView::m_camPerspective
bool m_camPerspective
Definition: VP1ExaminerViewer.cxx:347
VP1ExaminerViewer::Imp::StoredView::snapShot
QPixmap snapShot() const
Definition: VP1ExaminerViewer.cxx:335