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;
259 class AGXOSG_EXPORT ImageCaptureBase::DrawCallback :
public osg::Camera::DrawCallback
262 DrawCallback(ImageCaptureBase* capture);
264 virtual void operator () (osg::RenderInfo& renderInfo)
const;
265 using osg::Camera::DrawCallback::operator();
266 ImageCaptureBase* getImageCapture();
267 void setImageCapture( ImageCaptureBase* ic );
270 ImageCaptureBase *m_imageCapture;
Basic wrapper class aroud std::thread.
std::string getPrefix() const
void AGXPHYSICS_EXPORT shutdown()
Shutdown of the AGX Dynamics API will be done when the number of shutdown matches the number of calls...
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.
void push(ImageVectorT::value_type image_set)
std::lock_guard< T > ScopeLock
agx::ScopeLock is an alias for std::lock_guard
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
std::string getDirectoryPath() const
std::recursive_mutex ReentrantMutex
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
void setDirectoryPath(const std::string &path)