23#include <osg/observer_ptr>
87 virtual void apply( osg::RenderInfo& renderInfo );
101 typedef std::queue<std::pair<osg::ref_ptr<osg::Image>,
agx::Index> > ImageVectorT;
110 bool m_captureEnabled;
116 osg::ref_ptr<DrawCallback> m_drawCallback;
175 std::string m_prefix;
176 std::string m_postfix;
177 std::string m_directory;
186 void push(ImageVectorT::value_type image_set)
189 ImageVectorT::push(image_set);
196 return ImageVectorT::size();
202 while(ImageVectorT::size())
240 void push(ImageVectorT::value_type image_set);
246 ImageVectorT::value_type topAndPop();
251 std::atomic<bool> m_stop;
261 virtual void operator () (osg::RenderInfo& renderInfo)
const;
262 using osg::Camera::DrawCallback::operator();
#define AGX_DECLARE_POINTER_TYPES(type)
void push(ImageVectorT::value_type image_set)
WriteImageThread(ImageCaptureBase *cap)
virtual void run()
This method is invoked by start.
void push(ImageVectorT::value_type image_set)
virtual ~WriteImageThread()
agxSDK::Simulation * getSimulation()
virtual bool stopCapture()
Return false if stopping an already stopped capture process.
virtual void writeImage(osg::Image *image, agx::Index index)=0
agx::Vec2u getImageResolution() const
bool getEnableSyncWithSimulation() const
void setFps(agx::Real fps)
Set the desired frame rate (rate of capture).
DrawCallback(ImageCaptureBase *capture)
ImageCaptureBase * getImageCapture()
void setImageCapture(ImageCaptureBase *ic)
virtual void apply(osg::RenderInfo &renderInfo)
virtual ~ImageCaptureBase()
virtual void startCapture(int startImageNumber=0)
Enable/disable capturing.
DrawCallback * getDrawCallback()
agx::Real getFps()
Return the specified desired frame rate for capture.
void setEnableSyncWithSimulation(bool enableSync)
void setCaptureStarted(bool f)
void setSimulation(agxSDK::Simulation *simulation)
ImageCaptureBase(agxSDK::Simulation *sim=nullptr)
void setImageResolution(agx::UInt width, agx::UInt height)
void setMaxImages(int i)
Set a limit of the maximum number of images that should be captured Set -1 for no limit.
bool getCaptureStarted() const
Return whether the capturing is enabled or not.
ImageCapture(agxSDK::Simulation *sim=nullptr)
void setPostfix(const std::string &postfix)
Sets the postfix.
void setPrefix(const std::string &prefix)
std::string getPrefix() const
void setDirectoryPath(const std::string &path)
std::string getDirectoryPath() const
virtual void writeImage(osg::Image *image, agx::Index index)
std::string getPostfix() const
Class to throttle a task to a specific frequency (fps).
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Basic wrapper class aroud std::thread.
Block synchronization primitive.
void reset()
Reset the block.
void release()
Release the block.
void block()
Block until released from another thread.
Base class providing referencing counted objects.
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
std::lock_guard< T > ScopeLock
agx::ScopeLock is an alias for std::lock_guard
std::recursive_mutex ReentrantMutex