ATLAS Offline Software
VP1CameraHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // Header file for class VP1CameraHelper //
8 // //
9 // Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> //
10 // //
11 // Initial version: July 2007 //
12 // //
14 
15 #ifndef VP1CAMERAHELPER_H
16 #define VP1CAMERAHELPER_H
17 
18 #include <QObject>
19 #include <Inventor/C/errors/debugerror.h>
20 #include <Inventor/SbVec3f.h>
21 
22 // fwd declarations
23 class SoQtRenderArea;
24 class VP1ExaminerViewer;
25 class SoCamera;
26 class SoNode;
27 class SbBox3f;
28 class SoGroup;
29 class SoPath;
30 
31 class VP1CameraHelper : public QObject {
32 
33  Q_OBJECT
34 
35 public:
36 
37  static void abortAnyCurrentZoom( SoCamera * camera );
38 
39  //Returned pointers are only for the case where you want to catch
40  //one of the signals that are emitted when the animation finishes.
41 
42  //NB: For the vector arguments below, the special value of
43  //SbVec3f(999,999,999) means that the cameras current value will be
44  //used!!
45 
46  //For zoom to persistified camera states:
47  static VP1CameraHelper * animatedZoomToCameraState( SoCamera * camera, SoGroup * sceneroot,
48  const QByteArray& camstate,
49  double duration_in_secs = 1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, bool varySpeed=true,
50  bool forceCircular = false );
51 
52  //Imitate the zoom towards a point (similar to the ones initiated by the user in an examiner viewer):
53  static VP1CameraHelper * animatedZoomToPoint( SoCamera * camera, SoGroup * sceneroot,
54  SbVec3f, double duration_in_secs = 1.0, double clipVolPercent=100.0, bool varySpeed=true,
55  bool forceCircular = false );
56 
57  //For the next three methods, slack < 1.0 gives tighter zoom and slack > 1.0 gives looser zoom.
58  //The first two are more reliable:
59  static VP1CameraHelper * animatedZoomToPath( SoCamera * camera, SoGroup * sceneroot,
60  SoPath * path, double duration_in_secs = 1.0, double clipVolPercent=100.0, double slack = 1.0,
61  const SbVec3f& lookat = SbVec3f(999,999,999),
62  const SbVec3f& upvec = SbVec3f(999,999,999), bool varySpeed=true,
63  bool forceCircular = false );
64 
65  static VP1CameraHelper * animatedZoomToBBox( SoCamera * camera, SoGroup * sceneroot,
66  const SbBox3f& box,double duration_in_secs = 1.0, double clipVolPercent=100.0, double slack = 1.0,
67  const SbVec3f& lookat = SbVec3f(999,999,999),
68  const SbVec3f& upvec = SbVec3f(999,999,999),bool varySpeed=true,
69  bool forceCircular = false );
70 
71  //Dont use the following if subtreeroot appears multiple times in your scenegraph:
72  static VP1CameraHelper * animatedZoomToSubTree( SoCamera * camera, SoGroup * sceneroot,
73  SoNode*subtreeroot,double duration_in_secs = 1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, double slack = 1.0,
74  const SbVec3f& lookat = SbVec3f(999,999,999),
75  const SbVec3f& upvec = SbVec3f(999,999,999), bool varySpeed=true,
76  bool forceCircular = false );
77 
78  //For outputting off-screen rendered frames to image files:
79 // void setOutputImagesMode(SoQtRenderArea * ra,
81  const QString& outputdir,
82  int width = 1024,
83  int height = 768,
84  double fps = 24,
85  const QString& prefix = "vp1_frame");
86 
87  static void getLastAndNextFrameFileNames( const QString& outputdir,const QString& prefix,
88  QString& lastOfExistingFiles,//=> returned as empty string if no existing files
89  QString& nextAvailableFile );
90 
91  //Force premature end:
92  void forceAbort();
93 
94 signals:
95  void animationFinished();//If Bob's your uncle and everything went as expected.
96  void animationFinishedAbnormally();//If e.g. the camera was deleted by someone else during animation.
97  void clipVolumePercentageOfATLAS(double);//The percentage of the ATLAS vol corresponding the clipping volume
98 
99 private:
100  VP1CameraHelper( SoCamera *, SoGroup * );
101  virtual ~VP1CameraHelper();
102  class Imp;
103  Imp * m_d;
104 };
105 
106 #endif
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
VP1CameraHelper::~VP1CameraHelper
virtual ~VP1CameraHelper()
Definition: VP1CameraHelper.cxx:245
VP1CameraHelper::animatedZoomToPoint
static VP1CameraHelper * animatedZoomToPoint(SoCamera *camera, SoGroup *sceneroot, SbVec3f, double duration_in_secs=1.0, double clipVolPercent=100.0, bool varySpeed=true, bool forceCircular=false)
Definition: VP1CameraHelper.cxx:592
VP1CameraHelper
Definition: VP1CameraHelper.h:31
VP1CameraHelper::forceAbort
void forceAbort()
Definition: VP1CameraHelper.cxx:150
VP1CameraHelper::getLastAndNextFrameFileNames
static void getLastAndNextFrameFileNames(const QString &outputdir, const QString &prefix, QString &lastOfExistingFiles, QString &nextAvailableFile)
Definition: VP1CameraHelper.cxx:793
VP1CameraHelper::animatedZoomToPath
static VP1CameraHelper * animatedZoomToPath(SoCamera *camera, SoGroup *sceneroot, SoPath *path, double duration_in_secs=1.0, double clipVolPercent=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:371
VP1CameraHelper::VP1CameraHelper
VP1CameraHelper(SoCamera *, SoGroup *)
Definition: VP1CameraHelper.cxx:202
VP1CameraHelper::animationFinishedAbnormally
void animationFinishedAbnormally()
VP1CameraHelper::abortAnyCurrentZoom
static void abortAnyCurrentZoom(SoCamera *camera)
Definition: VP1CameraHelper.cxx:265
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
python.L1.Config.LegacyTopoMergerMap.signals
signals
Definition: LegacyTopoMergerMap.py:13
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
VP1CameraHelper::animationFinished
void animationFinished()
VP1CameraHelper::clipVolumePercentageOfATLAS
void clipVolumePercentageOfATLAS(double)
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
VP1CameraHelper::setOutputImagesMode
void setOutputImagesMode(VP1ExaminerViewer *ra, const QString &outputdir, int width=1024, int height=768, double fps=24, const QString &prefix="vp1_frame")
Definition: VP1CameraHelper.cxx:164
VP1CameraHelper::Imp
Definition: VP1CameraHelper.cxx:42
VP1CameraHelper::m_d
Imp * m_d
Definition: VP1CameraHelper.h:102
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
VP1CameraHelper::animatedZoomToBBox
static VP1CameraHelper * animatedZoomToBBox(SoCamera *camera, SoGroup *sceneroot, const SbBox3f &box, double duration_in_secs=1.0, double clipVolPercent=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:460
VP1ExaminerViewer
Definition: VP1ExaminerViewer.h:30