AGX Dynamics  2.37.3.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
agx::ref_ptr< agxOSG::VideoFFMPEGPipeCapture > m_videoCapture
#define AGXQT_EXPORT
Contains classes/utility functions for connecting AGX to QT with OSG.
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
QtAgxWrapper * m_qtagxWrapper
Base class providing referencing counted objects.
Definition: Referenced.h:119
uint32_t UInt
Definition: Integer.h:34
agxOSG::RenderToTextureRef m_renderToTexture
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
double Real
Definition: Real.h:42
Class that wraps SimulationController with an interface that enables QT Gui signals to control the si...
Definition: QtAgxWrapper.h:70