AGX Dynamics  2.38.0.2
agxQt/VideoCapture.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_QTSIMULATIONRECORDER_H
18 #define AGXQT_QTSIMULATIONRECORDER_H
19 
20 #include <agxQt/export.h>
21 #include <agx/Vec3.h>
22 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
23 #include <osgViewer/ViewerEventHandlers>
24 #include <osgViewer/Renderer>
25 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
26 
27 #include <agx/Referenced.h>
28 #include <agxSDK/Simulation.h>
29 #include <agxOSG/ImageCapture.h>
30 #include <agxOSG/RenderToTexture.h>
32 
33 namespace agxQt
34 {
35  class QtAgxWrapper;
36 
42  {
43  public:
45  VideoCapture(QtAgxWrapper * wrapper);
46 
50  void setVideoFPS(agx::Real fps);
51 
55  agx::Real getVideoFPS() const;
56 
60  void setEnableSyncWithSimulation(bool enable);
61 
65  void setSimulation(agxSDK::Simulation * simulation);
66 
70  void setCompleteFileName(const std::string& filename);
71 
75  agx::String getFileNameWithoutPostFix() const;
76 
80  agx::String getCompleteFileName() const;
81 
85  void setVideoResolution(const agx::Vec2u& resolution);
86 
91  void setRealTimeFactor(agx::Real factor);
92 
97  agx::Real getRealTimeFactor() const;
98 
103  void setQuality(agx::Real quality);
104 
109  agx::Real getQuality();
110 
114  void startCapture();
115 
119  void stopCapture();
120 
124  bool hasActiveVideo();
125 
129  agx::UInt getNumGeneratedImages();
130 
135  void finalizeVideo();
136 
137  protected:
139  virtual ~VideoCapture();
140 
141  private:
142  void initResolutionForRenderToTexture(const agx::Vec2u& resolution);
143 
145  // Variables
147  protected:
154  };
155 }
156 
157 
158 #endif
agxQt::VideoCapture::m_qtagxWrapper
QtAgxWrapper * m_qtagxWrapper
Definition: agxQt/VideoCapture.h:148
agx::UInt
uint64_t UInt
Definition: Integer.h:27
Referenced.h
agxQt::VideoCapture::m_renderToTexture
agxOSG::RenderToTextureRef m_renderToTexture
Definition: agxQt/VideoCapture.h:151
agx::Real
double Real
Definition: Real.h:42
AGXQT_EXPORT
#define AGXQT_EXPORT
agxQt
Contains classes/utility functions for connecting AGX to QT with OSG.
Definition: AnalysisBoundWidget.h:30
agxQt::QtAgxWrapper
Class that wraps SimulationController with an interface that enables QT Gui signals to control the si...
Definition: QtAgxWrapper.h:70
VideoFFMPEGPipeCapture.h
Simulation.h
agxQt::VideoCapture::m_imageNumber
agx::UInt m_imageNumber
Definition: agxQt/VideoCapture.h:150
export.h
RenderToTexture.h
agxQt::VideoCapture::m_quality
agx::Real m_quality
Definition: agxQt/VideoCapture.h:153
Vec3.h
agx::ref_ptr< agxOSG::VideoFFMPEGPipeCapture >
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:125
PushDisableWarnings.h
agxQt::VideoCapture::m_realTimeFactor
agx::Real m_realTimeFactor
Definition: agxQt/VideoCapture.h:152
agx::Vec2T< UInt >
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:119
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agxQt::VideoCapture
Definition: agxQt/VideoCapture.h:41
agx::AgXString< std::string >
ImageCapture.h
agxQt::VideoCapture::m_videoCapture
agx::ref_ptr< agxOSG::VideoFFMPEGPipeCapture > m_videoCapture
Definition: agxQt/VideoCapture.h:149
PopDisableWarnings.h