ATLAS Offline Software
VP1ExaminerViewer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 
8 // //
9 // Implementation of class VP1ExaminerViewer //
10 // //
11 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
12 // Initial version: March 2008 //
13 // //
14 // Major updates: //
15 // Sep 2013, Riccardo-Maria BIANCHI rbianchi@cern.ch //
16 // Sep 2017, Riccardo-Maria BIANCHI rbianchi@cern.ch //
17 // //
19 
21 #include "VP1Base/VP1Controller.h"
22 #include "VP1Base/VP1Msg.h"
25 #include "VP1Base/VP1QtUtils.h"
27 #include "VP1Base/VP1Settings.h"
32 
33 #include <Inventor/nodes/SoSphere.h>
34 #include <Inventor/nodes/SoGroup.h>
35 #include <Inventor/nodes/SoPerspectiveCamera.h>
36 #include <Inventor/nodes/SoSeparator.h>
37 #include <Inventor/Qt/widgets/SoQtPopupMenu.h>
38 #include <Inventor/events/SoKeyboardEvent.h>
39 #include <Inventor/events/SoMouseButtonEvent.h>
40 #include <Inventor/nodes/SoEnvironment.h>
41 #include <Inventor/actions/SoSearchAction.h>
42 #include <Inventor/nodekits/SoBaseKit.h>
43 #include <Inventor/SoSceneManager.h>
44 
45 #include <QBuffer>
46 #include <QByteArray>
47 #include <QMenu>
48 #include <QCursor>
49 #include <QColorDialog>
50 #include <QFileDialog>
51 #include <QInputDialog>
52 #include <QPushButton>
53 #include <QGLFormat>
54 
55 // Has to be after qt headers because qt uses its own glext.
56 #include "VP1HEPVis/gl2ps.h"
57 
58 #include <map>
59 #include <iostream>
60 #include <typeinfo>
61 
62 //TODO: Statustips.
63 //TODO: windows menu button should launch the menu (in correct mode?).
64 //TODO: detectorviewbuttons (+others) in menu so hidden control modes has access to everything!
65 //TODO: preserve spinning when going to next event (or when tour returns).
66 
67 //____________________________________________________________________
69 
70 public:
71  Imp (const Imp&) = delete;
72  Imp& operator= (const Imp&) = delete;
73 
74  Imp(VP1ExaminerViewer*tc,bool dvb)
75 : theclass(tc),
76  takeTourButton(0),
79  environmentNode(0),
82  popup_menu(0),
120  action_moviefps(0),
123  stereo_offset_value(0.0),
125  detectorViewButtons(dvb),
126  animationSequencer(tc),
127  tourLoopsForever(false),
130  isantialias(false),
131  button_interact(0),
132  button_examine(0),
133  button_home(0),
134  button_sethome(0),
135  button_viewall(0),
136  button_seek(0),
138  sphere(0),
139  decorationMenuRemoved(false),
141  movieFrameFileNamePrefix("vp1_frame"),
143 {
144  VP1Msg::messageVerbose("VP1ExaminerViewer::Imp() constructor");
145  signalcatcher->m_d = this; init();
146 
147  // TEST
148  // With this command, Coin does not clear the pixel-buffer,
149  // so the previous (or background) image
150  // is not removed before the new rendering.
151  // theclass->setClearBeforeRender(FALSE, TRUE);
152  // theclass->setClearBeforeRender(FALSE, FALSE);
153  // theclass->setClearBeforeOverlayRender(FALSE);
154 }
155 
157  {
158  VP1Msg::messageVerbose("VP1ExaminerViewer::~Imp() destructor");
159  if (actualSceneGraph)
160  actualSceneGraph->unref();
161  if (environmentNode)
162  environmentNode->unref();
163  if (customtoureditor)
164  customtoureditor->deleteLater();
165  if (customstereoeditor)
166  customstereoeditor->deleteLater();
167  delete popup_menu;
168  delete signalcatcher;
169  if (sphere)
170  sphere->unref();
171  }
172 
173 
174 
176  QString toString(const REGION& r) {
177  switch (r) {
178  case VERTEX: return "VERTEX";
179  case INDET: return "INDET";
180  case FORWARDREGION: return "FORWARDREGION";
181  case CALO: return "CALO";
182  case MUON: return "MUON";
183  default: return "Unknown(ERROR)";
184  }
185  }
186 
188 
189  enum VIEW { ASIDE, CSIDE, BARREL };
190  std::map<QPushButton*,std::pair<REGION,VIEW> > detectorbuttons;
191  QPushButton *takeTourButton; // * JFB
192 
193  enum ROTATIONMODE { XROT, ZROT };
195 
196 
197  QPushButton * addNewButton(QString text,QString tooltip,REGION region ,VIEW view,QWidget * tempparent, QString iconname="");
198  void init();
199  void detectorZoomButtonClicked(std::pair<REGION,VIEW>);
200  void takeTourButtonClicked(); // * JFB
201  void grabFocus();
202 
203 
204  SoGroup * actualSceneGraph;
205  SoEnvironment * environmentNode;
206 
207 
208 
209 
210  bool ensureMenuInit();
211  void updatePopupMenuStates();
215  QMenu * popup_menu;
227  QList<QAction*> popup_transptype_actions;
254  QAction * action_moviewidth;
256  QAction * action_moviefps;
259  // stereo view
262 // QList<QAction*> popup_stereo_offset_actions;
263 // QList<QAction*> popup_stereo_type_actions;
264 // QList<QAction*> popup_stereo_anaglyph_actions;
265 // QList<QAction*> popup_stereo_anaglyph_actions_camera;
266 // QMenu * stereo_set_anaglyph_menu;
267 // QMenu * stereo_set_stereo_camera_view_menu;
268 // QAction* popup_stereo_offset_value_action;
269 // QAction* popup_stereo_offset_value_action_camera;
270 // QAction* popup_stereo_balance_value_action_camera;
271 
272 
274  if (environmentNode) {
275  int al = theclass->ambientLight();
276  environmentNode->ambientIntensity = (al==0?0.0f:(al==100?1.0f:al/100.0f));
277  }
278  }
279 
280 
286  bool updateAnimationSequence();//Returns false if nothing is to be animated (i.e. no regions selected)
289  QPushButton * button_interact;
290  QPushButton * button_examine;
291  QPushButton * button_home;
292  QPushButton * button_sethome;
293  QPushButton * button_viewall;
294  QPushButton * button_seek;
295  QPushButton * button_togglecamera;
296  SoSphere * sphere;
297  SoSphere * getRegionSphere(REGION,bool perspective);
298 
300 
301  float rotZWheelMotion(float value, float oldvalue);
302  float rotXWheelMotion(float value, float oldvalue);
303  void rotateCamera(SoCamera * cam,const SbVec3f & aroundaxis,const float delta);
304  static int drawStyleToInt(SoQtViewer::DrawStyle);
305  static SoQtViewer::DrawStyle intToDrawStyle(int);
306 
307 
310  popup_ambientLightAction->setText("Change ambient &light [current "+QString::number(ambientLightPercentage)+"%]");
311  }
313 
314 
316 
317  void updateMovieMenuVisuals();
318 
319  void aboutToShowMenu(QMenu *);
320 
321  QString lastDumpFile;
322  QString lastSVGFile;
323  QString lastEPSFile;
325  QByteArray resetCamera_state;
326 
327  class StoredView {
328  public:
329  StoredView(QByteArray camState, bool camPerspective, QPixmap snapShot, QString name)
331  StoredView(QByteArray persistifiedState);
332  QString name() const { return m_name; }
333  QByteArray camState() const { return m_camState; }
334  bool camStateIsPerspective() const { return m_camPerspective; }
335  QPixmap snapShot() const { return m_snapShot; }
336  QByteArray persistifiedState() const;
337  QIcon icon() const {
338  if (m_cachedIcon.isNull())
339  m_cachedIcon = QIcon(m_snapShot);
340  return m_cachedIcon;
341  }
342  bool isValid() { return !m_name.isEmpty()&&!m_camState.isEmpty()&&!m_snapShot.isNull(); }
343 
344 
345  private:
346  QByteArray m_camState;
348  QPixmap m_snapShot;//FIXME: Update this whenever we have just "restored view"
349  QString m_name;
350  mutable QIcon m_cachedIcon;
351  };
352 
353  bool fitsCurrentCamType(const StoredView& sv) { return sv.camStateIsPerspective()==theclass->currentCamIsPerspective(); }
354 
355  QList<StoredView> storedViews;
358  viewmenu_deleteview->setEnabled(!storedViews.isEmpty());
360  viewmenu_restoreview->setEnabled(!storedViews.isEmpty());
362  viewmenu_zoomtoview->setEnabled(!storedViews.isEmpty());
363  }
364  QList<QAction*> storeViewActions;
365  QList<QAction*> restoreViewActions;
366  QList<QAction*> deleteViewActions;
367  QList<QAction*> zoomToViewActions;
369  const bool perspective(theclass->currentCamIsPerspective());
370  int i(1);
371  while (true) {
372  QString n = QString(perspective?"Perspective":"Orthographic")+"View"+QString::number(i++);
373  bool ok(true);
374  for(StoredView sv : storedViews) {
375  if (sv.name()==n) {
376  ok = false;
377  break;
378  }
379  }
380  if (ok)
381  return n;
382  }
383  }
384 
386  // For persistification, etc. of draw styles (possibly move to util class) //
388  static QList<SoQtViewer::DrawStyle> getAllViewerDrawStyles();
389  static int viewerDrawStyleToInt( SoQtViewer::DrawStyle );//Returns -1 if unknown.
390  static SoQtViewer::DrawStyle intToViewerDrawStyle( int );//Return VIEW_AS_IS if unknown;
391  static QString viewerDrawStyle2PrettyString( SoQtViewer::DrawStyle );//Returns "" if unknown.
392  // Stereo view
393  static QList<SoQtViewer::StereoType> getAllStereoViewTypes();
394  static int viewerStereoTypeToInt( SoQtViewer::StereoType );//Returns -1 if unknown.
395  static SoQtViewer::StereoType intToViewerStereoType( int );//Return STEREO_NONE if unknown;
396  static QString viewerStereoType2PrettyString( SoQtViewer::StereoType );//Returns "" if unknown.
397 
398 
399 
400 };
401 
402 
403 
404 
405 //____________________________________________________________________
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 }
427 
428 //____________________________________________________________________
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 }
456 
457 
458 
459 //____________________________________________________________________
464 // N.B.
465 // this code has been taken and adapted from CMSSW:
466 // http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ISpy/Client/src/ISpy3DView.cc?view=co
467 //
468 void debugCameraClipPlanes(void * data, const SbVec2f & nearfar)
469 {
470  SoCamera *camera = ((VP1ExaminerViewer *) data)->getCamera();
471  SoNode *scenegraph = ((VP1ExaminerViewer *) data)->getSceneGraph();
472 
473  SbVec3f pos = camera->position.getValue();
474 
475  SoSearchAction action;
476  SbBool oldsearch = SoBaseKit::isSearchingChildren();
477  SoBaseKit::setSearchingChildren(TRUE);
478 
479  action.setSearchingAll(true);
480  action.setType(SoCamera::getClassTypeId());
481  action.setInterest(SoSearchAction::ALL);
482  action.apply(scenegraph);
483 
484  SoBaseKit::setSearchingChildren(oldsearch);
485 
486  SoPathList &cameras = action.getPaths();
487 
488  for (int i = 0, e = cameras.getLength(); i != e; ++i) {
489  auto* tail = cameras[i]->getTail();
490  std::cerr << "Camera #" << i << " = " << (void *) tail << "(" << typeid(*tail).name() << ")\n";
491  }
492 
493  std::cerr << "Calculated clip-planes. Near: " << nearfar[0] << ". Far: " << nearfar[1] << "\n"
494  << "Current camera clip-planes. Near: " << camera->nearDistance.getValue() << ", Far: " << camera->farDistance.getValue() << "\n"
495  << "Camera ptr: " << (void *) camera << "\n"
496  << "Camera name: " << camera->getName() << "\n"
497  << "Camera type: " << typeid(*camera).name() << "\n"
498  << "Camera position:(" << pos[0] << ", " << pos[1] << ", " << pos[2] << ")\n"
499  << "Number of cameras in the scene: " << cameras.getLength() << "\n"
500  << "Focal distance: " << camera->focalDistance.getValue() << std::endl;
501 }
502 
503 //____________________________________________________________________
508 // N.B.
509 // this code has been taken and adapted from CMSSW:
510 // http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ISpy/Client/src/ISpy3DView.cc?view=co
511 //
512 SbVec2f fixedDistanceClipPlanesCB(void * data, const SbVec2f & nearfar)
513 {
514  SoCamera *camera = ((VP1ExaminerViewer *) data)->getCamera();
515  if (0) debugCameraClipPlanes(data, nearfar);
516 
517  if (camera->nearDistance.getValue() != nearfar[0])
518  camera->nearDistance = nearfar[0];
519  if (camera->farDistance.getValue() != nearfar[1])
520  camera->farDistance = nearfar[1];
521 
522  return nearfar;
523 }
524 
525 //____________________________________________________________________
527  bool detectorViewButtons,
528  const char * name,
529  SbBool embed,
530  SoQtFullViewer::BuildFlag flag,
532 : SoQtExaminerViewer(parent,(name?name:"VP1ExaminerViewer"),embed,flag,type,false/*delay createViewerButtons call*/),
534 {
535  VP1Msg::messageDebug("VP1ExaminerViewer::VP1ExaminerViewer()");
536  // Explicitly trigger the construction of viewer decorations.
537  QWidget * widget = buildWidget(getParentWidget());
538  if (rightWheelLabel)
539  rightWheelLabel->setVisible(false);//it will be shown again by the first setCameraType call
540  setBaseWidget(widget);
541  setLeftWheelString("Rotz");
543 // setRightWheelString("Zoom");
544  setRightWheelString("Zoom test");
545  leftWheel->setMinimumHeight(20);
546  rightWheel->setMinimumHeight(20);
547 
548 
549  /* set the clipping strategy and fix the clipping
550  *
551  * N.B.
552  * this code has been taken and adapted from CMSSW:
553  * http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ISpy/Client/src/ISpy3DView.cc?view=co
554  */
555  setAutoClippingStrategy(CONSTANT_NEAR_PLANE, 0.9, fixedDistanceClipPlanesCB, this);
556 
557  // Let's build this now, otherwise there will be problems with making the connections later:
559  QObject::connect(&(m_d->animationSequencer),SIGNAL(clipVolumePercentOfATLAS(double)),m_d->customtoureditor,SLOT(setClipVolumePercentOfATLAS(double)));
562  if (m_d->customtoureditorState!=QByteArray()) {
564  m_d->customtoureditorState = QByteArray();
565  }
566 
567  // test Ric
568  VP1Msg::messageVerbose("is stereo: " + QString(isStereoViewing()) + " - offset: " + QString::number(getStereoOffsetSlot()) + " - type: " + QString::number(getStereoType()) );
569 }
570 
571 
572 // stereographic view methods
574  VP1Msg::messageDebug("VP1ExaminerViewer::setStereoOffsetSlot() - offset: " + QString::number(offset));
575  SoQtExaminerViewer::setStereoOffset(offset);
576 }
578  return SoQtExaminerViewer::getStereoOffset();
579 }
580 SbBool VP1ExaminerViewer::setStereoTypeSlot(SoQtViewer::StereoType type) {
581  VP1Msg::messageDebug("VP1ExaminerViewer::setStereoTypeSlot() - type: " + QString::number(type));
582  return SoQtExaminerViewer::setStereoType(type);
583 }
584 SoQtViewer::StereoType VP1ExaminerViewer::getStereoTypeSlot(void) const {
585  return SoQtExaminerViewer::getStereoType();
586 }
587 void VP1ExaminerViewer::setAnaglyphStereoColorMasksSlot(const SbBool left[3], const SbBool right[3]) {
588  SoQtExaminerViewer::setAnaglyphStereoColorMasks(left, right);
589 }
590 void VP1ExaminerViewer::getAnaglyphStereoColorMasksSlot(SbBool left[3], SbBool right[3]) {
591  SoQtExaminerViewer::getAnaglyphStereoColorMasks(left, right);
592 }
593 
594 
595 
596 
597 //____________________________________________________________________
598 int VP1ExaminerViewer::Imp::drawStyleToInt(SoQtViewer::DrawStyle ds) {
599  switch (ds) {
600  case VIEW_AS_IS: return 0;
601  case VIEW_HIDDEN_LINE: return 1;
602  case VIEW_NO_TEXTURE: return 2;
603  case VIEW_LOW_COMPLEXITY: return 3;
604  case VIEW_LINE: return 4;
605  case VIEW_POINT: return 5;
606  case VIEW_BBOX: return 6;
607  case VIEW_LOW_RES_LINE: return 7;
608  case VIEW_LOW_RES_POINT: return 8;
609  case VIEW_SAME_AS_STILL: return 9;
610  case VIEW_WIREFRAME_OVERLAY : return 10;
611  default:
612  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::drawStyleToInt ERROR: Unknown draw style");
613  return 0;
614  }
615 }
616 
617 //____________________________________________________________________
618 SoQtViewer::DrawStyle VP1ExaminerViewer::Imp::intToDrawStyle(int i) {
619  switch (i) {
620  case 0: return SoQtViewer::VIEW_AS_IS;
621  case 1: return SoQtViewer::VIEW_HIDDEN_LINE;
622  case 2: return SoQtViewer::VIEW_NO_TEXTURE;
623  case 3: return SoQtViewer::VIEW_LOW_COMPLEXITY;
624  case 4: return SoQtViewer::VIEW_LINE;
625  case 5: return SoQtViewer::VIEW_POINT;
626  case 6: return SoQtViewer::VIEW_BBOX;
627  case 7: return SoQtViewer::VIEW_LOW_RES_LINE;
628  case 8: return SoQtViewer::VIEW_LOW_RES_POINT;
629  case 9: return SoQtViewer::VIEW_SAME_AS_STILL;
630  case 10: return SoQtViewer::VIEW_WIREFRAME_OVERLAY;
631  default:
632  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::intToDrawStyle ERROR: int out of range "+str(i));
633  return SoQtViewer::VIEW_AS_IS;
634  }
635 }
636 
637 //____________________________________________________________________
639 {
640  VP1Msg::messageVerbose("VP1ExaminerViewer::saveState");
641 
642  // ===> Setup stream writing to a byteArray:
643  QByteArray byteArray;
644  QBuffer buffer(&byteArray);
645  buffer.open(QIODevice::WriteOnly);
646  QDataStream out(&buffer);
647 
648  // ===> Write Data:
649  //Version:
650  out << (qint32)6; //version
651 
652  //Background color:
653  QColor bgdcol(VP1QtInventorUtils::sbcol2qcol(getBackgroundColor()));
654  out << bgdcol;
655  VP1Msg::messageVerbose("saveState background color = "+str(bgdcol));
656 
657  //Render buffer:
658  int ibuffer(0);
659  if (getBufferingType()==BUFFER_SINGLE)
660  ibuffer=1;
661  else if (getBufferingType()==BUFFER_INTERACTIVE)
662  ibuffer=2;
663  out << ibuffer;
664  VP1Msg::messageVerbose("saveState Render Buffer = ("+str(ibuffer)+")");
665 
666  //Camera type and parameters:
667  bool isperspective(currentCamIsPerspective());
668  out << isperspective;
669  out << currentCameraState();
670  VP1Msg::messageVerbose("saveState camera type = "+str(isperspective?"Perspective":"Orthographic"));
671 
672  //Misc:
673  const bool isdeco(isDecoration()), isheadlight(isHeadlight()),isviewing(isViewing());
674  out << isdeco;
675  out << isheadlight;
676  out << isviewing;
678  VP1Msg::messageVerbose("saveState (deco,headlight,viewing,nodecomenu) = ("
679  +str(isdeco)+", "+str(isheadlight)+", "+str(isviewing)+", "+str(m_d->decorationMenuRemoved)+")");
680 
681  //Antialiasing state:
682  out << m_d->isantialias;//version 6+
683  VP1Msg::messageVerbose("saveState (isantialis)) = ("+str(m_d->isantialias)+")");
684  //OLD (up to version 5):
685  // SbBool smoothing; int numPasses;
686  // getAntialiasing(smoothing, numPasses);
687  // out << smoothing;
688  // out << numPasses;
689  // VP1Msg::messageVerbose("saveState (smoothing,numPasses)) = ("+str(smoothing)+", "+str(numPasses)+")");
690 
691  //Draw style:
692  int idrawstyle_still = Imp::drawStyleToInt(getDrawStyle(STILL));
693  int idrawstyle_interactive = Imp::drawStyleToInt(getDrawStyle(INTERACTIVE));
694  out << idrawstyle_still;
695  out << idrawstyle_interactive;
696  VP1Msg::messageVerbose("saveState DrawStyle (still,interactive)) = ("+str(idrawstyle_still)+", "+str(idrawstyle_interactive)+")");
697 
698  //Transparency type:
699  int itransp = VP1QtInventorUtils::transparencyTypeToInt(getTransparencyType());
700  out << itransp;
701  VP1Msg::messageVerbose("saveState Transparency Type = ("+str(itransp)+")");
702 
704  // Added for version 1 //
706 
707  m_d->ensureMenuInit();
708  out << m_d->popup_tourReturnToStartAction->isChecked();
709  out << m_d->popup_tourStartEachEvent->isChecked();
710 
711  qint32 ispeed(0);//medium
712  if (m_d->popup_tourSpeedVerySlow->isChecked()) ispeed = -2;
713  else if (m_d->popup_tourSpeedSlow->isChecked()) ispeed = -1;
714  else if (m_d->popup_tourSpeedFast->isChecked()) ispeed = 1;
715  else if (m_d->popup_tourSpeedVeryFast->isChecked()) ispeed = 2;
716  out << ispeed;
717 
718  out << m_d->popup_tourPartsVertex->isChecked();
719  out << m_d->popup_tourPartsInDet->isChecked();
720  out << m_d->popup_tourPartsCalo->isChecked();
721  out << m_d->popup_tourPartsMuon->isChecked();
722 
723  qint32 iloop(1);
724  if (m_d->popup_tourLoopTwice->isChecked()) iloop = 2;
725  else if (m_d->popup_tourLoopThrice->isChecked()) iloop = 3;
726  else if (m_d->popup_tourLoopForever->isChecked()) iloop = 999;
727  out << iloop;
728 
730  // Added for version 2 //
734 
736  // Added for version 3 //
738 
739  QList<QByteArray> persistifiedViews;
741  persistifiedViews << sv.persistifiedState();
742  out << persistifiedViews;
743 
745  // Added for version 4 //
747 
749 
751  // Added for version 5 //
753 
754  out << (m_d->customtoureditor ? m_d->customtoureditor->state() : QByteArray());
755 
756  // ===> Finish up:
757  buffer.close();
758  return byteArray;
759 
760 }
761 
762 
763 //____________________________________________________________________
764 void VP1ExaminerViewer::restoreFromState(QByteArray ba_state)
765 {
766  VP1Msg::messageVerbose("VP1ExaminerViewer::restoreFromState");
767 
768  // ===> Setup stream for getting the contents of the byteArray:
769  QBuffer buffer(&ba_state);
770  buffer.open(QIODevice::ReadOnly);
771  QDataStream state(&buffer);
772  // ===> Check version and pass on state info to base class:
773  qint32 version;
774  state >> version;
775  if (version<0||version>6) {
776  VP1Msg::messageDebug("VP1ExaminerViewer Warning: Input state data is in wrong format - ignoring!");
777  return;
778  }
779  // ===> Decode the state info:
780 
781  //Background color:
782  QColor bgdcol;
783  state >> bgdcol;
784  if (bgdcol.isValid())
785  setBackgroundColor(VP1QtInventorUtils::qcol2sbcol(bgdcol));
786  VP1Msg::messageVerbose("restoreState background color = "+str(bgdcol));
787 
788  //Render buffer:
789  int ibuffer;
790  state >> ibuffer;
791  if (ibuffer==1) setBufferingType(BUFFER_SINGLE);
792  else if (ibuffer==2) setBufferingType(BUFFER_INTERACTIVE);
793  else setBufferingType(BUFFER_DOUBLE);
794  VP1Msg::messageVerbose("restoreState Render Buffer = ("+str(ibuffer)+")");
795 
796  //camtype and camera parameters:
797  bool isperspective;
798  state >> isperspective;
799  if (isperspective != currentCamIsPerspective())
801  QByteArray ba_cam;
802  state>>ba_cam;
803  if (getCamera()&&ba_cam!=QByteArray())
804  VP1QtInventorUtils::deserializeSoCameraParameters(ba_cam,*(getCamera()));//Fixme: Check return value?
805  VP1Msg::messageVerbose("restoreState camera type = "+str(isperspective?"Perspective":"Orthographic"));
806 
807  //misc:
808  bool isdeco, isheadlight, isviewing, decoremoved;
809  state >> isdeco; if (isdeco!=isDecoration()) setDecoration(isdeco);
810  state >> isheadlight; if (isheadlight!=isHeadlight()) setHeadlight(isheadlight);
811  state >> isviewing; if (isviewing!=isViewing()) setViewing(isviewing);
812  state >> decoremoved; if (decoremoved) removeDecorationMenuOption();
813  VP1Msg::messageVerbose("saveState (deco,headlight,viewing,nodecomenu) = ("
814  +str(isdeco)+", "+str(isheadlight)+", "+str(isviewing)+", "+str(decoremoved)+")");
815 
816  //Antialiasing state:
817  if (version<=5) {
818  SbBool smoothing; int numPasses;
819  state >> smoothing;
820  state >> numPasses;
821  m_d->isantialias=smoothing;
822  }
823  if (version>=6) {
824  state >> m_d->isantialias;
825  }
827  VP1Msg::messageVerbose("restoreState (isantialias)) = ("+str(m_d->isantialias)+")");
828  // getAntialiasing(current_smoothing, current_numPasses);
829  // state >> smoothing;
830  // state >> numPasses;
831  // if (numPasses<9999&&(current_smoothing!=smoothing||current_numPasses!=numPasses))
832  // setAntialiasing(smoothing,numPasses);
833  // VP1Msg::messageVerbose("restoreState (smoothing,numPasses)) = ("+str(smoothing)+", "+str(numPasses)+")");
834 
835  //Draw style:
836  int idrawstyle_still, idrawstyle_interactive;
837  state >> idrawstyle_still;
838  state >> idrawstyle_interactive;
839  setDrawStyle(STILL,Imp::intToDrawStyle(idrawstyle_still));
840  setDrawStyle(INTERACTIVE,Imp::intToDrawStyle(idrawstyle_interactive));
841  VP1Msg::messageVerbose("restoreState DrawStyle (still,interactive)) = ("+str(idrawstyle_still)+", "+str(idrawstyle_interactive)+")");
842 
843  //Transparency type:
844  int itransp;
845  state >> itransp;
847  VP1Msg::messageVerbose("restoreState Transparency Type = ("+str(itransp)+")");
848 
849  if (version>=1) {
850 
851  m_d->ensureMenuInit();
852  bool b;
853  state >> b; m_d->popup_tourReturnToStartAction->setChecked(b);
854  state >> b; m_d->popup_tourStartEachEvent->setChecked(b);
855 
856  qint32 ispeed;
857  state >> ispeed;
858  if (ispeed==-2) m_d->popup_tourSpeedVerySlow->setChecked(true);
859  else if (ispeed==-1) m_d->popup_tourSpeedSlow->setChecked(true);
860  else if (ispeed==1) m_d->popup_tourSpeedFast->setChecked(true);
861  else if (ispeed==2) m_d->popup_tourSpeedVeryFast->setChecked(true);
862 
863  state >> b; m_d->popup_tourPartsVertex->setChecked(b);
864  state >> b; m_d->popup_tourPartsInDet->setChecked(b);
865  state >> b; m_d->popup_tourPartsCalo->setChecked(b);
866  state >> b; m_d->popup_tourPartsMuon->setChecked(b);
867 
868  qint32 iloop;
869  state >> iloop;
870  if (iloop==2) m_d->popup_tourLoopTwice->setChecked(true);
871  else if (iloop==3) m_d->popup_tourLoopThrice->setChecked(true);
872  else if (iloop==999) m_d->popup_tourLoopForever->setChecked(true);
873 
874  }
875 
876  if (version>=2) {
877  state >> m_d->resetCamera_isPerspective;
878  state >> m_d->resetCamera_state;
880  bool v(m_d->resetCamera_state!=QByteArray());
881  if (m_d->popup_resetCameraAction->isVisible()!=v)
882  m_d->popup_resetCameraAction->setVisible(v);
883  }
884  }
885  if (version>=3) {
886  m_d->storedViews.clear();
887  QList<QByteArray> persistifiedViews;
888  state >> persistifiedViews;
889  for(QByteArray ba_pv : persistifiedViews) {
890  Imp::StoredView sv(ba_pv);
891  if (sv.isValid())
892  m_d->storedViews << sv;
893  }
895  }
896 
897  if (version>=4)
898  state >> m_d->ambientLightPercentage;
899 
900  if (version>=5) {
901  QByteArray ba;
902  state >> ba;
903  if (ba!=QByteArray()) {
904  if (!m_d->customtoureditor)
906  else
908  }
909  }
910 
913 
914  // ===> Finish up:
915  buffer.close();
916 }
917 
918 
919 //____________________________________________________________________
921 {
922 #if SOQT_MAJOR_VERSION <= 1 && SOQT_MINOR_VERSION <= 4 && SOQT_MICRO_VERSION <= 1
923  //Fix bug in SoQt, in which the menu does not get deleted (reported and fixed upstream after SoQt 1.4.1)
924  delete prefmenu;
925 #endif
926  delete m_d;
927  SoQtExaminerViewer::setSceneGraph(0);
928 }
929 
930 //____________________________________________________________________
931 void VP1ExaminerViewer::createViewerButtons(QWidget * parent, SbPList * buttonlist)
932 {
933  VP1Msg::messageVerbose("VP1ExaminerViewer::createViewerButtons");
934 
935  SoQtExaminerViewer::createViewerButtons(parent,buttonlist);
936  //buttonlist holds void pointers to pushbuttons
937 
938  if (buttonlist->getLength()==7) {
939  //Get pointers:
940  m_d->button_interact = static_cast<QPushButton*>(buttonlist->get(0));
941  m_d->button_examine = static_cast<QPushButton*>(buttonlist->get(1));
942  m_d->button_home = static_cast<QPushButton*>(buttonlist->get(2));
943  m_d->button_sethome = static_cast<QPushButton*>(buttonlist->get(3));
944  m_d->button_viewall = static_cast<QPushButton*>(buttonlist->get(4));
945  m_d->button_seek = static_cast<QPushButton*>(buttonlist->get(5));
946  m_d->button_togglecamera = static_cast<QPushButton*>(buttonlist->get(6));
947  //Other stuff? Connections? Change pixmaps?
948  m_d->button_interact->setToolTip("Pick mode (ESC/M toggles). Use this in order to select objects.");
949  m_d->button_examine->setToolTip("Navigation mode (ESC/M toggles). Use to ROTATE (left click), ZOOM (wheel or SHIFT+CTRL+left click) or PAN (middle click or SHIFT+left click or CTRL+left click).");
950  m_d->button_home->setToolTip("Change view to home view");
951  m_d->button_sethome->setToolTip("Store current view as new home");
952  m_d->button_viewall->setToolTip("View all objects currently displayed (V)");
953  m_d->button_seek->setToolTip("Seek to point (S). Sets cameras rotation centre to the clicked point and zooms towards it.");
954  m_d->button_togglecamera->setToolTip("Toggle (C) camera between perspective (P) and orthographic (O) mode.");
955  //These are just confusing anyway:
956  m_d->button_home->setVisible(false);
957  m_d->button_sethome->setVisible(false);
958  } else {
959  VP1Msg::message("VP1ExaminerViewer::createViewerButtons ERROR: Did not get list of exactly 7 buttons from base.");
960  }
961 }
962 
963 //____________________________________________________________________
964 QPushButton * VP1ExaminerViewer::Imp::addNewButton(QString text,QString tooltip,REGION region ,VIEW view,QWidget * tempparent, QString iconname)
965 {
966  VP1Msg::messageVerbose("VP1ExaminerViewer::Imp::addNewButton()");
967 
968  QPushButton * button = new QPushButton(tempparent);
969  if (iconname.isEmpty()) {
970  button->setText(text);
971  } else {
972  button->setIcon( QIcon(iconname) );
973  }
974  button->setToolTip(tooltip);
975  detectorbuttons[button] = std::make_pair(region,view);
976  button->setFocusPolicy(Qt::NoFocus);
977  // button->setIconSize(QSize(24, 24));
978  // button->setFixedSize(30, );
979  QObject::connect(button,SIGNAL(clicked()),signalcatcher,SLOT(catchSignal()));
980  theclass->addAppPushButton(button);
981  return button;
982 }
983 
984 //____________________________________________________________________
986 {
987  VP1Msg::messageVerbose("VP1ExaminerViewer::Imp::updateAnimationSequence()");
988  animationSequencer.sequence().clearAllFrames();
989  ensureMenuInit();
990 
991  //Speed:
992  double steptime=3;//seconds (fixme. Also, fix number of loops... Also, calculate total time and display in speed menu...
993  if (popup_tourSpeedVerySlow->isChecked())
994  steptime *= 3;
995  else if (popup_tourSpeedSlow->isChecked())
996  steptime *= 1.5;
997  else if (popup_tourSpeedFast->isChecked())
998  steptime /= 1.5;
999  else if (popup_tourSpeedVeryFast->isChecked())
1000  steptime /= 3;
1001 
1002  //cycles:
1003  tourLoopsForever = popup_tourLoopForever->isChecked();
1004  int nloops(1);//define number of loops
1005  if (popup_tourLoopTwice->isChecked())
1006  nloops = 2;
1007  else if (popup_tourLoopThrice->isChecked())
1008  nloops = 3;
1009 
1010  int nregions(0);
1011  tourLoopsForeverSkipFirstFrame = false;
1012  double firstfact(action_movieenabled->isChecked()?0.0:0.25);
1014  bool first(true);
1015  for (int iloop = 0; iloop < nloops; ++iloop) {
1016  if (popup_tourPartsMuon->isChecked()) {
1018  if (first||latestRegion!=region)
1019  animationSequencer.sequence().addFrame(region, SbVec3f(sin(6*M_PI/6), 0,cos(6*M_PI/6)), (first?firstfact:1.0)*steptime);
1020  animationSequencer.sequence().addFrame(region, SbVec3f(sin(10*M_PI/6), 0,cos(10*M_PI/6)), steptime);
1021  animationSequencer.sequence().addFrame(region, SbVec3f(sin(2*M_PI/6), 0,cos(2*M_PI/6)), steptime);
1022  animationSequencer.sequence().addFrame(region, SbVec3f(sin(6*M_PI/6), 0,cos(6*M_PI/6)), steptime);
1023  latestRegion=region;
1024  if (first)
1025  firstRegion = region;
1026  first=false;
1027  if (iloop==0)
1028  ++nregions;
1029  }
1030  if (popup_tourPartsCalo->isChecked()) {
1032  if (first||latestRegion!=region)
1033  animationSequencer.sequence().addFrame(region, SbVec3f(sin(6*M_PI/6), 0,cos(6*M_PI/6)), (first?firstfact:1.0)*steptime);
1034  animationSequencer.sequence().addFrame(region, SbVec3f(sin(10*M_PI/6), 0,cos(10*M_PI/6)), steptime);
1035  animationSequencer.sequence().addFrame(region, SbVec3f(sin(2*M_PI/6), 0,cos(2*M_PI/6)), steptime);
1036  animationSequencer.sequence().addFrame(region, SbVec3f(sin(6*M_PI/6), 0,cos(6*M_PI/6)), steptime);
1037  latestRegion=region;
1038  if (first)
1039  firstRegion = region;
1040  first=false;
1041  if (iloop==0)
1042  ++nregions;
1043  }
1044  if (popup_tourPartsInDet->isChecked()) {
1046  if (first||latestRegion!=region)
1047  animationSequencer.sequence().addFrame(region, SbVec3f(sin(6*M_PI/6), 0,cos(6*M_PI/6)), (first?firstfact:1.0)*steptime);
1048  animationSequencer.sequence().addFrame(region, SbVec3f(sin(10*M_PI/6), 0,cos(10*M_PI/6)), steptime);
1049  animationSequencer.sequence().addFrame(region, SbVec3f(sin(2*M_PI/6), 0,cos(2*M_PI/6)), steptime);
1050  animationSequencer.sequence().addFrame(region, SbVec3f(sin(6*M_PI/6), 0,cos(6*M_PI/6)), steptime);
1051  latestRegion=region;
1052  if (first)
1053  firstRegion = region;
1054  first=false;
1055  if (iloop==0)
1056  ++nregions;
1057  }
1058  if (popup_tourPartsVertex->isChecked()) {
1060  if (first||latestRegion!=region)
1061  animationSequencer.sequence().addFrame(region, SbVec3f(sin(6*M_PI/6), 0,cos(6*M_PI/6)), (first?firstfact:1.0)*steptime);
1062  animationSequencer.sequence().addFrame(region, SbVec3f(sin(10*M_PI/6), 0,cos(10*M_PI/6)), steptime);
1063  animationSequencer.sequence().addFrame(region, SbVec3f(sin(2*M_PI/6), 0,cos(2*M_PI/6)), steptime);
1064  animationSequencer.sequence().addFrame(region, SbVec3f(sin(6*M_PI/6), 0,cos(6*M_PI/6)), steptime);
1065  latestRegion=region;
1066  if (first)
1067  firstRegion = region;
1068  first=false;
1069  if (iloop==0)
1070  ++nregions;
1071  }
1072  if (first)//Apparently nothing was enabled
1073  return false;
1074  }
1075  if (tourLoopsForever && nregions==1)
1076  tourLoopsForeverSkipFirstFrame = true;
1077 
1078  if (!tourLoopsForever&&latestRegion!=firstRegion)
1079  animationSequencer.sequence().addFrame(firstRegion, SbVec3f(sin(6*M_PI/6), 0,cos(6*M_PI/6)), steptime);
1080  if (firstfact>0.0&&!tourLoopsForever)
1081  animationSequencer.sequence().addFrame(theclass->currentCameraState(),firstfact*steptime);
1082 
1083  return true;
1084 }
1085 
1086 
1087 //____________________________________________________________________
1089 {
1090  VP1Msg::messageVerbose("VP1ExaminerViewer::Imp::init");
1091  QWidget * tempparent = new QWidget();//Use this as temporary parent to
1092  //avoid the buttons temporarily
1093  //showing up as individual top
1094  //widgets.
1095  tempparent->setVisible(false);
1096  if (detectorViewButtons) {
1097  // addNewButton("VA","View vertex region from positive Z axis",VERTEX,ASIDE,tempparent);
1098  // addNewButton("VC","View vertex region from negative Z axis",VERTEX,CSIDE,tempparent);
1099 
1100  addNewButton("IA","View inner detector from positive Z axis",INDET,ASIDE,tempparent);
1101  addNewButton("IC","View inner detector from negative Z axis",INDET,CSIDE,tempparent);
1102 
1103  addNewButton("CA","View calorimeters from positive Z axis",CALO,ASIDE,tempparent);
1104  addNewButton("CC","View calorimeters from negative Z axis",CALO,CSIDE,tempparent);
1105 
1106  addNewButton("MA","View muon spectrometer from positive Z axis",MUON,ASIDE,tempparent);
1107  addNewButton("MC","View muon spectrometer from negative Z axis",MUON,CSIDE,tempparent);
1108 
1109  addNewButton("FA","View forward region from positive Z axis",FORWARDREGION,ASIDE,tempparent);
1110  addNewButton("FC","View forward region from negative Z axis",FORWARDREGION,CSIDE,tempparent);
1111 
1112  addNewButton("MB","View muon spectrometer from barrel",MUON,BARREL,tempparent, ":icons/icons/rphi.png");
1113 
1114  // This one is special:
1115  //addNewButton("XT", "Execute a tour of the detector",INDET, true, tempparent);
1116  {
1117  QPushButton *button = new QPushButton(tempparent);
1118  button->setText("XT");
1119  button->setToolTip("Execute a tour of the detector (configure in context menu)");
1120  button->setFocusPolicy(Qt::NoFocus);
1121  takeTourButton=button;
1122  QObject::connect(button,SIGNAL(clicked()), signalcatcher, SLOT(catchSignal()));
1123  theclass->addAppPushButton(button);
1124  QObject::connect(&animationSequencer,SIGNAL(animationFinishedSuccessfully()),signalcatcher,SLOT(catchSignal()));
1125  }
1126  }
1127  QWidget * w_spacer = new QWidget(tempparent);
1128  QSizePolicy sp_spacer(w_spacer->sizePolicy());
1129  unsigned vertStretch = 99999;
1130  sp_spacer.setVerticalStretch(vertStretch);
1131  w_spacer->setSizePolicy(sp_spacer);
1132  theclass->addAppPushButton(w_spacer);
1133 
1134  tempparent->deleteLater();
1135 }
1136 
1137 //____________________________________________________________________
1139 {
1140  if (!sender())
1141  return;
1142  if (sender()==&(m_d->animationSequencer)) {
1143  if (m_d->tourLoopsForever)
1145  return;
1146  }
1147  QPushButton* button = dynamic_cast<QPushButton*>(sender());
1148  if (button) {
1149  if (m_d->detectorbuttons.find(button)!=m_d->detectorbuttons.end())
1150  m_d->detectorZoomButtonClicked(m_d->detectorbuttons.find(button)->second);
1151  else if (button==m_d->takeTourButton)
1153  return;
1154  }
1155  QMenu* menu = dynamic_cast<QMenu*>(sender());
1156  if (menu) {
1158  return;
1159  }
1160  VP1Msg::messageDebug("VP1ExaminerViewer_SignalCatcher::catchSignal ERROR: Received unknown signal");
1161 }
1162 
1163 //____________________________________________________________________
1165 {
1166  VP1Msg::messageVerbose("VP1ExaminerViewer::startTour()");
1167  if (m_d->detectorViewButtons)
1169 }
1170 
1171 //____________________________________________________________________
1173 {
1174  VP1Msg::messageVerbose("VP1ExaminerViewer::startTourEachEvent()");
1175  return m_d->popup_tourStartEachEvent ? m_d->popup_tourStartEachEvent->isChecked() : false;
1176 }
1177 
1178 //____________________________________________________________________
1179 SoSphere * VP1ExaminerViewer::Imp::getRegionSphere(REGION region,bool perspective)
1180 {
1181  if (!sphere) {
1182  sphere = new SoSphere;
1183  sphere->ref();
1184  }
1185  double r(30);
1186  switch (region) {
1187  case VERTEX:
1188  VP1Msg::messageVerbose("set sphere dimensions for vertex");
1189  //r = perspective ? 0.5 : 0.5;
1190  r=0.5;
1191  break;
1192  case INDET:
1193  VP1Msg::messageVerbose("set sphere dimensions for indet");
1194  r = perspective ? 13 : 7;
1195  break;
1196  case CALO:
1197  VP1Msg::messageVerbose("set sphere dimensions for calo");
1198  r = perspective ? 35 : 27;
1199  break;
1200  case FORWARDREGION:
1201  VP1Msg::messageVerbose("set sphere dimensions for forward region");
1202  //r = perspective ? 600 : 600;
1203  r=600;
1204  break;
1205  case MUON:
1206  default:
1207  VP1Msg::messageVerbose("set sphere dimensions for muon");
1208  r = perspective ? 95 : 73;
1209  break;
1210  }
1211  sphere->radius = r * 1000.0;
1212  return sphere;
1213 }
1214 
1215 //____________________________________________________________________
1217 {
1218  VP1Msg::messageVerbose("VP1ExaminerViewer::Imp::grabFocus()");
1219  QWidget * w = theclass->getGLWidget();
1220  if (w)
1221  w->setFocus(Qt::OtherFocusReason);
1222 }
1223 
1224 //____________________________________________________________________
1226 {
1227  VP1Msg::messageVerbose("VP1ExaminerViewer::Imp::applyMovieSettingsToAnimationSequencer()");
1228 
1229  //Movie pars:
1230  if (action_movieenabled->isChecked()) {
1231  int width = action_moviewidth->data().toInt();
1232  int height = action_movieheight->data().toInt();
1233  int fps = action_moviefps->data().toInt();
1234  QString outdir = action_movieoutdir->data().toString();
1235  QDir().mkpath(outdir);
1236  animationSequencer.setMovie(true);
1237  animationSequencer.setMovieParameters(outdir,movieFrameFileNamePrefix,fps,width,height);
1238  } else {
1239  animationSequencer.setMovie(false);
1240  }
1241 }
1242 
1243 //____________________________________________________________________
1245 {
1246  VP1Msg::messageVerbose("startCustomTour begin.");
1247 
1249  return;
1250 
1251  m_d->grabFocus();
1252  if (isAnimating())
1253  stopAnimating();
1254  bool jump(m_d->action_movieenabled->isChecked());
1256  toggleCameraType();
1257  jump = true;
1258  }
1262  //Start animation:
1264 }
1265 
1266 //____________________________________________________________________
1268  VP1Msg::messageVerbose("takeTourButtonClicked begin.");
1269  grabFocus();
1270  if (theclass->isAnimating())
1271  theclass->stopAnimating();
1272  if (updateAnimationSequence()) {
1273  applyMovieSettingsToAnimationSequencer();
1274  //animationSequencer
1275  animationSequencer.startAnimating();
1276  } else {
1277  VP1Msg::messageDebug("Aborting tour since no detector parts enabled.");
1278  }
1279  VP1Msg::messageVerbose("takeTourButtonClicked end.");
1280 }
1281 
1282 //____________________________________________________________________
1284 {
1285  grabFocus();
1286 
1287  VP1Msg::messageVerbose("detectorZoomButtonClicked region = "+toString(p.first)+", from "+QString((std::to_string(p.second) +" Z axis").c_str()));
1288 
1289  SoNode * rootnode = theclass->getSceneGraph();
1290  if (!rootnode) {
1291  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::detectorZoomButtonClicked WARNING: No scenegraph set. Ignoring.");
1292  return;
1293  }
1294  if ( ! ( rootnode->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) ) {
1295  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::detectorZoomButtonClicked WARNING: Root node does not derive from SoGroup. Ignoring.");
1296  return;
1297  }
1298  if (theclass->currentCamIsPerspective()) {
1299  //Fix for bad camera (fixme: this doesn't really work... Perhaps let all detector buttons reset camera?):
1300  theclass->toggleCameraType();
1301  theclass->toggleCameraType();
1302  }
1303  SoCamera * camera = theclass->getCamera();
1304  if (!camera) {
1305  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::detectorZoomButtonClicked WARNING: Could not get camera. Ignoring.");
1306  return;
1307  }
1308  rootnode->ref();
1309  camera->ref();
1310 
1311  SoGroup * root = static_cast<SoGroup*>(rootnode);
1312 
1313  //Get region:
1314  SoSphere * regionsphere = getRegionSphere(p.first,
1315  theclass->currentCamIsPerspective());
1316  //Get direction:
1317  int zDir=0;
1318  int xDir=0;
1319  switch (p.second){
1320  case ASIDE:
1321  {
1322  zDir=-1;
1323  rotationMode=ZROT;
1324  theclass->setLeftWheelString("Rotz");
1325  break;
1326  }
1327  case CSIDE:
1328  {
1329  zDir=1;
1330  rotationMode=ZROT;
1331  theclass->setLeftWheelString("Rotz");
1332  break;
1333  }
1334  case BARREL:
1335  {
1336  xDir=1;
1337  rotationMode=XROT;
1338  theclass->setLeftWheelString("Rotx");
1339  }
1340  }
1341  SbVec3f lookat(xDir,0,zDir), upvec(0,1,0);
1342 
1343  bool notifyenabled = root->enableNotify(false);
1344 
1345  root->insertChild(regionsphere,0);
1346  VP1Msg::messageVerbose("detectorZoomButtonClicked Initiating zoom.");
1347  if (theclass->isAnimating())
1348  theclass->stopAnimating();
1349  camera->unrefNoDelete();//Must be done before we start the zoom (to avoid an abort)
1350  // if (resetCamera_state!=QByteArray())
1351  // VP1CameraHelper::animatedZoomToCameraState( camera,root,resetCamera_state,1.0, true );
1352  // else
1353  VP1CameraHelper::animatedZoomToSubTree(camera,root,regionsphere,1.0,100.0,100.0,0.1,lookat,upvec);
1354 
1355  root->removeChild(regionsphere);
1356  if (notifyenabled) {
1357  root->enableNotify(true);
1358  root->touch();
1359  }
1360 
1361  rootnode->unrefNoDelete();
1362 
1363  VP1Msg::messageVerbose("detectorZoomButtonClicked end.");
1364 }
1365 
1366 
1367 
1368 //____________________________________________________________________
1370 {
1371  //We don't actually use this popupmenu.
1372 
1373  // SoQtExaminerViewer::buildPopupMenu();
1374 }
1375 
1376 //____________________________________________________________________
1378 {
1379 
1380  VP1Msg::messageVerbose("VP1ExaminerViewer::removeDecorationMenuOption()");
1381  if (m_d->decorationMenuRemoved || !prefmenu)
1382  return;
1383  m_d->decorationMenuRemoved = true;
1384  int id = prefmenu->getMenuItem("decoration");
1385  if (id!=-1)
1386  prefmenu->removeMenuItem(id);
1387 
1388 }
1389 
1390 //____________________________________________________________________
1391 SbBool VP1ExaminerViewer::processSoEvent(const SoEvent * const evt )
1392 {
1393 // VP1Msg::messageDebug("VP1ExaminerViewer::processSoEvent()");
1394 // std::cout << "event type: " << evt->getClassTypeId().getName() << " - " << evt->getTypeId().getName() << std::endl;
1395 
1396  if (evt->getTypeId().isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
1397  //We want to add a few shortcuts:
1398  // "A": View all
1399  // "P": Perspective camera
1400  // "O": Orthogonal camera
1401  // "C": Toggle camera mode
1402  // "M": Toggle view/selection mode.
1403  // If "Q" then we do NOT pass it on to the base class (because that closes the top window!!)
1404 
1405  m_d->grabFocus(); //probably redundant since we got the event, but can't hurt.
1406 
1407  if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::V)) {
1408  viewAll();
1409  return true;//eat event
1410  }
1411  if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::Q))
1412  return false;//do not eat event, but do not pass through to base.
1413  if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::C)) {
1414  toggleCameraType();
1415  return true;//eat event
1416  }
1417  if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::P)) {
1418  if (!currentCamIsPerspective() )
1419  toggleCameraType();
1420  return true;//eat event
1421  }
1422  if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::O)) {
1424  toggleCameraType();
1425  return true;//eat event
1426  }
1427  if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::M)) {
1428  setViewing(!isViewing());
1429  return true;//eat event
1430  }
1431  if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::A)) {
1433  m_d->grabFocus();//Needed since the GL calls triggered when setting antialiasing makes us loose focus (we obviusly just had it).
1434  return true;//eat event
1435  }
1436 
1437  //NB: We could emit keypressed signal when keyboardevent and base
1438  // class does not eat event.
1439 
1440  } else if (evt->getTypeId().isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
1441  m_d->grabFocus();//Any click grabs focus:
1442  if (isViewing()) {//In viewing mode we open a popup menu on right clicks:
1443  const SoMouseButtonEvent * ev_mouse = static_cast<const SoMouseButtonEvent*>(evt);
1444  if ((ev_mouse->getButton() == SoMouseButtonEvent::BUTTON2/*right click*/)) {
1445  if (ev_mouse->getState() == SoButtonEvent::DOWN) {
1446  showPopupMenu();
1447  }
1448  return true;//eat all right-clicks in viewing mode.
1449  }
1450  }
1451  }
1452 
1453  return SoQtExaminerViewer::processSoEvent(evt);//pass event through
1454 }
1455 
1456 //____________________________________________________________________
1458 {
1459  VP1Msg::messageVerbose("VP1ExaminerViewer::viewAll()");
1460  m_d->grabFocus();
1461  if (currentCamIsPerspective()) {
1462  //Fix for bad camera:
1463  toggleCameraType();
1464  toggleCameraType();
1465  //Fixme: Instead make a reset camera followed by a 0 second "zoom" to correct orientation?
1466  }
1467  SoQtExaminerViewer::viewAll();
1468 
1469 }
1470 
1471 //____________________________________________________________________
1473 {
1474  VP1Msg::messageVerbose("VP1ExaminerViewer::toggleCameraType()");
1475  m_d->grabFocus();
1476  SoQtExaminerViewer::toggleCameraType();
1477 }
1478 
1479 //____________________________________________________________________
1481 {
1482  VP1Msg::messageVerbose("VP1ExaminerViewer::setCameraType()");
1483  m_d->grabFocus();
1484  if (rightWheelLabel)
1485  rightWheelLabel->setUpdatesEnabled(false);
1486  SoQtExaminerViewer::setCameraType(type);
1487  setRightWheelString("Zoom");
1488  if (rightWheelLabel) {
1489  rightWheelLabel->setVisible(true);
1490  rightWheelLabel->setUpdatesEnabled(true);
1491  }
1492 
1493  // get default stereo values and set them as starting point for the stereo editor
1494  if (getCamera()) {
1495  stereo_offset_camera = getCamera()->getStereoAdjustment();
1496  stereo_parallax_camera = getCamera()->getBalanceAdjustment();
1497  stereo_offset_viewer = getStereoOffset();
1498  }
1499 }
1500 
1501 //____________________________________________________________________
1503 {
1504  VP1Msg::messageVerbose("VP1ExaminerViewer::setSeekMode()");
1505  m_d->grabFocus();
1506  SoQtExaminerViewer::setSeekMode(enable);
1507 }
1508 
1509 //____________________________________________________________________
1511 {
1512  VP1Msg::messageVerbose("VP1ExaminerViewer::setViewing()");
1513  m_d->grabFocus();
1514  SoQtExaminerViewer::setViewing(enable);
1515 }
1516 
1517 //____________________________________________________________________
1519 {
1520  VP1Msg::messageVerbose("VP1ExaminerViewer::bottomWheelFinish()");
1521  m_d->grabFocus();
1522  SoQtExaminerViewer::bottomWheelFinish();
1523 }
1524 
1525 //____________________________________________________________________
1527 {
1528  VP1Msg::messageVerbose("VP1ExaminerViewer::bottomWheelMotion()");
1529  m_d->grabFocus();
1530  SoQtExaminerViewer::bottomWheelMotion(val);
1531 }
1532 
1533 //____________________________________________________________________
1535 {
1536  VP1Msg::messageVerbose("VP1ExaminerViewer::bottomWheelStart()");
1537  m_d->grabFocus();
1538  SoQtExaminerViewer::bottomWheelStart();
1539 }
1540 
1541 //____________________________________________________________________
1543 {
1544  m_d->grabFocus();
1545  SoQtExaminerViewer::leftWheelFinish();
1546 }
1547 
1548 //____________________________________________________________________
1550 {
1551  m_d->grabFocus();
1552 
1553  if (isAnimating())
1554  stopAnimating();
1555 
1556  float newval = 0.0;
1557  if (m_d->rotationMode==Imp::XROT)
1558  newval = m_d->rotXWheelMotion(val, getLeftWheelValue());
1559  else
1560  newval = m_d->rotZWheelMotion(val, getLeftWheelValue());
1561 
1562  SoQtFullViewer::leftWheelMotion(newval);//NB: We bypass SoQtExaminerViewer implementation
1563 }
1564 
1565 //____________________________________________________________________
1567 {
1568  m_d->grabFocus();
1569  SoQtExaminerViewer::leftWheelStart();
1570 }
1571 
1572 //____________________________________________________________________
1574 {
1575  m_d->grabFocus();
1576  SoQtExaminerViewer::rightWheelFinish();
1577 }
1578 
1579 //____________________________________________________________________
1581 {
1582  m_d->grabFocus();
1583  SoQtExaminerViewer::rightWheelMotion(val);
1584 }
1585 
1586 //____________________________________________________________________
1588 {
1589  m_d->grabFocus();
1590  SoQtExaminerViewer::rightWheelStart();
1591 }
1592 
1593 //____________________________________________________________________
1595 {
1596  SoCamera * cam = theclass->getCamera();
1597  if (!cam)
1598  return 0.0f; // can happen for empty scenegraph
1599 
1600  cam->ref();
1601  rotateCamera(cam, SbVec3f(0, 0, -1), value - oldvalue);
1602  cam->unrefNoDelete();
1603  return value;
1604 }
1605 
1606 //____________________________________________________________________
1608 {
1609  SoCamera * cam = theclass->getCamera();
1610  if (!cam)
1611  return 0.0f; // can happen for empty scenegraph
1612 
1613  cam->ref();
1614  rotateCamera(cam, SbVec3f(-1, 0, 0), value - oldvalue);
1615  cam->unrefNoDelete();
1616  return value;
1617 }
1618 
1619 //____________________________________________________________________
1621  const SbVec3f & aroundaxis,
1622  const float delta)
1623 {
1624  const SbVec3f DEFAULTDIRECTION(0, 0, -1);
1625  const SbRotation currentorientation = cam->orientation.getValue();
1626 
1627  SbVec3f currentdir;
1628  currentorientation.multVec(DEFAULTDIRECTION, currentdir);
1629 
1630  const SbVec3f focalpoint = cam->position.getValue() +
1631  cam->focalDistance.getValue() * currentdir;
1632 
1633  // set new orientation
1634  cam->orientation = SbRotation(aroundaxis, delta) * currentorientation;
1635 
1636  SbVec3f newdir;
1637  cam->orientation.getValue().multVec(DEFAULTDIRECTION, newdir);
1638  cam->position = focalpoint - cam->focalDistance.getValue() * newdir;
1639 }
1640 
1641 //____________________________________________________________________
1642 void VP1ExaminerViewer::setBufferingType(SoQtViewer::BufferType bt)
1643 {
1644  SoQtExaminerViewer::setBufferingType(bt);
1645 }
1646 
1647 //____________________________________________________________________
1648 void VP1ExaminerViewer::setAntialiasing(SbBool smoothing, int numPasses)
1649 {
1650  VP1Msg::messageDebug("VP1ExaminerViewer::setAntialiasing()");
1651 
1652  SoQtExaminerViewer::setAntialiasing(smoothing, numPasses); // Needed for offscreen rendering (i.e. snapshots).
1653 
1654 
1655  // --- OLD AA method ---
1656  // QGLWidget* qglw = (QGLWidget*)getGLWidget();
1657  // QGLFormat fmt = qglw->format();
1658  // fmt.setSampleBuffers(smoothing);
1659  // fmt.setSamples(numPasses);
1660  // qglw->setFormat(fmt); // note: this is supposedly deprecated..
1661  // qglw->makeCurrent();
1662 
1663  // if(smoothing && numPasses > 1)
1664  // glEnable(GL_MULTISAMPLE);
1665  // else
1666  // glDisable(GL_MULTISAMPLE);
1667 
1668  bool printWarning = false;
1669  const char* env_aa;
1670  #ifndef BUILDVP1LIGHT
1671  env_aa = std::getenv("VP1_ADVANCED_ANTIALIASING");
1672  #else
1673  bool antialiasingIsOn = VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_ADVANCED_ANTIALIASING");
1674  if(antialiasingIsOn){
1675  env_aa = "1";
1676  } else {
1677  env_aa = "0";
1678  }
1679  #endif
1680  if (env_aa != NULL) {
1681  std::string env_aa_string( env_aa );
1682  if(env_aa_string == "1") {
1683 
1684  // print a warning message, on the first time
1685  if ( ! std::getenv("VP1_ADVANCED_ANTIALIASING_PRINTMSG")) {
1686  VP1Msg::messageWarningRed("You switched ON advanced anti-aliasing. That's very good, but please notice that this method DOES NOT WORK on LXPLUS machines, currently, because of their old graphics drivers! If you are on LXPLUS, this will likely freeze VP1... If that's the case, please restart VP1 without the '-advanced-aa' flag.");
1687  }
1688  ::setenv("VP1_ADVANCED_ANTIALIASING_PRINTMSG", "1", 1/*override present value*/); // TODO: move to Qt settings
1689 
1690  // --- NEW AA method (26Sep2017) --- it works, but not on LXPLUS!!
1691  if (smoothing) {
1692  VP1Msg::message("VP1ExaminerViewer: turning AA on.");
1693 
1694  VP1Msg::message("Sep 2017: AA is now done using a new technique so please let hn-atlas-vp1-help@cern.ch know of any problems.");
1695  //FIXME - remove above messages at some point? EJWM.
1696 
1697  if (getGLRenderAction()->isSmoothing() != smoothing)
1698  getGLRenderAction()->setSmoothing(smoothing); // --> quite ugly outcome!
1699 
1700  int buffers = 4;
1701  #if SOQT_MAJOR_VERSION > 1 || (SOQT_MAJOR_VERSION == 1 && SOQT_MINOR_VERSION >= 5)
1702  if (getSampleBuffers() != buffers)
1703  setSampleBuffers(buffers);
1704  #else
1705  if (buffers > 1)
1706  VP1Msg::message("Multisampling is not supported by SoQT < 1.5, this anti-aliasing mode is disabled");
1707  #endif
1708  }
1709  else {
1710  VP1Msg::message("VP1ExaminerViewer: turning AA off.");
1711  getGLRenderAction()->setSmoothing(smoothing);
1712  setSampleBuffers(0);
1713  }
1714  }
1715  else {
1716  printWarning = true;
1717  }
1718  }
1719  else {
1720  printWarning = true;
1721  }
1722 
1723  if (printWarning) {
1724  VP1Msg::messageWarningRed("Anti-aliasing is using low-quality mode only, because of problems with the graphic drivers installed on LXPLUS machines. If you are not running VP1 on LXPLUS machine (for example, if you are running it on a custom SLC6 machine), you can start VP1 again using the command-line flag '-advanced-aa'.");
1725  }
1726 
1727  m_d->isantialias=smoothing;
1728 }
1729 
1730 //____________________________________________________________________
1731 void VP1ExaminerViewer::setTransparencyType(SoGLRenderAction::TransparencyType t)
1732 {
1733  SoQtExaminerViewer::setTransparencyType(t);
1734 }
1735 
1736 //____________________________________________________________________
1737 void VP1ExaminerViewer::setDrawStyle(SoQtViewer::DrawType t, SoQtViewer::DrawStyle s)
1738 {
1739  SoQtExaminerViewer::setDrawStyle(t,s);
1740 }
1741 
1742 //____________________________________________________________________
1744 {
1745  return m_d->isantialias;
1746  // SbBool smoothing; int numPasses;
1747  // getAntialiasing(smoothing, numPasses);
1748  // return smoothing&&numPasses>1;
1749 }
1750 
1751 //____________________________________________________________________
1753 {
1754  m_d->isantialias=b;
1755  b ? setAntialiasing(true,4) : setAntialiasing(false,1);
1756  std::cout << "antiAliasing set." << std::endl;
1757 }
1758 
1759 //____________________________________________________________________
1761 {
1762  VP1Msg::messageVerbose("VP1ExaminerViewer::resetCamera()");
1763  if (m_d->resetCamera_state==QByteArray())
1764  return;
1765  if (isAnimating())
1766  stopAnimating();
1768  toggleCameraType();
1769  if (getCamera()&&m_d->resetCamera_state!=QByteArray())
1770  VP1QtInventorUtils::deserializeSoCameraParameters(m_d->resetCamera_state,*(getCamera()));//Fixme: Check return value?
1771 }
1772 
1773 
1774 //____________________________________________________________________
1776 {
1777  return getCameraType() == SoPerspectiveCamera::getClassTypeId();
1778 }
1779 
1780 //____________________________________________________________________
1782 {
1783  SoCamera * cam(getCamera());
1784  return cam ? VP1QtInventorUtils::serializeSoCameraParameters(*cam) : QByteArray();
1785 }
1786 
1787 //____________________________________________________________________
1788 QPixmap VP1ExaminerViewer::getSnapShotFromCamState(bool camStateIsPerspective, QByteArray camState,
1789  int width, int height, bool transp )
1790 {
1791  SoCamera * cam = getCamera();
1792  if (!cam)
1793  return QPixmap();
1794  bool notifyenabled = cam->enableNotify(false);
1795 
1796  bool currentPersp(currentCamIsPerspective());
1797  QByteArray currentState(currentCameraState());
1798  if (currentPersp!=camStateIsPerspective)
1799  toggleCameraType();
1800  VP1QtInventorUtils::deserializeSoCameraParameters(camState,*(getCamera()));
1801  QPixmap pm = VP1QtInventorUtils::renderToPixmap(this, width, height,transp);
1802  if (currentPersp!=camStateIsPerspective)
1803  toggleCameraType();
1804  VP1QtInventorUtils::deserializeSoCameraParameters(currentState,*(getCamera()));
1805 
1806  if (notifyenabled) {
1807  cam->enableNotify(true);
1808  //We don't touch since we know that we didn't actually change anything: cam->touch();
1809  }
1810  return pm;
1811 }
1812 
1813 //____________________________________________________________________
1815 {
1816  if (m_d->resetCamera_state!=QByteArray())
1817  return;
1818  //Camera type and parameters:
1821 
1823  m_d->popup_resetCameraAction->setVisible(true);
1824 }
1825 
1826 //____________________________________________________________________
1828 {
1829  VP1Msg::messageVerbose("VP1ExaminerViewer::Imp::updateMovieMenuVisuals()");
1830 
1831  ensureMenuInit();
1832  int width = action_moviewidth->data().toInt();
1833  int height = action_movieheight->data().toInt();
1834  int fps = action_moviefps->data().toInt();
1835  QString outdir = action_movieoutdir->data().toString();
1836  action_moviewidth->setText("Change output &width [current: "+QString::number(width)+"]");
1837  action_movieheight->setText("Change output &height [current: "+QString::number(height)+"]");
1838  action_moviefps->setText("Change output &FPS [current: "+QString::number(fps)+"]");
1839  action_movieoutdir->setText("Change output &dir [current: "+outdir+"]");
1840 
1841  bool c(action_movieenabled->isChecked());
1842  action_moviewidth->setEnabled(c);
1843  action_movieheight->setEnabled(c);
1844  action_moviefps->setEnabled(c);
1845  action_movieoutdir->setEnabled(c);
1846 
1847 }
1848 
1849 //____________________________________________________________________
1851 {
1852  if (popup_menu)
1853  return true;
1854  QWidget * w = theclass->getWidget();
1855  if (!w)
1856  return false;
1857  popup_menu = new QMenu (w);
1858 
1859  popup_bgdColAction = popup_menu->addAction("&Background Colour");
1860  popup_antiAliasAction = popup_menu->addAction("&Anti aliasing [A]");
1861  popup_resetCameraAction = popup_menu->addAction("&Reset camera");
1862 
1863  if (detectorViewButtons) {
1864  //Tour - base
1865  QMenu * tourmenu = popup_menu->addMenu("&Tour");
1866  popup_tourStartEachEvent = tourmenu->addAction("Start tour on new event");
1867  popup_tourStartEachEvent->setCheckable(true);
1868  popup_tourReturnToStartAction = tourmenu->addAction("Tour ends at &original view");
1869  popup_tourReturnToStartAction->setCheckable(true);
1870  popup_tourReturnToStartAction->setVisible(false);//Until functionality actually implemented
1871  QMenu * tourspeedmenu = tourmenu->addMenu("&Speed");
1872  QMenu * tourpartsmenu = tourmenu->addMenu("&Parts");
1873  QMenu * tourloopmenu = tourmenu->addMenu("&Looping");
1874  popup_tourExecute = tourmenu->addAction("E&xecute");
1875 
1876  //Tour - speed:
1877  popup_tourSpeedVerySlow = tourspeedmenu->addAction("Very s&low");
1878  popup_tourSpeedSlow = tourspeedmenu->addAction("&Slow");
1879  popup_tourSpeedMedium = tourspeedmenu->addAction("&Medium");
1880  popup_tourSpeedFast = tourspeedmenu->addAction("&Fast");
1881  popup_tourSpeedVeryFast = tourspeedmenu->addAction("Very f&ast");
1882  popup_tourSpeedVerySlow->setCheckable(true);
1883  popup_tourSpeedSlow->setCheckable(true);
1884  popup_tourSpeedMedium->setCheckable(true);
1885  popup_tourSpeedFast->setCheckable(true);
1886  popup_tourSpeedVeryFast->setCheckable(true);
1887  QActionGroup * tour_speed_group = new QActionGroup(tourspeedmenu);
1888  tour_speed_group->addAction(popup_tourSpeedVerySlow);
1889  tour_speed_group->addAction(popup_tourSpeedSlow);
1890  tour_speed_group->addAction(popup_tourSpeedMedium);
1891  tour_speed_group->addAction(popup_tourSpeedFast);
1892  tour_speed_group->addAction(popup_tourSpeedVeryFast);
1893  popup_tourSpeedMedium->setChecked(true);
1894 
1895  //Tour - parts:
1896  popup_tourPartsVertex = tourpartsmenu->addAction("&Vertex region");
1897  popup_tourPartsInDet = tourpartsmenu->addAction("&Inner Detector");
1898  popup_tourPartsCalo = tourpartsmenu->addAction("&Calorimeters");
1899  popup_tourPartsMuon = tourpartsmenu->addAction("&Muon systems");
1900  popup_tourPartsVertex->setCheckable(true);
1901  popup_tourPartsInDet->setCheckable(true);
1902  popup_tourPartsCalo->setCheckable(true);
1903  popup_tourPartsMuon->setCheckable(true);
1904  popup_tourPartsInDet->setChecked(true);
1905  popup_tourPartsMuon->setChecked(true);
1906 
1907  //Tour - Looping:
1908  popup_tourLoopOnce = tourloopmenu->addAction("&Once");
1909  popup_tourLoopTwice = tourloopmenu->addAction("&Twice");
1910  popup_tourLoopThrice = tourloopmenu->addAction("T&hrice");
1911  popup_tourLoopForever = tourloopmenu->addAction("&Indefinitely");
1912  popup_tourLoopOnce->setCheckable(true);
1913  popup_tourLoopTwice->setCheckable(true);
1914  popup_tourLoopThrice->setCheckable(true);
1915  popup_tourLoopForever->setCheckable(true);
1916  QActionGroup * tour_loop_group = new QActionGroup(tourloopmenu);
1917  tour_loop_group->addAction(popup_tourLoopOnce);
1918  tour_loop_group->addAction(popup_tourLoopTwice);
1919  tour_loop_group->addAction(popup_tourLoopThrice);
1920  tour_loop_group->addAction(popup_tourLoopForever);
1921  popup_tourLoopOnce->setChecked(true);
1922 
1923  }
1924 
1925  QMenu * advancedmenu = popup_menu->addMenu("&More");
1926 
1927  popup_hidedecorationsaction = advancedmenu->addAction("Hide &controls");
1928  popup_headLightAction = advancedmenu->addAction("&Headlight");
1929  popup_ambientLightAction = advancedmenu->addAction("dummy");
1930  popup_dumpSceneAction = advancedmenu->addAction("Dump &scene to file");
1931  popup_dumpSceneVRMLAction = advancedmenu->addAction("Dump &scene to VRML file");
1932  popup_toSVGAction = advancedmenu->addAction("Produce SV&G image");
1933  popup_toEPSAction = advancedmenu->addAction("Produce &EPS image");
1934 
1935  if (detectorViewButtons) {
1936  //Custom views:
1937  QMenu * viewsmenu = advancedmenu->addMenu("Stored &views");
1938  viewmenu_zoomtoview = viewsmenu->addMenu("Animated &zoom to view");
1939  viewmenu_restoreview = viewsmenu->addMenu("&Restore view");
1940  viewmenu_storecurrentview = viewsmenu->addMenu("Store &current view");
1941  viewmenu_deleteview = viewsmenu->addMenu("&Delete view");
1942  QObject::connect(viewmenu_storecurrentview,SIGNAL(aboutToShow()),signalcatcher,SLOT(catchSignal()));
1943  QObject::connect(viewmenu_deleteview,SIGNAL(aboutToShow()),signalcatcher,SLOT(catchSignal()));
1944  QObject::connect(viewmenu_restoreview,SIGNAL(aboutToShow()),signalcatcher,SLOT(catchSignal()));
1945  QObject::connect(viewmenu_zoomtoview,SIGNAL(aboutToShow()),signalcatcher,SLOT(catchSignal()));
1946  storedViewsChanged();
1947  }
1948 
1949  if (detectorViewButtons) {
1950  //Custom tour:
1951  QMenu * customtourmenu = advancedmenu->addMenu("Custom &tour");
1952  customtour_launcheditor = customtourmenu->addAction("Launch &editor");
1953  customtour_execute = customtourmenu->addAction("E&xecute");
1954  customtour_execute->setEnabled(false);
1955 
1956  //Movies:
1957  QMenu * moviesmenu = advancedmenu->addMenu("&Movie settings");
1958  action_movieenabled = moviesmenu->addAction("&Enable movie output when executing tours (one image file per frame)");
1959  action_movieenabled->setCheckable(true);
1960  action_movieenabled->setChecked(false);
1961  action_moviewidth = moviesmenu->addAction("dummy");
1962  action_moviewidth->setData(1024);
1963  action_movieheight = moviesmenu->addAction("dummy");
1964  action_movieheight->setData(768);
1965  action_moviefps = moviesmenu->addAction("dummy");
1966  action_moviefps->setData(24);
1967  action_movieoutdir = moviesmenu->addAction("dummy");
1968  QString username=VP1QtUtils::environmentVariableValue("USER");
1969  action_movieoutdir->setData(username.isEmpty() ? "/tmp/vp1frames" : "/tmp/"+username+"/vp1frames");
1970  action_moviefadetocurrentview = moviesmenu->addAction("Fade last frame to current view (1s)");
1971  updateMovieMenuVisuals();
1972  }
1973 
1974 
1975  updateAmbientLightText();
1976  popup_headLightAction->setCheckable(true);
1977  popup_antiAliasAction->setCheckable(true);
1978  popup_hidedecorationsaction->setCheckable(true);
1979 
1980 
1981  //Draw styles sub menu:
1982  QMenu * drawstylemenu = advancedmenu->addMenu("&Draw styles");
1983 
1984  QMenu * drawstyle_still_menu = drawstylemenu->addMenu("&Still draw style");
1985  QMenu * drawstyle_interactive_menu = drawstylemenu->addMenu("&Interactive draw style");
1986  QMenu * drawstyle_transptype_menu = drawstylemenu->addMenu("&Transparency Type");
1987 
1988  //Drawstyles sub menus:
1989  QActionGroup * ds_still_group = new QActionGroup(drawstyle_still_menu);
1990  QActionGroup * ds_interactive_group = new QActionGroup(drawstyle_interactive_menu);
1991  for(SoQtViewer::DrawStyle ds : getAllViewerDrawStyles()) {
1992  int ids = viewerDrawStyleToInt(ds);
1993  QString pretty = viewerDrawStyle2PrettyString(ds);
1994  if (ds!=SoQtViewer::VIEW_SAME_AS_STILL) {
1995  //still menu:
1996  QAction * act = drawstyle_still_menu->addAction(pretty);
1997  act->setData(ids);
1998  popup_drawstyle_still_actions << act;
1999  ds_still_group->addAction(act);
2000  act->setCheckable(true);
2001  }
2002  if (ds!=SoQtViewer::VIEW_AS_IS) {
2003  //interactive menu:
2004  QAction * act = drawstyle_interactive_menu->addAction(pretty);
2005  act->setData(ids);
2006  popup_drawstyle_interactive_actions << act;
2007  ds_interactive_group->addAction(act);
2008  act->setCheckable(true);
2009  }
2010  }
2011 
2012  //Transparency type sub menu:
2013  QActionGroup * transptype_group = new QActionGroup(drawstyle_transptype_menu);
2014  for(SoGLRenderAction::TransparencyType type : VP1QtInventorUtils::getAllTransparencyTypes()) {
2015  QAction * act = drawstyle_transptype_menu->addAction(VP1QtInventorUtils::transparencyType2PrettyString(type));
2017  popup_transptype_actions << act;
2018  transptype_group->addAction(act);
2019  act->setCheckable(true);
2020  }
2021 
2022 
2023  //Stereo view sub menu:
2024  QMenu * stereoviewmenu_main = advancedmenu->addMenu("&Stereographic view");
2025  stereo_launcheditor = stereoviewmenu_main->addAction("Launch &editor");
2026 
2027  // focal length submenu
2028  popup_focal_value_action = advancedmenu->addAction("dummy"); // dummy text replaced here below
2029  SoCamera *camera = theclass->getCamera();
2030  float default_focal_camera = camera->focalDistance.getValue();
2031  popup_focal_value_action->setData(default_focal_camera);
2032  popup_focal_value_action->setText("Change camera FOCAL LENGTH [current: "+QString::number(default_focal_camera)+"]");
2033 
2034  // N.B.!! --> all the actions and menus here below are not needed anymore,
2035  // because we implemented the new stereo editor
2036 
2037 // QMenu * stereoviewmenu = stereoviewmenu_main->addMenu("stereo menu - viewer");
2038 // QMenu * stereoviewmenu_camera = stereoviewmenu_main->addMenu("stereo menu - camera");
2039 
2040 
2041 // // STEREO settings - SoQtViewer version
2042 //
2043 // QMenu * stereo_set_offset_menu = stereoviewmenu->addMenu("Set stereo &Offset");
2044 // popup_stereo_offset_value_action = stereoviewmenu->addAction("dummy"); // dummy text replaced here below
2045 // QMenu * stereo_set_type_menu = stereoviewmenu->addMenu("Set &Stereo type");
2046 // stereo_set_anaglyph_menu = stereoviewmenu->addMenu("Set &Anaglyph settings");
2047 
2048 
2049 // // build the Stereo Offset submenu
2050 // QActionGroup * stereo_set_offset_group = new QActionGroup(stereo_set_offset_menu);
2051 //
2052 // QList<float> offset_values;
2053 // offset_values << 0 << 1000.00 << 5000.00 << 10000.00 << 20000.00;
2054 //
2055 // for(float value : offset_values) {
2056 // QAction * act = stereo_set_offset_menu->addAction(QString::number(value));
2057 // act->setData(QString::number(value));
2058 // popup_stereo_offset_actions << act;
2059 // stereo_set_offset_group->addAction(act);
2060 // act->setCheckable(true);
2061 // }
2062 //
2063 //
2064 //
2065 // // an action to change the let the user change the stereo offset by entering a double
2066 // float default_offset = 0.1;
2067 // popup_stereo_offset_value_action->setData(default_offset);
2068 // popup_stereo_offset_value_action->setText("Change STEREO offset [current: "+QString::number(default_offset)+"]");
2069 //
2070 //
2071 // // build the Stereo Type submenu
2072 // QActionGroup * stereo_set_type_group = new QActionGroup(stereoviewmenu);
2073 //
2074 // QList<SoQtViewer::StereoType> stereo_type_values;
2075 // stereo_type_values << SoQtViewer::STEREO_NONE << SoQtViewer::STEREO_ANAGLYPH;
2076 //
2077 // for(SoQtViewer::StereoType value : getAllStereoViewTypes() ) {
2078 // QAction * act = stereo_set_type_menu->addAction(viewerStereoType2PrettyString(value));
2079 // act->setData( viewerStereoTypeToInt(value) );
2080 // popup_stereo_type_actions << act;
2081 // stereo_set_type_group->addAction(act);
2082 // act->setCheckable(true);
2083 // }
2084 //
2085 //
2086 // // build the Anaglyph settings submenu
2087 // QActionGroup * stereo_set_anaglyph_group = new QActionGroup(stereoviewmenu);
2088 //
2089 // QList<SoQtViewer::StereoType> stereo_type_values;
2090 // stereo_type_values << SoQtViewer::STEREO_NONE << SoQtViewer::STEREO_ANAGLYPH;
2091 //
2092 // QStringList options;
2093 // options << "Standard Red-Cyan view" << "Left-eye only" << "Right-eye only";
2094 //
2095 // for(QString value : options ) {
2096 // QAction * act = stereo_set_anaglyph_menu->addAction(value);
2097 // act->setData( value );
2098 // popup_stereo_anaglyph_actions << act;
2099 // stereo_set_anaglyph_group->addAction(act);
2100 // act->setCheckable(true);
2101 // }
2102 
2103 
2104 
2105 
2106  // STEREO settings - Camera version
2107 
2108 // // offset submenu
2109 // popup_stereo_offset_value_action_camera = stereoviewmenu_camera->addAction("dummy"); // dummy text replaced here below
2110 // // an action to change the let the user change the stereo offset by entering a double
2111 // float default_offset_camera = 0.1;
2112 // popup_stereo_offset_value_action_camera->setData(default_offset_camera);
2113 // popup_stereo_offset_value_action_camera->setText("Change STEREO offset [current: "+QString::number(default_offset_camera)+"]");
2114 //
2115 // // balance submenu
2116 // popup_stereo_balance_value_action_camera = stereoviewmenu_camera->addAction("dummy"); // dummy text replaced here below
2117 // // an action to change the let the user change the stereo offset by entering a double
2118 // float default_balance_camera = 1.0;
2119 // popup_stereo_balance_value_action_camera->setData(default_balance_camera);
2120 // popup_stereo_balance_value_action_camera->setText("Change STEREO balance [current: "+QString::number(default_balance_camera)+"]");
2121 //
2122 
2123 
2124 
2125 // // stereo camera view settings submenu
2126 // stereo_set_stereo_camera_view_menu = stereoviewmenu_camera->addMenu("Set Stereo &Camera view settings");
2127 // QActionGroup * stereo_set_stereo_camera_view_group = new QActionGroup(stereoviewmenu_camera);
2128 //
2129 // QStringList options_camera;
2130 // options_camera << "Standard view" << "Left-eye view" << "Right-eye view";
2131 //
2132 // for(QString value : options_camera ) {
2133 // QAction * act = stereo_set_stereo_camera_view_menu->addAction(value);
2134 // act->setData( value );
2135 // popup_stereo_anaglyph_actions_camera << act;
2136 // stereo_set_stereo_camera_view_group->addAction(act);
2137 // act->setCheckable(true);
2138 // }
2139 
2140 
2141 
2142  return true;
2143 
2144 }
2145 
2146 //____________________________________________________________________
2148 {
2149  VP1Msg::messageVerbose("aboutToShowMenu()");
2150 
2151  if (viewmenu_storecurrentview==menu) {
2152  viewmenu_storecurrentview->clear();
2153  storeViewActions.clear();
2154  QString fs = firstAvailableStoredViewName();
2155  QAction * act = viewmenu_storecurrentview->addAction("Store as "+fs);
2156  act->setData(fs);
2157  storeViewActions << act;
2158  if (!storedViews.isEmpty()) {
2159  viewmenu_storecurrentview->addSeparator();
2160  for(StoredView sv : storedViews) {
2161  act = viewmenu_storecurrentview->addAction("Overwrite "+sv.name());
2162  act->setIcon(sv.icon());
2163  if (!fitsCurrentCamType(sv)) {
2164  act->setEnabled(false);
2165  } else {
2166  act->setData(sv.name());
2167  storeViewActions << act;
2168  }
2169  }
2170  }
2171  return;
2172 
2173  }
2174  if (viewmenu_zoomtoview==menu) {
2175  viewmenu_zoomtoview->clear();
2176  zoomToViewActions.clear();
2177  for(StoredView sv : storedViews) {
2178  QAction * act = viewmenu_zoomtoview->addAction(sv.name());
2179  act->setIcon(sv.icon());
2180  if (!fitsCurrentCamType(sv)) {
2181  act->setEnabled(false);
2182  } else {
2183  act->setData(sv.name());
2184  zoomToViewActions << act;
2185  }
2186  }
2187  return;
2188  }
2189  if (viewmenu_restoreview==menu) {
2190  viewmenu_restoreview->clear();
2191  restoreViewActions.clear();
2192  for(StoredView sv : storedViews) {
2193  QAction * act = viewmenu_restoreview->addAction(sv.name());
2194  act->setIcon(sv.icon());
2195  act->setData(sv.name());
2196  restoreViewActions << act;
2197  }
2198  return;
2199  }
2200  if (viewmenu_deleteview==menu) {
2201  viewmenu_deleteview->clear();
2202  deleteViewActions.clear();
2203  for(StoredView sv : storedViews) {
2204  QAction * act = viewmenu_deleteview->addAction(sv.name());
2205  act->setIcon(sv.icon());
2206  act->setData(sv.name());
2207  deleteViewActions << act;
2208  }
2209  return;
2210  }
2211  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::aboutToShowMenu ERROR: Unknown menu");
2212 }
2213 
2214 //____________________________________________________________________
2216 {
2217  VP1Msg::messageVerbose("updatePopupMenuStates()");
2218 
2219  if (!popup_headLightAction)
2220  return;
2221  popup_headLightAction->setChecked(theclass->isHeadlight());
2222  popup_antiAliasAction->setChecked(theclass->isAntiAlias());
2223  popup_hidedecorationsaction->setChecked(! theclass->isDecoration());
2224 
2225  int idrawstyle_still = viewerDrawStyleToInt(theclass->getDrawStyle(SoQtViewer::STILL));
2226  for (QAction * act : popup_drawstyle_still_actions) {
2227  if (act->data().toInt() == idrawstyle_still) {
2228  act->setChecked(true);
2229  break;
2230  }
2231  }
2232 
2233  int idrawstyle_interactive = viewerDrawStyleToInt(theclass->getDrawStyle(SoQtViewer::INTERACTIVE));
2234  for (QAction * act : popup_drawstyle_interactive_actions) {
2235  if (act->data().toInt() == idrawstyle_interactive) {
2236  act->setChecked(true);
2237  break;
2238  }
2239  }
2240 
2241  int itransptype = VP1QtInventorUtils::transparencyTypeToInt(theclass->getTransparencyType());
2242  for (QAction * act : popup_transptype_actions) {
2243  if (act->data().toInt() == itransptype) {
2244  act->setChecked(true);
2245  break;
2246  }
2247  }
2248 
2249  popup_resetCameraAction->setVisible(resetCamera_state!=QByteArray());
2250 
2251 }
2252 
2253 //____________________________________________________________________
2255 {
2256  VP1Msg::messageVerbose("VP1ExaminerViewer::dumpSceneToFile()");
2257 
2258  SoNode * rootnode = getSceneGraph();
2259  if (!rootnode)
2260  return;
2261 
2262  QWidget * w = getWidget();
2263  if (!w)
2264  return;
2265 
2266  if(filename.isEmpty()) {
2267  if (isAnimating())
2268  stopAnimating();
2269  filename = QFileDialog::getSaveFileName(w, "Select output file",
2271  "Inventor files (*.iv)",0,QFileDialog::DontResolveSymlinks);
2272  if(filename.isEmpty())
2273  return;
2274  if (!filename.endsWith(".iv"))
2275  filename += ".iv";
2277  }
2278 
2279  SoGroup * standardisedRoot(0);
2280  if ( rootnode->getTypeId().isDerivedFrom(SoGroup::getClassTypeId()))
2281  standardisedRoot = VP1HEPVisUtils::convertToStandardScene(static_cast<SoGroup*>(rootnode));
2282 
2283  if (standardisedRoot&&VP1QtInventorUtils::writeGraphToFile(standardisedRoot, filename))
2284  VP1Msg::messageDebug("VP1ExaminerViewer: Dumped scene to file "+filename);
2285  else
2286  VP1Msg::messageDebug("VP1ExaminerViewer: Error: Problems dumping scene to file "+filename);
2287 
2288 }
2289 
2291  VP1Msg::messageVerbose("VP1ExaminerViewer::dumpSceneToVRMLFile()");
2292 
2293  SoNode * rootnode = getSceneGraph();
2294  if (!rootnode)
2295  return;
2296 
2297  QWidget * w = getWidget();
2298  if (!w)
2299  return;
2300 
2301  if(filename.isEmpty()) {
2302  if (isAnimating())
2303  stopAnimating();
2304  filename = QFileDialog::getSaveFileName(w, "Select output file",
2306  "VRML2.0/X3D files (*.wrl)",0,QFileDialog::DontResolveSymlinks);
2307  if(filename.isEmpty())
2308  return;
2309  if (!filename.endsWith(".wrl"))
2310  filename += ".wrl";
2312  }
2313 
2314  SoGroup * standardisedRoot(0);
2315  if ( rootnode->getTypeId().isDerivedFrom(SoGroup::getClassTypeId()))
2316  standardisedRoot = VP1HEPVisUtils::convertToStandardScene(static_cast<SoGroup*>(rootnode));
2317 
2318  if (standardisedRoot&&VP1QtInventorUtils::writeGraphToVRMLFile(standardisedRoot, filename))
2319  VP1Msg::messageDebug("VP1ExaminerViewer: Dumped scene to VRML file "+filename);
2320  else
2321  VP1Msg::messageDebug("VP1ExaminerViewer: Error: Problems dumping scene to VRML file "+filename);
2322 
2323 }
2324 
2325 //____________________________________________________________________
2327 {
2328  QWidget * w = getWidget();
2329  if (!w)
2330  return;
2331  if(filename.isEmpty()) {
2332  if (isAnimating())
2333  stopAnimating();
2334  filename = QFileDialog::getSaveFileName(w, "Select output file",
2336  "Scalable Vector Graphics files (*.svg)",0,QFileDialog::DontResolveSymlinks);
2337  if(filename.isEmpty())
2338  return;
2339  if (!filename.endsWith(".svg"))
2340  filename += ".svg";
2342  }
2343 
2344  VP1Msg::messageVerbose("Attempting to produce svg output: "+filename);
2345 
2346  //The following code contributed by Laurent Duflot:
2347 
2349 
2350  // want to render from above the SceneGraph so we get what the camera sees
2351  SoNode *rootA = static_cast<SoNode*>(SoQtRenderArea::getSceneGraph());
2352  if (!rootA ) return;
2353  SoNode *cam = static_cast<SoNode*>(this->getCamera());
2354  if ( ! cam ) return;
2355  SoSearchAction search;
2356  search.setNode(cam);
2357  search.apply(rootA);
2358  assert(search.getPath());
2359  SoNode* hiddenRoot =
2360  static_cast<SoFullPath *>(search.getPath())->getNodeFromTail(1);
2361 
2362  const SbViewportRegion& vpRegion = getViewportRegion();
2363  SoGL2PSAction* action = new SoGL2PSAction(vpRegion);
2364  action->setFileName(filename.toStdString().c_str());
2365  action->setFileFormat(SoGL2PSAction::SVG);
2366  action->enableFileWriting();
2367  action->apply(hiddenRoot);
2368  action->disableFileWriting();
2369  delete action;
2370 
2371 }
2372 
2373 //____________________________________________________________________
2375 {
2376  QWidget * w = getWidget();
2377  if (!w)
2378  return;
2379  if(filename.isEmpty()) {
2380  if (isAnimating())
2381  stopAnimating();
2382  filename = QFileDialog::getSaveFileName(w, "Select output file",
2384  "Encapsulated Postscript files (*.eps)",0,QFileDialog::DontResolveSymlinks);
2385  if(filename.isEmpty())
2386  return;
2387  if (!filename.endsWith(".eps"))
2388  filename += ".eps";
2390  }
2391 
2392  VP1Msg::messageVerbose("Attempting to produce eps output: "+filename);
2393 
2394  //The following code contributed by Laurent Duflot:
2395 
2396  // first method : direct calls to gl2ps
2397  if (FILE *output = fopen (filename.toStdString().c_str(), "w"))
2398  {
2399  int buffsize = 0, state = GL2PS_OVERFLOW;
2400  while (state == GL2PS_OVERFLOW)
2401  {
2402  buffsize += 1024*1024;
2403  gl2psBeginPage ("VP1"/*fixme: should contain run/evt number*/, "VP1", NULL,
2406  | GL2PS_SILENT
2409  | 0,
2410  GL_RGBA, 0, NULL,0, 0, 0,
2411  buffsize, output, NULL);
2412  actualRedraw();
2413  state = gl2psEndPage();
2414  }
2415  fclose (output);
2416  }
2417 }
2418 
2419 //____________________________________________________________________
2421 {
2422  VP1Msg::messageVerbose("setAmbientLight()");
2423 
2424  a = std::max(0,std::min(100,a));
2426  return;
2430 }
2431 
2432 //____________________________________________________________________
2434 {
2435  return m_d->ambientLightPercentage;
2436 }
2437 
2438 //____________________________________________________________________
2440 {
2441  VP1Msg::messageVerbose("VP1ExaminerViewer: Showing popup menu.");
2442  if (!m_d->ensureMenuInit())
2443  return;
2445 
2446  //Execute
2447  QAction * selAct = m_d->popup_menu->exec(QCursor::pos());
2448 
2449  //Act on selection:
2450  if (!selAct) {
2451  VP1Msg::messageVerbose(" => No selection.");
2452  return;
2453  }
2454  if ( selAct == m_d->popup_bgdColAction ) {
2455  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Change background colour.");
2456  if (isAnimating())
2457  stopAnimating();
2458  QColor oldcol = VP1QtInventorUtils::sbcol2qcol(getBackgroundColor());
2459  QColor col = QColorDialog::getColor(oldcol, getWidget());
2460  if (col!=oldcol)
2461  setBackgroundColor(VP1QtInventorUtils::qcol2sbcol(col));
2462  return;
2463  }
2464  if ( selAct == m_d->popup_ambientLightAction ) {
2465  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu ambient light editor triggered");
2466  bool ok;
2467  // int newamb = QInputDialog::getInteger(getWidget(), "Change ambient light",
2468  int newamb = QInputDialog::getInt(getWidget(), "Change ambient light",
2469  "New ambient light percentage:",
2470  ambientLight(),0,100,1,&ok);
2471  if (ok)
2472  setAmbientLight(newamb);
2473  return;
2474  }
2475  if ( selAct == m_d->popup_headLightAction ) {
2476  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu head light changed to "+VP1Msg::str(m_d->popup_headLightAction->isChecked()));
2477  setHeadlight(m_d->popup_headLightAction->isChecked());
2478  return;
2479  }
2480  if ( selAct == m_d->popup_hidedecorationsaction ) {
2481  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu hide controls changed to "+VP1Msg::str(m_d->popup_hidedecorationsaction->isChecked()));
2482  setDecoration(! m_d->popup_hidedecorationsaction->isChecked());
2483  return;
2484  }
2485  if ( selAct == m_d->popup_antiAliasAction ) {
2486  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu anti aliasing changed to "+VP1Msg::str(m_d->popup_antiAliasAction->isChecked()));
2487  setAntiAlias(m_d->popup_antiAliasAction->isChecked());
2488  m_d->grabFocus();//Needed since the GL calls triggered when setting antialiasing makes us loose focus (we obviusly just had it).
2489  VP1Msg::messageVerbose("Anti-aliasing, done.");
2490  return;
2491  }
2492  if ( selAct == m_d->popup_dumpSceneAction ) {
2493  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Dump scene to an *.iv (OpenInventor) file");
2494  dumpSceneToFile();
2495  return;
2496  }
2497  if ( selAct == m_d->popup_dumpSceneVRMLAction ) {
2498  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Dump scene to a *.wrl (VRML) file");
2500  return;
2501  }
2502 
2503  if ( selAct == m_d->popup_toSVGAction ) {
2504  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Produce SVG image");
2505  produceSVGImage();
2506  return;
2507  }
2508 
2509  if ( selAct == m_d->popup_toEPSAction ) {
2510  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Produce EPS image");
2511  produceEPSImage();
2512  return;
2513  }
2514 
2515  if ( selAct == m_d->popup_resetCameraAction ) {
2516  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Reset camera");
2517  resetCamera();
2518  return;
2519  }
2520  if (m_d->popup_drawstyle_still_actions.contains(selAct)) {
2521  SoQtViewer::DrawStyle ds = Imp::intToViewerDrawStyle(selAct->data().toInt());
2522  if (VP1Msg::verbose())
2523  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu still draw style selected: "
2525  if (ds!=getDrawStyle(STILL))
2526  setDrawStyle(STILL,ds);
2527  return;
2528  }
2529  if (m_d->popup_drawstyle_interactive_actions.contains(selAct)) {
2530  SoQtViewer::DrawStyle ds = Imp::intToViewerDrawStyle(selAct->data().toInt());
2531  if (VP1Msg::verbose())
2532  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu interactive draw style selected: "
2534  if (ds!=getDrawStyle(INTERACTIVE))
2535  setDrawStyle(INTERACTIVE,ds);
2536  return;
2537  }
2538  if (m_d->popup_transptype_actions.contains(selAct)) {
2539  SoGLRenderAction::TransparencyType type = VP1QtInventorUtils::intToTransparencyType(selAct->data().toInt());
2540  if (VP1Msg::verbose())
2541  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu transparency type selected: "
2544  return;
2545  }
2546 
2547  if (m_d->storeViewActions.contains(selAct)) {
2548  QString name = selAct->data().toString();
2549  VP1Msg::messageVerbose("Storing current view as "+name);
2550 
2551  bool camPerspective = currentCamIsPerspective();
2552  QByteArray camState = currentCameraState();
2553  QPixmap snapShot = VP1QtInventorUtils::renderToPixmap(this, 40, 40,false);
2554 
2555  Imp::StoredView sv(camState, camPerspective, snapShot, name);
2556  //Remove old stored views with that name (if any)
2557  int i(0);
2558  bool replaced(false);
2559  for(Imp::StoredView oldsv : m_d->storedViews) {
2560  if (oldsv.name()==name) {
2561  m_d->storedViews.replace(i,sv);
2562  replaced = true;
2563  break;
2564  }
2565  ++i;
2566  }
2567  if (!replaced)
2568  m_d->storedViews << sv;
2570  return;
2571  }
2572 
2573  if (m_d->zoomToViewActions.contains(selAct)) {
2574  QString name = selAct->data().toString();
2575  SoGroup * root = dynamic_cast<SoGroup*>(getSceneGraph());
2576  SoCamera * camera = getCamera();
2577  if (root&&camera) {
2578  for(Imp::StoredView sv : m_d->storedViews) {
2579  if (sv.name()==name) {
2580  if (isAnimating())
2581  stopAnimating();
2582  VP1CameraHelper::animatedZoomToCameraState( camera,root,sv.camState(),1.5, 100.0, 100.0, true );
2583  break;
2584  }
2585  }
2586  } else {
2587  VP1Msg::messageDebug("VP1CameraHelper Error: Attempting to zoom"
2588  " to stored view, but can't get root and camera pointers");
2589  }
2590  return;
2591  }
2592 
2593 
2594 
2595  if (m_d->restoreViewActions.contains(selAct)) {
2596  QString name = selAct->data().toString();
2597  SoGroup * root = dynamic_cast<SoGroup*>(getSceneGraph());
2598  SoCamera * camera = getCamera();
2599  if (root&&camera) {
2600  for(Imp::StoredView sv : m_d->storedViews) {
2601  if (sv.name()==name) {
2602  if (!m_d->fitsCurrentCamType(sv))
2603  toggleCameraType();
2604  if (isAnimating())
2605  stopAnimating();
2606  QByteArray ba = sv.camState();
2608  break;
2609  }
2610  }
2611  } else {
2612  VP1Msg::messageDebug("VP1CameraHelper Error: Attempting to zoom"
2613  " to stored view, but can't get root and camera pointers");
2614  }
2615  return;
2616 
2617  }
2618 
2619  if (m_d->deleteViewActions.contains(selAct)) {
2620  QString name = selAct->data().toString();
2621  int i(0);
2622  for(Imp::StoredView sv : m_d->storedViews) {
2623  if (sv.name()==name) {
2624  m_d->storedViews.removeAt(i);
2625  break;
2626  }
2627  ++i;
2628  }
2630  return;
2631  }
2632 
2633  if (selAct==m_d->customtour_launcheditor) {
2634  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Launch custom tour editor.");
2635  if (!m_d->customtoureditor) {
2637  QObject::connect(&(m_d->animationSequencer),SIGNAL(clipVolumePercentOfATLAS(double)),m_d->customtoureditor,SLOT(setClipVolumePercentOfATLAS(double)));
2640  if (m_d->customtoureditorState!=QByteArray()) {
2642  m_d->customtoureditorState = QByteArray();
2643  }
2644  }
2645  m_d->customtoureditor->show();
2646  //Fixme: deal with minimised state!
2647  return;
2648  }
2649 
2650  if (selAct==m_d->customtour_execute) {
2651  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Execute custom tour.");
2652  startCustomTour();
2653  return;
2654  }
2655 
2656  if (selAct==m_d->action_movieenabled) {
2657  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu movie enabled changed.");
2659  return;
2660  }
2661  if (selAct==m_d->action_moviewidth) {
2662  int old = m_d->action_moviewidth->data().toInt();
2663  bool ok;
2664  // int newwidth = QInputDialog::getInteger(getWidget(), "Change movie width",
2665  int newwidth = QInputDialog::getInt(getWidget(), "Change movie width",
2666  "New movie width:", old,1,4000,1,&ok);
2667  if (ok&&old!=newwidth) {
2668  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu changed movie width to "+VP1Msg::str(newwidth));
2669  m_d->action_moviewidth->setData(newwidth);
2671  }
2672  return;
2673  }
2674  if (selAct==m_d->action_movieheight) {
2675  int old = m_d->action_movieheight->data().toInt();
2676  bool ok;
2677  // int newheight = QInputDialog::getInteger(getWidget(), "Change movie height",
2678  int newheight = QInputDialog::getInt(getWidget(), "Change movie height",
2679  "New movie height:", old,1,4000,1,&ok);
2680  if (ok&&old!=newheight) {
2681  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu changed movie height to "+VP1Msg::str(newheight));
2682  m_d->action_movieheight->setData(newheight);
2684  }
2685  return;
2686  }
2687  if (selAct==m_d->action_moviefps) {
2688  int old = m_d->action_moviefps->data().toInt();
2689  bool ok;
2690  // int newfps = QInputDialog::getInteger(getWidget(), "Change movie FPS",
2691  int newfps = QInputDialog::getInt(getWidget(), "Change movie FPS",
2692  "New movie frames per second:", old,1,4000,1,&ok);
2693  if (ok&&old!=newfps) {
2694  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu changed movie fps to "+VP1Msg::str(newfps));
2695  m_d->action_moviefps->setData(newfps);
2697  }
2698  return;
2699  }
2700  if (selAct==m_d->action_movieoutdir) {
2701  QString old = m_d->action_movieoutdir->data().toString();
2702  QString newoutdir = QFileDialog::getExistingDirectory ( getWidget(), "Select movie frame output directory",old);
2703  if (!newoutdir.isEmpty()&&old!=newoutdir) {
2704  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu changed movie outdir to "+VP1Msg::str(newoutdir));
2705  m_d->action_movieoutdir->setData(newoutdir);
2707  }
2708  return;
2709  }
2710  if (selAct==m_d->action_moviefadetocurrentview) {
2712  return;
2713  }
2714 
2715  if (selAct==m_d->popup_tourReturnToStartAction
2716  ||selAct==m_d->popup_tourStartEachEvent
2717  ||selAct==m_d->popup_tourSpeedVerySlow
2718  ||selAct==m_d->popup_tourSpeedSlow
2719  ||selAct==m_d->popup_tourSpeedMedium
2720  ||selAct==m_d->popup_tourSpeedFast
2721  ||selAct==m_d->popup_tourSpeedVeryFast
2722  ||selAct==m_d->popup_tourPartsVertex
2723  ||selAct==m_d->popup_tourPartsInDet
2724  ||selAct==m_d->popup_tourPartsCalo
2725  ||selAct==m_d->popup_tourPartsMuon
2726  ||selAct==m_d->popup_tourLoopOnce
2727  ||selAct==m_d->popup_tourLoopTwice
2728  ||selAct==m_d->popup_tourLoopThrice
2729  ||selAct==m_d->popup_tourLoopForever) {
2730  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu tour setting changed.");
2731  return;
2732  }
2733  if (selAct==m_d->popup_tourExecute) {
2734  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Tour Execute selected => starting tour.");
2735  startTour();
2736  return;
2737  }
2738 
2739 
2740  // stereo view actions
2741 
2742 
2743  if (selAct==m_d->stereo_launcheditor) {
2744  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu Launch custom STEREO editor.");
2745  if (!m_d->customstereoeditor) {
2747 // m_d->customstereoeditor->disableObjectWhenTourNotAvailable(m_d->customtour_execute);
2748 // if (m_d->customstereoeditorState!=QByteArray()) { //TODO: implement save stereo settings
2749 // m_d->customstereoeditor->setState(m_d->customstereoeditorState);
2750 // m_d->customstereoeditorState = QByteArray();
2751 // }
2752  }
2753  m_d->customstereoeditor->show();
2754  //Fixme: deal with minimised state!
2755  return;
2756  }
2757 
2758 // N.B.!! --> those separate actions below are not needed anymore,
2759 // because we introduced the stereo editor window
2760 
2761 // if (m_d->popup_stereo_offset_actions.contains(selAct)) {
2762 //
2764 // float old = m_d->stereo_offset_value; //->data().toFloat();
2765 //
2766 // // new value
2767 // float offset = selAct->data().toFloat();
2768 //
2769 // int newoffset = offset;
2770 // if (old != newoffset) {
2771 // VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu stereo offset selected: "
2772 // +VP1Msg::str(newoffset));
2773 // m_d->stereo_offset_value = newoffset;
2774 // }
2775 //
2776 // setStereoOffsetSlot(offset);
2777 // return;
2778 // }
2779 //
2780 // if (selAct==m_d->popup_stereo_offset_value_action) {
2781 //
2782 // float old = m_d->popup_stereo_offset_value_action->data().toFloat();
2783 // bool ok;
2784 // int newoffset = QInputDialog::getDouble(getWidget(), "Change stereo OFFSET - 0.1 is the standard offset between left and right eye",
2785 // "New stereo offset: ", old,0.1,4000,1,&ok);
2786 // if (ok && old != newoffset) {
2787 // VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu changed stereo offset to "+VP1Msg::str(newoffset));
2788 // m_d->popup_stereo_offset_value_action->setData(newoffset);
2789 // setStereoOffsetSlot(newoffset);
2790 // m_d->popup_stereo_offset_value_action->setText("Change STEREO offset [current: "+QString::number(newoffset)+"]");
2791 // }
2792 // return;
2793 // }
2794 //
2795  if (selAct==m_d->popup_focal_value_action) {
2796 
2797  // float old = m_d->popup_focal_value_action->data().toFloat();
2798  bool ok;
2799  SoPerspectiveCamera * camera = dynamic_cast<SoPerspectiveCamera*>(getCamera());
2800  if (! (camera==NULL) ) {
2801  float current_value = camera->focalDistance.getValue();
2802  int newfocal = QInputDialog::getDouble(getWidget(),
2803  "Change focal length", // title
2804  "New focal length: ", // label
2805  current_value, // initial value
2806  0.1, // min value
2807  2147483647, // max value
2808  1, // decimals
2809  &ok);
2810  if (ok && current_value != newfocal) {
2811  VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu changed focal length to "+VP1Msg::str(newfocal));
2812  m_d->popup_focal_value_action->setData(newfocal);
2813  // SoCamera *camera = getCamera();
2814  camera->focalDistance.setValue(newfocal);
2815  // camera->heightAngle.setValue(newfocal);
2816  m_d->popup_focal_value_action->setText("Change FOCAL LENGTH value [current: "+QString::number(newfocal)+"]");
2817  }
2818  } else {
2819  VP1Msg::message("Warning! No 'camera'...");
2820  }
2821  return;
2822  }
2823 //
2824 //
2825 // if (m_d->popup_stereo_type_actions.contains(selAct)) {
2826 //
2827 // SoQtViewer::StereoType type = m_d->intToViewerStereoType(selAct->data().toInt());
2828 //
2829 // if (VP1Msg::verbose())
2830 // VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu stereo type selected: "
2831 // +m_d->viewerStereoType2PrettyString(type));
2832 //
2833 // setStereoTypeSlot(type);
2834 //
2835 // // enable the relevant menus
2836 // if (type == SoQtViewer::STEREO_ANAGLYPH) {
2837 // m_d->stereo_set_anaglyph_menu->setEnabled(true);
2838 // } else {
2839 // m_d->stereo_set_anaglyph_menu->setEnabled(false);
2840 // }
2841 //
2842 //
2843 // return;
2844 // }
2845 // if (m_d->popup_stereo_anaglyph_actions.contains(selAct)) {
2846 //
2847 // QString type = selAct->data().toString();
2848 //
2849 // if (VP1Msg::verbose())
2850 // VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu stereo anaglyph selected: "
2851 // +type);
2852 //
2853 // // default values for normal Anaglyph red-cyan view
2854 // SbBool leftFilter[3] = {true, false, false};
2855 // SbBool rightFilter[3] = {false, true, true};
2856 //
2857 // if (type.contains("Left-eye")) {
2858 // SbBool leftFilter[3] = {true, true, true};
2859 // SbBool rightFilter[3] = {false, false, false};
2860 // setAnaglyphStereoColorMasksSlot(leftFilter, rightFilter);
2861 // }
2862 // else if (type.contains("Right-eye")) {
2863 // SbBool leftFilter[3] = {false, false, false};
2864 // SbBool rightFilter[3] = {true, true, true};
2865 // setAnaglyphStereoColorMasksSlot(leftFilter, rightFilter);
2866 // }
2867 // else {
2868 // setAnaglyphStereoColorMasksSlot(leftFilter, rightFilter);
2869 // }
2870 // return;
2871 // }
2872 //
2873 //
2874 // // STEREO - Camera
2875 // if (selAct==m_d->popup_stereo_offset_value_action_camera) {
2876 //
2877 // float old = m_d->popup_stereo_offset_value_action_camera->data().toFloat();
2878 // bool ok;
2879 // float newoffset = QInputDialog::getDouble(getWidget(), "Change stereo OFFSET (Camera) - 0.1 is the standard offset between left and right eye",
2880 // "New stereo offset: ", old,0.1,4000,1,&ok);
2881 // if (ok && old != newoffset) {
2882 // VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu changed CAMERA stereo offset to "+VP1Msg::str(newoffset));
2883 // m_d->popup_stereo_offset_value_action_camera->setData(newoffset);
2884 //
2885 // SoCamera *camera = getCamera();
2886 // camera->setStereoAdjustment(newoffset);
2888 // m_d->popup_stereo_offset_value_action_camera->setText("Change CAMERA STEREO offset [current: "+QString::number(newoffset)+"]");
2889 // }
2890 // return;
2891 // }
2892 // if (selAct==m_d->popup_stereo_balance_value_action_camera) {
2893 //
2894 // float old = m_d->popup_stereo_balance_value_action_camera->data().toFloat();
2895 // bool ok;
2896 // float newoffset = QInputDialog::getDouble(getWidget(), "Change stereo OFFSET (Camera) - 0.1 is the standard offset between left and right eye",
2897 // "New stereo offset: ", old,0.1,4000,1,&ok);
2898 // if (ok && old != newoffset) {
2899 // VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu changed CAMERA stereo offset to "+VP1Msg::str(newoffset));
2900 // m_d->popup_stereo_balance_value_action_camera->setData(newoffset);
2901 //
2902 // SoCamera *camera = getCamera();
2903 // camera->setBalanceAdjustment(newoffset);
2905 // m_d->popup_stereo_balance_value_action_camera->setText("Change CAMERA STEREO balance [current: "+QString::number(newoffset)+"]");
2906 // }
2907 // return;
2908 // }
2909 //
2910 //
2911 // if (m_d->popup_stereo_anaglyph_actions_camera.contains(selAct)) {
2912 //
2913 // QString type = selAct->data().toString();
2914 //
2915 // if (VP1Msg::verbose())
2916 // VP1Msg::messageVerbose("VP1ExaminerViewer::showPopupMenu CAMERA stereo view mode selected: "
2917 // +type);
2918 //
2919 // SoCamera *camera = getCamera();
2920 //
2921 // if (type.contains("Left-eye")) {
2922 // camera->setStereoMode(SoCamera::LEFT_VIEW);
2923 // }
2924 // else if (type.contains("Right-eye")) {
2925 // camera->setStereoMode(SoCamera::RIGHT_VIEW);
2926 // }
2927 // else {
2928 // camera->setStereoMode(SoCamera::MONOSCOPIC);
2929 // }
2930 // return;
2931 // }
2932 
2933 
2934 
2935 
2936  // default
2937  VP1Msg::messageDebug("VP1ExaminerViewer::showPopupMenu ERROR: Unknown selected item!");
2938  return;
2939 
2940 }
2941 
2942 
2943 //____________________________________________________________________
2945 {
2946  VP1Msg::messageVerbose("VP1ExaminerViewer::launchStereoEditor()");
2947 
2948  if (!m_d->customstereoeditor) {
2950  // m_d->customstereoeditor->disableObjectWhenTourNotAvailable(m_d->customtour_execute);
2951  // if (m_d->customstereoeditorState!=QByteArray()) { //TODO: implement save stereo settings
2952  // m_d->customstereoeditor->setState(m_d->customstereoeditorState);
2953  // m_d->customstereoeditorState = QByteArray();
2954  // }
2955  }
2956  m_d->customstereoeditor->show();
2957  //Fixme: deal with minimised state!
2958  return;
2959 }
2960 
2961 
2962 //____________________________________________________________________
2963 QList<SoQtViewer::StereoType> VP1ExaminerViewer::Imp::getAllStereoViewTypes()
2964 {
2965  VP1Msg::messageVerbose("getAllStereoViewTypes()");
2966  QList<SoQtViewer::StereoType> l;
2967 
2968  // for the moment we only use these two
2969  l << SoQtViewer::STEREO_NONE; //Use monoscopic rendering.
2970  l<< SoQtViewer::STEREO_ANAGLYPH; //Render stereo by superimposing two images of the same scene, but with different color filters over the left and right view (or "eye").
2971  //This is a way of rendering stereo which works on any display, using color-filter glasses. Such glasses are usually cheap and easy to come by.
2972  //See also: setAnaglyphStereoColorMasks()
2973 
2974  // test
2975  l << SoQtViewer::STEREO_QUADBUFFER; //Render stereo by using OpenGL quad-buffers. This is the most common interface for stereo rendering for more expensive hardware devices, such as shutter glasses and polarized glasses.
2976  //The well known Crystal Eyes glasses are commonly used with this type of stereo display.
2977  l << SoQtViewer::STEREO_INTERLEAVED_ROWS; //Interleaving / interlacing rows from the left and right eye is another stereo rendering method requiring special hardware. One example of a provider of shutter glasses working with interleaved glasses is VRex:
2978  //http://www.vrex.com/
2979  l << SoQtViewer::STEREO_INTERLEAVED_COLUMNS; //Same basic technique as SoQtViewer::STEREO_INTERLEAVED_ROWS, only it is vertical lines that are interleaved / interlaced, instead of horizontal lines.
2980 
2981  return l;
2982 }
2983 //____________________________________________________________________
2985 {
2986  VP1Msg::messageVerbose("viewerStereoType2PrettyString() - "+QString::number(ds) );
2987  switch (ds) {
2988  case SoQtViewer::STEREO_NONE: return "NO Stereo";
2989  case SoQtViewer::STEREO_ANAGLYPH: return "Anaglyph Stereo (Red-Cyan 3D mode)";
2990  case SoQtViewer::STEREO_QUADBUFFER: return "QUADBUFFER";
2991  case SoQtViewer::STEREO_INTERLEAVED_ROWS: return "INTERLEAVED_ROWS";
2992  case SoQtViewer::STEREO_INTERLEAVED_COLUMNS: return "INTERLEAVED_COLUMNS";
2993  default:
2994  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::viewerStereoType2PrettyString ERROR: Unknown viewer draw style");
2995  return "x";
2996  }
2997 }
2998 //____________________________________________________________________
3000 {
3001  switch (ds) {
3002  case SoQtViewer::STEREO_NONE: return 0;
3003  case SoQtViewer::STEREO_ANAGLYPH: return 1;
3004  case SoQtViewer::STEREO_QUADBUFFER: return 2;
3005  case SoQtViewer::STEREO_INTERLEAVED_ROWS: return 3;
3006  case SoQtViewer::STEREO_INTERLEAVED_COLUMNS: return 4;
3007  default:
3008  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::viewerStereoTypeToInt ERROR: Unknown viewer draw style");
3009  return -1;
3010  }
3011 }
3012 //____________________________________________________________________
3014 {
3015  VP1Msg::messageVerbose("intToViewerStereoType() - "+QString::number(i) );
3016  switch (i) {
3017  case 0: return SoQtViewer::STEREO_NONE;
3018  case 1: return SoQtViewer::STEREO_ANAGLYPH;
3019  case 2: return SoQtViewer::STEREO_QUADBUFFER;
3020  case 3: return SoQtViewer::STEREO_INTERLEAVED_ROWS;
3021  case 4: return SoQtViewer::STEREO_INTERLEAVED_COLUMNS;
3022  default:
3023  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::intToViewerStereoType ERROR: int out of range "+VP1Msg::str(i));
3024  return SoQtViewer::STEREO_NONE;
3025  }
3026 }
3027 
3028 
3029 
3030 
3031 //____________________________________________________________________
3033 {
3034  VP1Msg::messageVerbose("getAllViewerDrawStyles()");
3035 
3036  QList<SoQtViewer::DrawStyle> l;
3037  l << SoQtViewer::VIEW_SAME_AS_STILL
3038  << SoQtViewer::VIEW_AS_IS
3039  << SoQtViewer::VIEW_HIDDEN_LINE
3040  << SoQtViewer::VIEW_NO_TEXTURE
3041  << SoQtViewer::VIEW_LOW_COMPLEXITY
3042  << SoQtViewer::VIEW_LINE
3043  << SoQtViewer::VIEW_POINT
3044  << SoQtViewer::VIEW_BBOX
3045  << SoQtViewer::VIEW_LOW_RES_LINE
3046  << SoQtViewer::VIEW_LOW_RES_POINT
3047  << SoQtViewer::VIEW_WIREFRAME_OVERLAY;
3048  return l;
3049 }
3050 
3051 //____________________________________________________________________
3053 {
3054  switch (ds) {
3055  case SoQtViewer::VIEW_AS_IS: return 0;
3056  case SoQtViewer::VIEW_HIDDEN_LINE: return 1;
3057  case SoQtViewer::VIEW_NO_TEXTURE: return 2;
3058  case SoQtViewer::VIEW_LOW_COMPLEXITY: return 3;
3059  case SoQtViewer::VIEW_LINE: return 4;
3060  case SoQtViewer::VIEW_POINT: return 5;
3061  case SoQtViewer::VIEW_BBOX: return 6;
3062  case SoQtViewer::VIEW_LOW_RES_LINE: return 7;
3063  case SoQtViewer::VIEW_LOW_RES_POINT: return 8;
3064  case SoQtViewer::VIEW_SAME_AS_STILL: return 9;
3065  case SoQtViewer::VIEW_WIREFRAME_OVERLAY: return 10;
3066  default:
3067  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::viewerDrawStyleToInt ERROR: Unknown viewer draw style");
3068  return -1;
3069  }
3070 }
3071 
3072 //____________________________________________________________________
3074 {
3075  switch (i) {
3076  case 0: return SoQtViewer::VIEW_AS_IS;
3077  case 1: return SoQtViewer::VIEW_HIDDEN_LINE;
3078  case 2: return SoQtViewer::VIEW_NO_TEXTURE;
3079  case 3: return SoQtViewer::VIEW_LOW_COMPLEXITY;
3080  case 4: return SoQtViewer::VIEW_LINE;
3081  case 5: return SoQtViewer::VIEW_POINT;
3082  case 6: return SoQtViewer::VIEW_BBOX;
3083  case 7: return SoQtViewer::VIEW_LOW_RES_LINE;
3084  case 8: return SoQtViewer::VIEW_LOW_RES_POINT;
3085  case 9: return SoQtViewer::VIEW_SAME_AS_STILL;
3086  case 10: return SoQtViewer::VIEW_WIREFRAME_OVERLAY;
3087  default:
3088  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::intToViewerDrawStyle ERROR: int out of range "+VP1Msg::str(i));
3089  return SoQtViewer::VIEW_AS_IS;
3090  }
3091 }
3092 
3093 //____________________________________________________________________
3095 {
3096  switch (ds) {
3097  case SoQtViewer::VIEW_AS_IS: return "As is";
3098  case SoQtViewer::VIEW_HIDDEN_LINE: return "Hidden line";
3099  case SoQtViewer::VIEW_NO_TEXTURE: return "No texture";
3100  case SoQtViewer::VIEW_LOW_COMPLEXITY: return "Low complexity";
3101  case SoQtViewer::VIEW_LINE: return "Line";
3102  case SoQtViewer::VIEW_POINT: return "Point";
3103  case SoQtViewer::VIEW_BBOX: return "Bounding boxes";
3104  case SoQtViewer::VIEW_LOW_RES_LINE: return "Low resolution lines";
3105  case SoQtViewer::VIEW_LOW_RES_POINT: return "Low resolution points";
3106  case SoQtViewer::VIEW_SAME_AS_STILL: return "Same as still";
3107  case SoQtViewer::VIEW_WIREFRAME_OVERLAY: return "Wireframe overlay";
3108  default:
3109  VP1Msg::messageDebug("VP1ExaminerViewer::Imp::viewerDrawStyleToInt ERROR: Unknown viewer draw style");
3110  return "";
3111  }
3112 }
3113 
3114 //____________________________________________________________________
3116 {
3117  VP1Msg::messageVerbose("VP1ExaminerViewer::setSceneGraph()");
3118 
3119  if (!m_d->actualSceneGraph) {
3120  m_d->actualSceneGraph = new SoGroup;
3121  m_d->actualSceneGraph->ref();
3122  if (!m_d->environmentNode) {
3123  m_d->environmentNode = new SoEnvironment;
3124  m_d->environmentNode->ref();
3125  }
3127  m_d->actualSceneGraph->addChild(m_d->environmentNode);
3128  SoQtExaminerViewer::setSceneGraph(m_d->actualSceneGraph);
3129  }
3130  while(m_d->actualSceneGraph->getNumChildren()>1)
3131  m_d->actualSceneGraph->removeChild(1);
3132 
3133  if (n)
3134  m_d->actualSceneGraph->addChild(n);
3135 }
3136 
3137 //____________________________________________________________________
3139 {
3140  return (m_d->actualSceneGraph && m_d->actualSceneGraph->getNumChildren()>1) ? m_d->actualSceneGraph->getChild(1) : 0;
3141 }
3142 
3143 //____________________________________________________________________
3145 {
3146  if (!m_d->ensureMenuInit())
3147  return;
3148  QString lastfile, nextfile;
3149  QString outdir = m_d->action_movieoutdir->data().toString();
3152  lastfile, nextfile );
3153 
3154  QImage img0(lastfile);
3155 
3156  if (lastfile.isEmpty()||img0.isNull()) {
3157  VP1Msg::messageDebug("VP1ExaminerViewer ERROR: No previous image found!");
3158  return;
3159  }
3160  if (nextfile.isEmpty())
3161  return;
3162 
3163  QImage img1 = VP1QtInventorUtils::renderToImage(this, img0.width(),img0.height(),false/*transp*/);
3164  if (img1.isNull())
3165  return;
3166 
3167  int nTransitionFrames = std::max(1,static_cast<int>(m_d->action_moviefps->data().toInt()*time_seconds+0.5));
3168  VP1Msg::messageDebug("VP1ExaminerViewer Creating "+VP1Msg::str(nTransitionFrames)+" transition frames");
3169 
3170  for (int i = 0; i < nTransitionFrames; ++i) {
3171  double fadefact((i+1.0)/(nTransitionFrames+1.0));//Should not be 0.0 or 1.0
3172  QString dummy, filename;
3174  QImage img = VP1QtUtils::fadeImage(img0, img1, fadefact );
3175  if (img.isNull()) {
3176  VP1Msg::messageDebug("VP1ExaminerViewer ERROR: Problems creating image!");
3177  } else {
3178  if (!img.save(filename))
3179  VP1Msg::messageDebug("VP1ExaminerViewer ERROR: Could not save image file "+filename);
3180  }
3181  }
3182 
3183  QString dummy, filename;
3185  if (!img1.save(filename))
3186  VP1Msg::messageDebug("VP1ExaminerViewer ERROR: Could not save image file "+filename);
3187 
3188 }
VP1ExaminerViewer::Imp::detectorbuttons
std::map< QPushButton *, std::pair< REGION, VIEW > > detectorbuttons
Definition: VP1ExaminerViewer.cxx:190
VP1ExaminerViewer::Imp::tourLoopsForever
bool tourLoopsForever
Definition: VP1ExaminerViewer.cxx:283
VP1ExaminerViewer::Imp::viewerStereoTypeToInt
static int viewerStereoTypeToInt(SoQtViewer::StereoType)
Definition: VP1ExaminerViewer.cxx:2999
beamspotman.r
def r
Definition: beamspotman.py:676
gl2ps.h
SoGL2PSAction::SVG
@ SVG
Definition: SoGL2PSAction.h:35
VP1ExaminerViewer::Imp::popup_tourSpeedMedium
QAction * popup_tourSpeedMedium
Definition: VP1ExaminerViewer.cxx:235
VP1ExaminerViewer::Imp::StoredView::m_name
QString m_name
Definition: VP1ExaminerViewer.cxx:349
VP1ExaminerViewer::Imp::action_movieoutdir
QAction * action_movieoutdir
Definition: VP1ExaminerViewer.cxx:257
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
VP1ExaminerViewer::setViewing
virtual void setViewing(SbBool enable)
Definition: VP1ExaminerViewer.cxx:1510
LVL1TGC::CSIDE
@ CSIDE
Definition: TGCNumbering.h:15
VP1ExaminerViewer::getStereoTypeSlot
SoQtViewer::StereoType getStereoTypeSlot(void) const
Definition: VP1ExaminerViewer.cxx:584
VP1ExaminerViewer::Imp::popup_toEPSAction
QAction * popup_toEPSAction
Definition: VP1ExaminerViewer.cxx:224
VP1CustomTourEditor::setState
void setState(QByteArray)
Definition: VP1CustomTourEditor.cxx:75
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:257
VP1ExaminerViewer::Imp::FORWARDREGION
@ FORWARDREGION
Definition: VP1ExaminerViewer.cxx:175
VP1ExaminerViewer::Imp::popup_ambientLightAction
QAction * popup_ambientLightAction
Definition: VP1ExaminerViewer.cxx:219
VP1ExaminerViewer::bottomWheelStart
virtual void bottomWheelStart()
Definition: VP1ExaminerViewer.cxx:1534
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
VP1ExaminerViewer::Imp::button_sethome
QPushButton * button_sethome
Definition: VP1ExaminerViewer.cxx:292
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
dq_defect_compare_tags.pretty
def pretty(defects)
Definition: dq_defect_compare_tags.py:57
VP1QtInventorUtils::deserializeSoCameraParameters
static bool deserializeSoCameraParameters(QByteArray &, SoCamera &)
Definition: VP1QtInventorUtils.cxx:959
VP1ExaminerViewer::Imp::sphere
SoSphere * sphere
Definition: VP1ExaminerViewer.cxx:296
rename_histos_in_files_from_old_code.currentdir
currentdir
Definition: rename_histos_in_files_from_old_code.py:289
VP1ExaminerViewer::stereo_offset_viewer
float stereo_offset_viewer
Definition: VP1ExaminerViewer.h:93
VP1CameraHelper::getLastAndNextFrameFileNames
static void getLastAndNextFrameFileNames(QString outputdir, QString prefix, QString &lastOfExistingFiles, QString &nextAvailableFile)
Definition: VP1CameraHelper.cxx:793
VP1ExaminerViewer::removeDecorationMenuOption
virtual void removeDecorationMenuOption()
Definition: VP1ExaminerViewer.cxx:1377
VP1ExaminerViewer::rightWheelStart
virtual void rightWheelStart()
Definition: VP1ExaminerViewer.cxx:1587
VP1ExaminerViewer::Imp::takeTourButtonClicked
void takeTourButtonClicked()
Definition: VP1ExaminerViewer.cxx:1267
tail
std::string tail(std::string s, const std::string &pattern)
tail of a string
Definition: computils.cxx:300
VP1ExaminerViewer::Imp::detectorViewButtons
bool detectorViewButtons
Definition: VP1ExaminerViewer.cxx:281
VP1ExaminerViewer::Imp::updatePopupMenuStates
void updatePopupMenuStates()
Definition: VP1ExaminerViewer.cxx:2215
VP1ExaminerViewer::Imp::customtour_execute
QAction * customtour_execute
Definition: VP1ExaminerViewer.cxx:251
VP1QtInventorUtils::renderToImage
static QImage renderToImage(VP1ExaminerViewer *ra, int pixels_x, int pixels_y, bool transparent_background=false, double actualRenderedSizeFact=1.0)
Definition: VP1QtInventorUtils.cxx:436
AnimationSequence::INDET
@ INDET
Definition: AnimationSequence.h:26
VP1ExaminerViewer::Imp::lastSVGFile
QString lastSVGFile
Definition: VP1ExaminerViewer.cxx:322
VP1ExaminerViewer::Imp::popup_tourSpeedVerySlow
QAction * popup_tourSpeedVerySlow
Definition: VP1ExaminerViewer.cxx:233
VP1Msg.h
VP1ExaminerViewer::Imp::decorationMenuRemoved
bool decorationMenuRemoved
Definition: VP1ExaminerViewer.cxx:299
VP1ExaminerViewer::Imp::viewmenu_restoreview
QMenu * viewmenu_restoreview
Definition: VP1ExaminerViewer.cxx:248
VP1ExaminerViewer::toggleCameraType
virtual void toggleCameraType()
Definition: VP1ExaminerViewer.cxx:1472
VP1CameraHelper.h
VP1ExaminerViewer::setCameraType
virtual void setCameraType(SoType type)
Definition: VP1ExaminerViewer.cxx:1480
VP1ExaminerViewer::Imp::popup_antiAliasAction
QAction * popup_antiAliasAction
Definition: VP1ExaminerViewer.cxx:217
VP1ExaminerViewer::Imp::restoreViewActions
QList< QAction * > restoreViewActions
Definition: VP1ExaminerViewer.cxx:365
DMTest::C
C_v1 C
Definition: C.h:26
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
VP1ExaminerViewer::Imp::detectorZoomButtonClicked
void detectorZoomButtonClicked(std::pair< REGION, VIEW >)
Definition: VP1ExaminerViewer.cxx:1283
VP1ExaminerViewer::Imp::rotZWheelMotion
float rotZWheelMotion(float value, float oldvalue)
Definition: VP1ExaminerViewer.cxx:1594
VP1ExaminerViewer::VP1ExaminerViewer
VP1ExaminerViewer(QWidget *parent=0, bool detectorViewButtons=true, const char *name=0, SbBool embed=TRUE, SoQtFullViewer::BuildFlag flag=BUILD_ALL, SoQtViewer::Type type=BROWSER)
Definition: VP1ExaminerViewer.cxx:526
VP1ExaminerViewer::setSceneGraph
virtual void setSceneGraph(SoNode *)
Definition: VP1ExaminerViewer.cxx:3115
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
VP1ExaminerViewer::Imp::resetCamera_isPerspective
bool resetCamera_isPerspective
Definition: VP1ExaminerViewer.cxx:324
VP1ExaminerViewer::getAnaglyphStereoColorMasksSlot
void getAnaglyphStereoColorMasksSlot(SbBool left[3], SbBool right[3])
Definition: VP1ExaminerViewer.cxx:590
VP1QtUtils.h
AnimationSequencer::startAnimating
void startAnimating(bool skipFirstFrame=false)
Definition: AnimationSequencer.cxx:83
SoGL2PSAction.h
VP1ExaminerViewer::Imp::customtour_launcheditor
QAction * customtour_launcheditor
Definition: VP1ExaminerViewer.cxx:250
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
VP1ExaminerViewer::Imp::popup_transptype_actions
QList< QAction * > popup_transptype_actions
Definition: VP1ExaminerViewer.cxx:227
M_PI
#define M_PI
Definition: ActiveFraction.h:11
VP1ExaminerViewer::currentCamIsPerspective
bool currentCamIsPerspective() const
Definition: VP1ExaminerViewer.cxx:1775
VP1ExaminerViewer::setAntialiasing
virtual void setAntialiasing(SbBool smoothing, int numPasses)
Definition: VP1ExaminerViewer.cxx:1648
debugCameraClipPlanes
void debugCameraClipPlanes(void *data, const SbVec2f &nearfar)
tune the camera clipping planes
Definition: VP1ExaminerViewer.cxx:468
VP1ExaminerViewer::Imp::rotXWheelMotion
float rotXWheelMotion(float value, float oldvalue)
Definition: VP1ExaminerViewer.cxx:1607
VP1ExaminerViewer::Imp::ambientLightPercentage
int ambientLightPercentage
Definition: VP1ExaminerViewer.cxx:312
VP1ExaminerViewer::Imp::signalcatcher
VP1ExaminerViewer_SignalCatcher * signalcatcher
Definition: VP1ExaminerViewer.cxx:287
VP1ExaminerViewer::Imp::ROTATIONMODE
ROTATIONMODE
Definition: VP1ExaminerViewer.cxx:193
athena.value
value
Definition: athena.py:122
VP1ExaminerViewer::~VP1ExaminerViewer
virtual ~VP1ExaminerViewer()
Definition: VP1ExaminerViewer.cxx:920
VP1ExaminerViewer::Imp::popup_resetCameraAction
QAction * popup_resetCameraAction
Definition: VP1ExaminerViewer.cxx:225
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
VP1ExaminerViewer::Imp::rotationMode
ROTATIONMODE rotationMode
Which mode is left wheel in?
Definition: VP1ExaminerViewer.cxx:194
VP1ExaminerViewer::rightWheelFinish
virtual void rightWheelFinish()
Definition: VP1ExaminerViewer.cxx:1573
ALL
@ ALL
Definition: sTGCenumeration.h:14
GL2PS_EPS
#define GL2PS_EPS
Definition: gl2ps.h:95
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
sendEI_SPB.root
root
Definition: sendEI_SPB.py:34
VP1ExaminerViewer::Imp::viewmenu_storecurrentview
QMenu * viewmenu_storecurrentview
Definition: VP1ExaminerViewer.cxx:246
VP1ExaminerViewer::produceEPSImage
void produceEPSImage(QString filename="")
Definition: VP1ExaminerViewer.cxx:2374
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
VP1ExaminerViewer::Imp::popup_focalLengthAction
QAction * popup_focalLengthAction
Definition: VP1ExaminerViewer.cxx:220
VP1ExaminerViewer::Imp::movieFrameFileNamePrefix
QString movieFrameFileNamePrefix
Definition: VP1ExaminerViewer.cxx:315
VP1ExaminerViewer::Imp::action_moviewidth
QAction * action_moviewidth
Definition: VP1ExaminerViewer.cxx:254
VP1ExaminerViewer::setSeekMode
virtual void setSeekMode(SbBool enable)
Definition: VP1ExaminerViewer.cxx:1502
VP1ExaminerViewer::Imp::popup_focal_value_action
QAction * popup_focal_value_action
Definition: VP1ExaminerViewer.cxx:261
VP1ExaminerViewer::setTransparencyType
virtual void setTransparencyType(SoGLRenderAction::TransparencyType)
Definition: VP1ExaminerViewer.cxx:1731
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
AnimationSequence::MUON
@ MUON
Definition: AnimationSequence.h:26
VP1HEPVisUtils.h
search
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Definition: hcg.cxx:738
GL2PS_DRAW_BACKGROUND
#define GL2PS_DRAW_BACKGROUND
Definition: gl2ps.h:120
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
VP1CustomTourEditor::tourAvailable
bool tourAvailable() const
Definition: VP1CustomTourEditor.cxx:398
VP1ExaminerViewer::Imp::popup_tourReturnToStartAction
QAction * popup_tourReturnToStartAction
Definition: VP1ExaminerViewer.cxx:230
VP1ExaminerViewer::Imp::button_viewall
QPushButton * button_viewall
Definition: VP1ExaminerViewer.cxx:293
VP1ExaminerViewer::viewAll
virtual void viewAll()
Definition: VP1ExaminerViewer.cxx:1457
VP1ExaminerViewer::Imp::StoredView::m_snapShot
QPixmap m_snapShot
Definition: VP1ExaminerViewer.cxx:348
VP1ExaminerViewer::Imp::CSIDE
@ CSIDE
Definition: VP1ExaminerViewer.cxx:189
VP1QtUtils::environmentVariableValue
static QString environmentVariableValue(const QString &name)
Definition: VP1QtUtils.cxx:117
VP1ExaminerViewer::produceSVGImage
void produceSVGImage(QString filename="")
Definition: VP1ExaminerViewer.cxx:2326
VP1ExaminerViewer::dumpSceneToFile
void dumpSceneToFile(QString filename="")
Definition: VP1ExaminerViewer.cxx:2254
VP1ExaminerViewer_SignalCatcher::m_d
VP1ExaminerViewer::Imp * m_d
Definition: VP1ExaminerViewer.h:140
VP1QtInventorUtils.h
dqt_zlumi_alleff_HIST.A
A
Definition: dqt_zlumi_alleff_HIST.py:110
VP1ExaminerViewer::Imp::takeTourButton
QPushButton * takeTourButton
Definition: VP1ExaminerViewer.cxx:191
VP1ExaminerViewer::Imp::StoredView::persistifiedState
QByteArray persistifiedState() const
Definition: VP1ExaminerViewer.cxx:406
VP1ExaminerViewer::ambientLight
int ambientLight() const
Definition: VP1ExaminerViewer.cxx:2433
plotting.efficiency.outdir
outdir
Definition: efficiency.py:19
VP1ExaminerViewer::Imp::StoredView::name
QString name() const
Definition: VP1ExaminerViewer.cxx:332
VP1ExaminerViewer::Imp::lastDumpFile
QString lastDumpFile
Definition: VP1ExaminerViewer.cxx:321
AnimationSequencer.h
VP1CustomTourEditor.h
VP1ExaminerViewer::Imp::popup_tourLoopTwice
QAction * popup_tourLoopTwice
Definition: VP1ExaminerViewer.cxx:243
VP1ExaminerViewer::Imp::theclass
VP1ExaminerViewer * theclass
Definition: VP1ExaminerViewer.cxx:187
VP1ExaminerViewer::Imp::StoredView::m_camState
QByteArray m_camState
Definition: VP1ExaminerViewer.cxx:346
Type
RootType Type
Definition: TrigTSerializer.h:30
VP1ExaminerViewer_SignalCatcher
Definition: VP1ExaminerViewer.h:135
VP1Settings.h
menu
make the sidebar many part of the config
Definition: hcg.cxx:551
getColor
unsigned long getColor(unsigned int r, unsigned int g, unsigned int b)
VP1ExaminerViewer::Imp::drawStyleToInt
static int drawStyleToInt(SoQtViewer::DrawStyle)
Definition: VP1ExaminerViewer.cxx:598
VP1QtInventorUtils::transparencyType2PrettyString
static QString transparencyType2PrettyString(SoGLRenderAction::TransparencyType)
Definition: VP1QtInventorUtils.cxx:705
VP1ExaminerViewer::createViewerButtons
virtual void createViewerButtons(QWidget *parent, SbPList *buttonlist)
Definition: VP1ExaminerViewer.cxx:931
VP1QtInventorUtils::getAllTransparencyTypes
static QList< SoGLRenderAction::TransparencyType > getAllTransparencyTypes()
Definition: VP1QtInventorUtils.cxx:645
VP1ExaminerViewer::leftWheelStart
virtual void leftWheelStart()
Definition: VP1ExaminerViewer.cxx:1566
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
VP1ExaminerViewer.h
VP1ExaminerViewer::Imp::toString
QString toString(const REGION &r)
Definition: VP1ExaminerViewer.cxx:176
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
VP1ExaminerViewer::Imp::viewerDrawStyleToInt
static int viewerDrawStyleToInt(SoQtViewer::DrawStyle)
Definition: VP1ExaminerViewer.cxx:3052
VP1ExaminerViewer::setBufferingType
virtual void setBufferingType(SoQtViewer::BufferType)
Definition: VP1ExaminerViewer.cxx:1642
VP1Settings::defaultFileSelectDirectory
static QString defaultFileSelectDirectory()
Definition: VP1Settings.cxx:22
VP1ExaminerViewer::Imp::fitsCurrentCamType
bool fitsCurrentCamType(const StoredView &sv)
Definition: VP1ExaminerViewer.cxx:353
VP1ExaminerViewer::Imp::zoomToViewActions
QList< QAction * > zoomToViewActions
Definition: VP1ExaminerViewer.cxx:367
VP1ExaminerViewer::Imp::popup_tourPartsMuon
QAction * popup_tourPartsMuon
Definition: VP1ExaminerViewer.cxx:241
VP1ExaminerViewer::getSnapShotFromCamState
QPixmap getSnapShotFromCamState(bool camStateIsPerspective, QByteArray camState, int width, int height, bool transp=false)
Definition: VP1ExaminerViewer.cxx:1788
VP1ExaminerViewer::Imp::~Imp
~Imp()
Definition: VP1ExaminerViewer.cxx:156
VP1CustomTourEditor::state
QByteArray state() const
Definition: VP1CustomTourEditor.cxx:58
VP1ExaminerViewer::getSceneGraph
virtual SoNode * getSceneGraph()
Definition: VP1ExaminerViewer.cxx:3138
lumiFormat.i
int i
Definition: lumiFormat.py:92
VP1ExaminerViewer::Imp::popup_tourPartsInDet
QAction * popup_tourPartsInDet
Definition: VP1ExaminerViewer.cxx:239
VP1ExaminerViewer::Imp::getAllViewerDrawStyles
static QList< SoQtViewer::DrawStyle > getAllViewerDrawStyles()
Definition: VP1ExaminerViewer.cxx:3032
beamspotman.n
n
Definition: beamspotman.py:731
VP1ExaminerViewer::dumpSceneToVRMLFile
void dumpSceneToVRMLFile(QString filename="")
Definition: VP1ExaminerViewer.cxx:2290
VP1ExaminerViewer::Imp::lastEPSFile
QString lastEPSFile
Definition: VP1ExaminerViewer.cxx:323
VP1ExaminerViewer::leftWheelMotion
virtual void leftWheelMotion(float val)
Definition: VP1ExaminerViewer.cxx:1549
VP1ExaminerViewer::Imp::resetCamera_state
QByteArray resetCamera_state
Definition: VP1ExaminerViewer.cxx:325
VP1ExaminerViewer::stereo_parallax_camera
float stereo_parallax_camera
Definition: VP1ExaminerViewer.h:92
VP1ExaminerViewer::Imp::popup_drawstyle_interactive_actions
QList< QAction * > popup_drawstyle_interactive_actions
Definition: VP1ExaminerViewer.cxx:229
GL2PS_OVERFLOW
#define GL2PS_OVERFLOW
Definition: gl2ps.h:114
VP1ExaminerViewer::Imp::getAllStereoViewTypes
static QList< SoQtViewer::StereoType > getAllStereoViewTypes()
Definition: VP1ExaminerViewer.cxx:2963
GL2PS_SILENT
#define GL2PS_SILENT
Definition: gl2ps.h:122
master.flag
bool flag
Definition: master.py:29
VP1ExaminerViewer::Imp::rotateCamera
void rotateCamera(SoCamera *cam, const SbVec3f &aroundaxis, const float delta)
Definition: VP1ExaminerViewer.cxx:1620
VP1ExaminerViewer::startTour
void startTour()
Definition: VP1ExaminerViewer.cxx:1164
VP1ExaminerViewer::rightWheelMotion
virtual void rightWheelMotion(float val)
Definition: VP1ExaminerViewer.cxx:1580
VP1CustomTourEditor
Definition: VP1CustomTourEditor.h:26
VP1ExaminerViewer::Imp::popup_tourExecute
QAction * popup_tourExecute
Definition: VP1ExaminerViewer.cxx:231
VP1ExaminerViewer::restoreFromState
virtual void restoreFromState(QByteArray)
Definition: VP1ExaminerViewer.cxx:764
VP1ExaminerViewer::currentCameraState
QByteArray currentCameraState() const
Definition: VP1ExaminerViewer.cxx:1781
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MUON
xAOD::Muon MUON
D3PD INCLUDES.
Definition: TileCellFillerTool.h:37
VP1ExaminerViewer::buildPopupMenu
virtual void buildPopupMenu()
Definition: VP1ExaminerViewer.cxx:1369
VP1ExaminerViewer::Imp::StoredView::camStateIsPerspective
bool camStateIsPerspective() const
Definition: VP1ExaminerViewer.cxx:334
VP1ExaminerViewer::Imp::StoredView::StoredView
StoredView(QByteArray camState, bool camPerspective, QPixmap snapShot, QString name)
Definition: VP1ExaminerViewer.cxx:329
VP1ExaminerViewer::Imp::stereo_offset_value
float stereo_offset_value
Definition: VP1ExaminerViewer.cxx:260
VP1ExaminerViewer::Imp::action_movieenabled
QAction * action_movieenabled
Definition: VP1ExaminerViewer.cxx:253
python.xAODType.dummy
dummy
Definition: xAODType.py:4
VP1QtInventorUtils::qcol2sbcol
static SbColor qcol2sbcol(const QColor &)
Definition: VP1QtInventorUtils.cxx:1134
AnimationSequencer
Definition: AnimationSequencer.h:19
python.Constants.TRUE
bool TRUE
for job options legacy (TODO: get rid of these!) ----------------------—
Definition: Control/AthenaCommon/python/Constants.py:22
VP1ExaminerViewer::Imp::button_togglecamera
QPushButton * button_togglecamera
Definition: VP1ExaminerViewer.cxx:295
VP1ExaminerViewer::setAnaglyphStereoColorMasksSlot
void setAnaglyphStereoColorMasksSlot(const SbBool left[3], const SbBool right[3])
Definition: VP1ExaminerViewer.cxx:587
VP1QtUtils::expertSettingIsOn
static bool expertSettingIsOn(const QString &type, const QString &name)
Definition: VP1QtUtils.cxx:60
getCastorRun.setenv
def setenv()
Definition: getCastorRun.py:9
AnimationSequencer::sequence
AnimationSequence & sequence()
Definition: AnimationSequencer.cxx:75
VP1CustomTourEditor::tourIsPerspective
bool tourIsPerspective() const
Definition: VP1CustomTourEditor.cxx:409
VP1ExaminerViewer::Imp::popup_bgdColAction
QAction * popup_bgdColAction
Definition: VP1ExaminerViewer.cxx:218
VP1ExaminerViewer::Imp::popup_tourSpeedVeryFast
QAction * popup_tourSpeedVeryFast
Definition: VP1ExaminerViewer.cxx:237
VP1ExaminerViewer::Imp::viewmenu_deleteview
QMenu * viewmenu_deleteview
Definition: VP1ExaminerViewer.cxx:247
VP1ExaminerViewer::launchStereoEditor
void launchStereoEditor()
Definition: VP1ExaminerViewer.cxx:2944
VP1ExaminerViewer::Imp::stereo_launcheditor
QAction * stereo_launcheditor
Definition: VP1ExaminerViewer.cxx:252
VP1ExaminerViewer::Imp::updateEnvironmentNode
void updateEnvironmentNode()
Definition: VP1ExaminerViewer.cxx:273
egammaPIDObs::CALO
const unsigned int CALO
all cuts in calorimeter (including isolation)
Definition: egammaPIDdefsObs.h:919
VP1ExaminerViewer::Imp::ensureMenuInit
bool ensureMenuInit()
Definition: VP1ExaminerViewer.cxx:1850
VP1ExaminerViewer::Imp::StoredView::camState
QByteArray camState() const
Definition: VP1ExaminerViewer.cxx:333
VP1ExaminerViewer::Imp::init
void init()
Definition: VP1ExaminerViewer.cxx:1088
VP1ExaminerViewer::Imp::storedViews
QList< StoredView > storedViews
Definition: VP1ExaminerViewer.cxx:355
VP1ExaminerViewer::Imp::updateMovieMenuVisuals
void updateMovieMenuVisuals()
Definition: VP1ExaminerViewer.cxx:1827
VP1ExaminerViewer::Imp::VERTEX
@ VERTEX
Definition: VP1ExaminerViewer.cxx:175
VP1ExaminerViewer::Imp::aboutToShowMenu
void aboutToShowMenu(QMenu *)
Definition: VP1ExaminerViewer.cxx:2147
VP1ExaminerViewer::Imp::Imp
Imp(VP1ExaminerViewer *tc, bool dvb)
Definition: VP1ExaminerViewer.cxx:74
VP1ExaminerViewer::Imp::viewerDrawStyle2PrettyString
static QString viewerDrawStyle2PrettyString(SoQtViewer::DrawStyle)
Definition: VP1ExaminerViewer.cxx:3094
VP1ExaminerViewer::resetCamera
void resetCamera()
Definition: VP1ExaminerViewer.cxx:1760
min
#define min(a, b)
Definition: cfImp.cxx:40
VP1ExaminerViewer::Imp::StoredView
Definition: VP1ExaminerViewer.cxx:327
merge.output
output
Definition: merge.py:17
VP1ExaminerViewer::Imp::popup_headLightAction
QAction * popup_headLightAction
Definition: VP1ExaminerViewer.cxx:216
GL2PS_BEST_ROOT
#define GL2PS_BEST_ROOT
Definition: gl2ps.h:123
VP1ExaminerViewer::setDrawStyle
virtual void setDrawStyle(SoQtViewer::DrawType, SoQtViewer::DrawStyle)
Definition: VP1ExaminerViewer.cxx:1737
VP1QtInventorUtils::sbcol2qcol
static QColor sbcol2qcol(const SbColor &)
Definition: VP1QtInventorUtils.cxx:1140
VP1ExaminerViewer::Imp::storedViewsChanged
void storedViewsChanged()
Definition: VP1ExaminerViewer.cxx:356
VP1ExaminerViewer::startTourEachEvent
bool startTourEachEvent() const
Definition: VP1ExaminerViewer.cxx:1172
VP1ExaminerViewer::setStereoTypeSlot
SbBool setStereoTypeSlot(SoQtViewer::StereoType type)
Definition: VP1ExaminerViewer.cxx:580
VP1ExaminerViewer::Imp::operator=
Imp & operator=(const Imp &)=delete
VP1ExaminerViewer::Imp::XROT
@ XROT
Definition: VP1ExaminerViewer.cxx:193
VP1ExaminerViewer::setAmbientLight
void setAmbientLight(int)
Definition: VP1ExaminerViewer.cxx:2420
VP1ExaminerViewer::Imp::popup_tourSpeedSlow
QAction * popup_tourSpeedSlow
Definition: VP1ExaminerViewer.cxx:234
VP1ExaminerViewer::setAntiAlias
void setAntiAlias(bool)
Definition: VP1ExaminerViewer.cxx:1752
VP1ExaminerViewer::Imp::customstereoeditor
VP1CustomStereoEditor * customstereoeditor
Definition: VP1ExaminerViewer.cxx:214
python.selection.number
number
Definition: selection.py:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
VP1CameraHelper::animatedZoomToCameraState
static VP1CameraHelper * animatedZoomToCameraState(SoCamera *camera, SoGroup *sceneroot, const QByteArray &camstate, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, bool varySpeed=true, bool forceCircular=false)
Definition: VP1CameraHelper.cxx:301
VP1ExaminerViewer::Imp::action_movieheight
QAction * action_movieheight
Definition: VP1ExaminerViewer.cxx:255
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
AnimationSequence::VERTEX
@ VERTEX
Definition: AnimationSequence.h:26
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
VP1QtInventorUtils::transparencyTypeToInt
static int transparencyTypeToInt(SoGLRenderAction::TransparencyType)
Definition: VP1QtInventorUtils.cxx:663
VP1ExaminerViewer::Imp::isantialias
bool isantialias
Definition: VP1ExaminerViewer.cxx:288
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
VP1ExaminerViewer::startCustomTour
void startCustomTour()
Definition: VP1ExaminerViewer.cxx:1244
VP1ExaminerViewer::Imp::updateAmbientLightText
void updateAmbientLightText()
Definition: VP1ExaminerViewer.cxx:308
VP1ExaminerViewer::Imp::popup_tourSpeedFast
QAction * popup_tourSpeedFast
Definition: VP1ExaminerViewer.cxx:236
VP1ExaminerViewer::Imp::popup_tourLoopThrice
QAction * popup_tourLoopThrice
Definition: VP1ExaminerViewer.cxx:244
VP1ExaminerViewer::Imp::StoredView::m_cachedIcon
QIcon m_cachedIcon
Definition: VP1ExaminerViewer.cxx:350
VP1ExaminerViewer::fadeLastRecordedFrameToCurrent
void fadeLastRecordedFrameToCurrent(double time_seconds)
Definition: VP1ExaminerViewer.cxx:3144
VP1ExaminerViewer::Imp::popup_drawstyle_still_actions
QList< QAction * > popup_drawstyle_still_actions
Definition: VP1ExaminerViewer.cxx:228
VP1ExaminerViewer::Imp::action_moviefps
QAction * action_moviefps
Definition: VP1ExaminerViewer.cxx:256
VP1ExaminerViewer::Imp::StoredView::isValid
bool isValid()
Definition: VP1ExaminerViewer.cxx:342
query_example.col
col
Definition: query_example.py:7
VP1ExaminerViewer::Imp::popup_tourLoopOnce
QAction * popup_tourLoopOnce
Definition: VP1ExaminerViewer.cxx:242
VP1ExaminerViewer::bottomWheelFinish
virtual void bottomWheelFinish()
Definition: VP1ExaminerViewer.cxx:1518
VP1ExaminerViewer::Imp::firstAvailableStoredViewName
QString firstAvailableStoredViewName()
Definition: VP1ExaminerViewer.cxx:368
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
LVL1TGC::ASIDE
@ ASIDE
Definition: TGCNumbering.h:14
VP1ExaminerViewer::Imp::addNewButton
QPushButton * addNewButton(QString text, QString tooltip, REGION region, VIEW view, QWidget *tempparent, QString iconname="")
Definition: VP1ExaminerViewer.cxx:964
AnimationSequence::clearAllFrames
void clearAllFrames()
Definition: AnimationSequence.h:50
VP1ExaminerViewer::Imp::button_home
QPushButton * button_home
Definition: VP1ExaminerViewer.cxx:291
VP1ExaminerViewer::stereo_offset_camera
float stereo_offset_camera
Definition: VP1ExaminerViewer.h:91
VP1ExaminerViewer::Imp::storeViewActions
QList< QAction * > storeViewActions
Definition: VP1ExaminerViewer.cxx:364
VP1ExaminerViewer::Imp::CALO
@ CALO
Definition: VP1ExaminerViewer.cxx:175
python.PyAthena.v
v
Definition: PyAthena.py:157
VP1QtUtils::fadeImage
static QImage fadeImage(QImage img0, QImage img1, double fadefact)
Definition: VP1QtUtils.cxx:176
get_generator_info.version
version
Definition: get_generator_info.py:33
VP1QtInventorUtils::writeGraphToFile
static bool writeGraphToFile(SoNode *root, const QString &filename)
Definition: VP1QtInventorUtils.cxx:1421
VP1ExaminerViewer::Imp::intToViewerDrawStyle
static SoQtViewer::DrawStyle intToViewerDrawStyle(int)
Definition: VP1ExaminerViewer.cxx:3073
VP1ExaminerViewer::Imp::getRegionSphere
SoSphere * getRegionSphere(REGION, bool perspective)
Definition: VP1ExaminerViewer.cxx:1179
VP1ExaminerViewer::Imp
Definition: VP1ExaminerViewer.cxx:68
VP1ExaminerViewer::Imp::VIEW
VIEW
Definition: VP1ExaminerViewer.cxx:189
AnimationSequence::REGION
REGION
Definition: AnimationSequence.h:26
VP1ExaminerViewer::Imp::popup_toSVGAction
QAction * popup_toSVGAction
Definition: VP1ExaminerViewer.cxx:223
VP1ExaminerViewer::Imp::intToDrawStyle
static SoQtViewer::DrawStyle intToDrawStyle(int)
Definition: VP1ExaminerViewer.cxx:618
VP1ExaminerViewer::Imp::popup_tourLoopForever
QAction * popup_tourLoopForever
Definition: VP1ExaminerViewer.cxx:245
AnimationSequence::CALO
@ CALO
Definition: AnimationSequence.h:26
VP1ExaminerViewer::Imp::popup_tourPartsCalo
QAction * popup_tourPartsCalo
Definition: VP1ExaminerViewer.cxx:240
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
VP1ExaminerViewer::Imp::Imp
Imp(const Imp &)=delete
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition: VP1Msg.cxx:39
VP1CustomStereoEditor
Definition: VP1CustomStereoEditor.h:30
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
VP1ExaminerViewer::Imp::popup_hidedecorationsaction
QAction * popup_hidedecorationsaction
Definition: VP1ExaminerViewer.cxx:226
VP1ExaminerViewer::getStereoOffsetSlot
float getStereoOffsetSlot()
Definition: VP1ExaminerViewer.cxx:577
CSV_InDetExporter.old
old
Definition: CSV_InDetExporter.py:145
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition: VP1Msg.cxx:30
VP1ExaminerViewer::Imp::popup_tourPartsVertex
QAction * popup_tourPartsVertex
Definition: VP1ExaminerViewer.cxx:238
SoGL2PSAction
SoGL2PSAction inherits Inventor/SoGLRenderAction.
Definition: SoGL2PSAction.h:17
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
VP1ExaminerViewer::Imp::customtoureditorState
QByteArray customtoureditorState
Definition: VP1ExaminerViewer.cxx:212
VP1ExaminerViewer::Imp::popup_dumpSceneAction
QAction * popup_dumpSceneAction
Definition: VP1ExaminerViewer.cxx:221
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
VP1ExaminerViewer::setStereoOffsetSlot
void setStereoOffsetSlot(float offset)
Definition: VP1ExaminerViewer.cxx:573
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
VP1QtInventorUtils::intToTransparencyType
static SoGLRenderAction::TransparencyType intToTransparencyType(int)
Definition: VP1QtInventorUtils.cxx:683
VP1ExaminerViewer::Imp::updateAnimationSequence
bool updateAnimationSequence()
Definition: VP1ExaminerViewer.cxx:985
VP1HEPVisUtils::convertToStandardScene
static SoGroup * convertToStandardScene(SoGroup *)
Definition: VP1HEPVisUtils.cxx:157
VP1ExaminerViewer::Imp::deleteViewActions
QList< QAction * > deleteViewActions
Definition: VP1ExaminerViewer.cxx:366
DeMoScan.first
bool first
Definition: DeMoScan.py:534
VP1ExaminerViewer::Imp::tourLoopsForeverSkipFirstFrame
bool tourLoopsForeverSkipFirstFrame
Definition: VP1ExaminerViewer.cxx:284
VP1ExaminerViewer::Imp::action_moviefadetocurrentview
QAction * action_moviefadetocurrentview
Definition: VP1ExaminerViewer.cxx:258
VP1ExaminerViewer::Imp::applyMovieSettingsToAnimationSequencer
void applyMovieSettingsToAnimationSequencer()
Definition: VP1ExaminerViewer.cxx:1225
VP1ExaminerViewer::Imp::popup_menu
QMenu * popup_menu
Definition: VP1ExaminerViewer.cxx:215
LArCellConditions.sv
bool sv
Definition: LArCellConditions.py:45
VP1ExaminerViewer::Imp::BARREL
@ BARREL
Definition: VP1ExaminerViewer.cxx:189
VP1ExaminerViewer::Imp::StoredView::m_camPerspective
bool m_camPerspective
Definition: VP1ExaminerViewer.cxx:347
VP1ExaminerViewer_SignalCatcher::catchSignal
void catchSignal()
Definition: VP1ExaminerViewer.cxx:1138
Herwig7_QED_EvtGen_ll.fs
dictionary fs
Definition: Herwig7_QED_EvtGen_ll.py:17
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
GL2PS_BSP_SORT
#define GL2PS_BSP_SORT
Definition: gl2ps.h:105
VP1QtInventorUtils::renderToPixmap
static QPixmap renderToPixmap(VP1ExaminerViewer *ra, int pixels_x, int pixels_y, bool transparent_background=false, double actualRenderedSizeFact=1.0)
Definition: VP1QtInventorUtils.cxx:593
BARREL
@ BARREL
Definition: TRTRadiatorParameters.h:10
VP1Controller::setCustomTourEditor
static void setCustomTourEditor(VP1CustomTourEditor *editor)
Definition: VP1Controller.h:60
VP1ExaminerViewer::Imp::ZROT
@ ZROT
Definition: VP1ExaminerViewer.cxx:193
fixedDistanceClipPlanesCB
SbVec2f fixedDistanceClipPlanesCB(void *data, const SbVec2f &nearfar)
set the clipping strategy and fix the clipping
Definition: VP1ExaminerViewer.cxx:512
VP1CustomTourEditor::disableObjectWhenTourNotAvailable
void disableObjectWhenTourNotAvailable(QObject *)
Definition: VP1CustomTourEditor.cxx:451
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
VP1ExaminerViewer::Imp::StoredView::snapShot
QPixmap snapShot() const
Definition: VP1ExaminerViewer.cxx:335
VP1ExaminerViewer::Imp::intToViewerStereoType
static SoQtViewer::StereoType intToViewerStereoType(int)
Definition: VP1ExaminerViewer.cxx:3013
VP1ExaminerViewer::Imp::button_examine
QPushButton * button_examine
Definition: VP1ExaminerViewer.cxx:290
VP1ExaminerViewer::Imp::animationSequencer
AnimationSequencer animationSequencer
Definition: VP1ExaminerViewer.cxx:282
VP1ExaminerViewer::Imp::REGION
REGION
Definition: VP1ExaminerViewer.cxx:175
VP1ExaminerViewer::Imp::StoredView::icon
QIcon icon() const
Definition: VP1ExaminerViewer.cxx:337
VP1ExaminerViewer::Imp::customtoureditor
VP1CustomTourEditor * customtoureditor
Definition: VP1ExaminerViewer.cxx:213
VP1CustomTourEditor::addTourToAnimationSequencer
void addTourToAnimationSequencer(AnimationSequencer &, bool jumpDirectlyToFirstFrame) const
Definition: VP1CustomTourEditor.cxx:419
VP1ExaminerViewer::showPopupMenu
virtual void showPopupMenu()
Definition: VP1ExaminerViewer.cxx:2439
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
VP1ExaminerViewer::Imp::grabFocus
void grabFocus()
Definition: VP1ExaminerViewer.cxx:1216
VP1ExaminerViewer::Imp::popup_tourStartEachEvent
QAction * popup_tourStartEachEvent
Definition: VP1ExaminerViewer.cxx:232
VP1ExaminerViewer::storeCameraParametersForReset
void storeCameraParametersForReset()
Definition: VP1ExaminerViewer.cxx:1814
VP1ExaminerViewer::Imp::actualSceneGraph
SoGroup * actualSceneGraph
Definition: VP1ExaminerViewer.cxx:204
VP1ExaminerViewer::Imp::INDET
@ INDET
Definition: VP1ExaminerViewer.cxx:175
gl2psBeginPage
GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, GLint viewport[4], GLint format, GLint sort, GLint options, GLint colormode, GLint colorsize, GL2PSrgba *colormap, GLint nr, GLint ng, GLint nb, GLint buffersize, FILE *stream, const char *filename)
Definition: gl2ps.cxx:5583
VP1Msg::messageWarningRed
static void messageWarningRed(const QString &str, IVP1System *sys=0)
Definition: VP1Msg.cxx:57
VP1QtInventorUtils::writeGraphToVRMLFile
static bool writeGraphToVRMLFile(SoNode *root, const QString &filename)
Definition: VP1QtInventorUtils.cxx:1456
VP1Controller.h
GL2PS_USE_CURRENT_VIEWPORT
#define GL2PS_USE_CURRENT_VIEWPORT
Definition: gl2ps.h:129
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
VP1ExaminerViewer::Imp::popup_dumpSceneVRMLAction
QAction * popup_dumpSceneVRMLAction
Definition: VP1ExaminerViewer.cxx:222
VP1ExaminerViewer::processSoEvent
virtual SbBool processSoEvent(const SoEvent *const event)
Definition: VP1ExaminerViewer.cxx:1391
VP1ExaminerViewer::saveState
virtual QByteArray saveState()
Definition: VP1ExaminerViewer.cxx:638
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
SoGL2PSAction::initClass
static void initClass()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition: SoGL2PSAction.cxx:24
VP1ExaminerViewer::bottomWheelMotion
virtual void bottomWheelMotion(float val)
Definition: VP1ExaminerViewer.cxx:1526
VP1CameraHelper::animatedZoomToSubTree
static VP1CameraHelper * animatedZoomToSubTree(SoCamera *camera, SoGroup *sceneroot, SoNode *subtreeroot, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999), bool varySpeed=true, bool forceCircular=false)
Definition: VP1CameraHelper.cxx:413
VP1ExaminerViewer::Imp::viewerStereoType2PrettyString
static QString viewerStereoType2PrettyString(SoQtViewer::StereoType)
Definition: VP1ExaminerViewer.cxx:2984
VP1QtInventorUtils::serializeSoCameraParameters
static QByteArray serializeSoCameraParameters(const SoCamera &)
Definition: VP1QtInventorUtils.cxx:884
python.compressB64.c
def c
Definition: compressB64.py:93
VP1ExaminerViewer::Imp::environmentNode
SoEnvironment * environmentNode
Definition: VP1ExaminerViewer.cxx:205
VP1ExaminerViewer::m_d
Imp * m_d
Definition: VP1ExaminerViewer.h:129
VP1ExaminerViewer::Imp::MUON
@ MUON
Definition: VP1ExaminerViewer.cxx:175
GL2PS_OCCLUSION_CULL
#define GL2PS_OCCLUSION_CULL
Definition: gl2ps.h:124
VP1ExaminerViewer::Imp::button_interact
QPushButton * button_interact
Definition: VP1ExaminerViewer.cxx:289
VP1CustomStereoEditor.h
VP1ExaminerViewer
Definition: VP1ExaminerViewer.h:30
VP1ExaminerViewer::Imp::ASIDE
@ ASIDE
Definition: VP1ExaminerViewer.cxx:189
VP1ExaminerViewer::Imp::viewmenu_zoomtoview
QMenu * viewmenu_zoomtoview
Definition: VP1ExaminerViewer.cxx:249
drawFromPickle.view
view
Definition: drawFromPickle.py:294
VP1ExaminerViewer::leftWheelFinish
virtual void leftWheelFinish()
Definition: VP1ExaminerViewer.cxx:1542
VP1ExaminerViewer::Imp::button_seek
QPushButton * button_seek
Definition: VP1ExaminerViewer.cxx:294
gl2psEndPage
GL2PSDLL_API GLint gl2psEndPage(void)
Definition: gl2ps.cxx:5750
VP1ExaminerViewer::isAntiAlias
bool isAntiAlias() const
Definition: VP1ExaminerViewer.cxx:1743