AGX Dynamics  2.37.2.0
VideoCaptureSettingsWidget.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXQT_VIDEOCAPTURESETTINGSWIDGET_H
18 #define AGXQT_VIDEOCAPTURESETTINGSWIDGET_H
19 
20 #include <agxQt/export.h>
21 #include <agxQt/VideoCapture.h>
22 #include <agx/Referenced.h>
23 #include <agxIO/FileSystem.h>
24 #include <agx/Logger.h>
25 
26 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
27 #include <QWidget>
28 #include <QProcess>
29 #include <osgViewer/ViewerEventHandlers>
30 #include <osgViewer/Renderer>
31 #include <agxQt/ui_VideoCaptureSettingsWidget.h>
32 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
33 
34 #define DEFAULT_VIDEO_FPS 30
35 #define DEFAULT_CAPTURE_FPS 30
36 
37 #define QUALITY_INTERVAL 20
38 #define DEFAULT_QUALITY_TICK 17
39 
40 namespace agxQt
41 {
43  {
44  Q_OBJECT
45 
46  public:
47  explicit VideoCaptureSettingsWidget(QWidget *parent = 0);
48  virtual ~VideoCaptureSettingsWidget();
49 
51  void setData(
53  agx::Real simulationTimestep);
54 
56  std::string getVideoOutputName();
57 
59  agx::Real getVideoFPS() const;
60 
62  agx::Real getRealTimeFactor() const;
63 
65  agx::Real getVideoQuality();
66  void setVideoQuality(agx::Real quality);
67 
68  void updateVideoCapture();
69 
70 signals:
71  void signalGenerateMovie();
72  void signalSynchMediaSettingsWithWrapper();
73 
74  protected:
75  void setOutputPath();
76  void synchLabels();
77 
78  protected slots:
79  // Tab - Video slots
80  void slotFPSEditFinished();
81  void slotEditRealTimeFactor();
82  void slotSetOupoutPathButtonPressed();
83  void slotFinalizePressed();
84  void slotCloseWidget();
85  void slotQualitySliderChanged();
86 
88  // Variables
90  private:
91  agx::Real m_videoFPS;
92  agx::Real m_videoQuality;
93  QString m_videoOutputPath;
94  agx::Real m_realTimeFactor;
95  agx::Real m_timeStep;
96  agxQt::VideoCapture* m_videoCapture;
97  Ui::VideoCaptureSettingsWidget* m_ui;
98  };
99 }
100 
101 #endif // QT_VIDEOSETTINGS_WIDGET
#define AGXQT_EXPORT
Contains classes/utility functions for connecting AGX to QT with OSG.
double Real
Definition: Real.h:42