AGX Dynamics  2.35.0.1
agxQt/VideoCapture.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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:
46 
51 
56 
60  void setEnableSyncWithSimulation(bool enable);
61 
65  void setSimulation(agxSDK::Simulation * simulation);
66 
70  void setCompleteFileName(const std::string& filename);
71 
76 
81 
85  void setVideoResolution(const agx::Vec2u& resolution);
86 
92 
98 
103  void setQuality(agx::Real quality);
104 
110 
114  void startCapture();
115 
119  void stopCapture();
120 
125 
130 
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
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXQT_EXPORT
Class that wraps SimulationController with an interface that enables QT Gui signals to control the si...
Definition: QtAgxWrapper.h:73
void stopCapture()
Pauses the video capture, if active.
agxOSG::RenderToTextureRef m_renderToTexture
agx::String getCompleteFileName() const
Get the filename, including the postfix, of the video file that should be generated.
agx::Real getRealTimeFactor() const
Get the real time factor of the video, which is the ratio between the video FPS and image capture FPS...
void setVideoResolution(const agx::Vec2u &resolution)
Set the resolution of the video that is to be generated.
agx::Real getVideoFPS() const
Get the desired video frame rate of the capture.
void startCapture()
Starts or resumes the video capture.
virtual ~VideoCapture()
Protected destructor.
void setRealTimeFactor(agx::Real factor)
Set the real time factor of the video, which is the ratio between the video FPS and image capture FPS...
agx::UInt getNumGeneratedImages()
Returns the number of generated video frames.
bool hasActiveVideo()
Returns true if there is an active video capture process, otherwise false.
agx::Real getQuality()
Get the quality of the video which is a normalized value between 0.0-1.0.
void setQuality(agx::Real quality)
Set the quality of the video which is a normalized value between 0.0-1.0.
agx::String getFileNameWithoutPostFix() const
Get the filename, without the postfix, of the video file that should be generated.
void setEnableSyncWithSimulation(bool enable)
Set to true/false if the video capture should synchronize with simulation time stepping.
void finalizeVideo()
Finalizes the current video process by completing the video file and closing down the video capture p...
void setSimulation(agxSDK::Simulation *simulation)
Set the simulation that the video capture should synchronize with.
QtAgxWrapper * m_qtagxWrapper
VideoCapture(QtAgxWrapper *wrapper)
Default constructor.
void setCompleteFileName(const std::string &filename)
Set the complete filename of the video file that should be generated, including postfix.
agx::ref_ptr< agxOSG::VideoFFMPEGPipeCapture > m_videoCapture
void setVideoFPS(agx::Real fps)
Set the desired video frame rate of the capture.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Base class providing referencing counted objects.
Definition: Referenced.h:114
Contains classes/utility functions for connecting AGX to QT with OSG.
uint32_t UInt
Definition: Integer.h:34
double Real
Definition: Real.h:42