17 #ifndef AGXOSG_IMAGECAPTURE_H
18 #define AGXOSG_IMAGECAPTURE_H
25 #include <osg/observer_ptr>
62 void setMaxImages(
int i);
65 virtual void startCapture(
int startImageNumber=0 );
68 virtual bool stopCapture();
71 bool getCaptureStarted()
const;
80 int getImageNum()
const;
82 DrawCallback *getDrawCallback();
84 void setEnableSyncWithSimulation(
bool enableSync );
85 bool getEnableSyncWithSimulation( )
const;
89 virtual void apply( osg::RenderInfo& renderInfo );
92 virtual void writeImage(osg::Image *image,
agx::Index index) = 0;
96 void setCaptureStarted(
bool f);
103 typedef std::queue<std::pair<osg::ref_ptr<osg::Image>,
agx::Index> > ImageVectorT;
112 bool m_captureEnabled;
120 osg::ref_ptr<DrawCallback> m_drawCallback;
171 virtual void writeImage(osg::Image *image,
agx::Index index);
178 std::string m_prefix;
179 std::string m_postfix;
180 std::string m_directory;
189 void push(ImageVectorT::value_type image_set)
192 ImageVectorT::push(image_set);
199 return ImageVectorT::size();
205 while(ImageVectorT::size())
243 void push(ImageVectorT::value_type image_set);
249 ImageVectorT::value_type topAndPop();
254 std::atomic<bool> m_stop;
264 virtual void operator () (osg::RenderInfo& renderInfo)
const;
265 using osg::Camera::DrawCallback::operator();
Basic wrapper class aroud std::thread.
void AGXPHYSICS_EXPORT shutdown()
Shutdown agx.
void setPrefix(const std::string &prefix)
std::string getPostfix() const
#define AGX_DECLARE_POINTER_TYPES(type)
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
Block synchronization primitive.
Base class providing referencing counted objects.
void setPostfix(const std::string &postfix)
Sets the postfix.
virtual ~WriteImageThread()
void push(ImageVectorT::value_type image_set)
std::lock_guard< T > ScopeLock
agx::ScopeLock is an alias for std::lock_guard
void push(ImageVectorT::value_type image_set)
void release()
Release the block.
void reset()
Reset the block.
std::string getDirectoryPath() const
std::string getPrefix() const
std::recursive_mutex ReentrantMutex
WriteImageThread(ImageCaptureBase *cap)
void block()
Block until released from another thread.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
virtual void run()
This method is invoked by start.
void setDirectoryPath(const std::string &path)