AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxOSG::ImageCapture Class Reference

#include <ImageCapture.h>

+ Inheritance diagram for agxOSG::ImageCapture:

Public Member Functions

 ImageCapture (agxSDK::Simulation *sim=nullptr)
 
virtual void apply (osg::RenderInfo &renderInfo)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
 DrawCallback (ImageCaptureBase *capture)
 
bool getCaptureStarted () const
 Return whether the capturing is enabled or not. More...
 
std::string getDirectoryPath () const
 
DrawCallback * getDrawCallback ()
 
bool getEnableSyncWithSimulation () const
 
agx::Real getFps ()
 Return the specified desired frame rate for capture. More...
 
ImageCaptureBase * getImageCapture ()
 
int getImageNum () const
 
agx::Vec2u getImageResolution () const
 
std::string getPostfix () const
 
std::string getPrefix () const
 
int getReferenceCount () const
 
agxSDK::Simulation * getSimulation ()
 
template<typename T >
bool is () const
 Subclass test. More...
 
virtual void operator() (osg::RenderInfo &renderInfo) const
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void resetTime ()
 
void setDirectoryPath (const std::string &path)
 
void setEnableSyncWithSimulation (bool enableSync)
 
void setFps (agx::Real fps)
 Set the desired frame rate (rate of capture). More...
 
void setImageCapture (ImageCaptureBase *ic)
 
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 More...

 
void setPostfix (const std::string &postfix)
 Sets the postfix. More...
 
void setPrefix (const std::string &prefix)
 
void setSimulation (agxSDK::Simulation *simulation)
 
virtual void startCapture (int startImageNumber=0)
 Enable/disable capturing. More...
 
virtual bool stopCapture ()
 Return false if stopping an already stopped capture process. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
virtual void writeImage (osg::Image *image, agx::Index index)
 

Static Public Member Functions

template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~ImageCapture ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void setCaptureStarted (bool f)
 
void shutdown ()
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Definition at line 129 of file ImageCapture.h.

Constructor & Destructor Documentation

agxOSG::ImageCapture::ImageCapture ( agxSDK::Simulation *  sim = nullptr)
virtual agxOSG::ImageCapture::~ImageCapture ( )
protectedvirtual

Member Function Documentation

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
virtual void agxOSG::ImageCaptureBase::apply ( osg::RenderInfo &  renderInfo)
virtualinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
agxOSG::ImageCaptureBase::DrawCallback ( ImageCaptureBase *  capture)
inherited
bool agxOSG::ImageCaptureBase::getCaptureStarted ( ) const
inherited

Return whether the capturing is enabled or not.

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
std::string agxOSG::ImageCapture::getDirectoryPath ( ) const
inline

Definition at line 161 of file ImageCapture.h.

DrawCallback* agxOSG::ImageCaptureBase::getDrawCallback ( )
inherited
bool agxOSG::ImageCaptureBase::getEnableSyncWithSimulation ( ) const
inherited
agx::Real agxOSG::ImageCaptureBase::getFps ( )
inherited

Return the specified desired frame rate for capture.

ImageCaptureBase* agxOSG::ImageCaptureBase::getImageCapture ( )
inherited
int agxOSG::ImageCaptureBase::getImageNum ( ) const
inherited
agx::Vec2u agxOSG::ImageCaptureBase::getImageResolution ( ) const
inherited
std::string agxOSG::ImageCapture::getPostfix ( ) const
inline

Definition at line 136 of file ImageCapture.h.

std::string agxOSG::ImageCapture::getPrefix ( ) const
inline

Definition at line 151 of file ImageCapture.h.

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agxSDK::Simulation* agxOSG::ImageCaptureBase::getSimulation ( )
inherited
template<typename T >
bool agx::Referenced::is ( ) const
inherited
virtual void agxOSG::ImageCaptureBase::operator() ( osg::RenderInfo &  renderInfo) const
virtualinherited
void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

Referenced by agxData::Val< UInt >::Val().

void agxOSG::ImageCaptureBase::resetTime ( )
inherited
void agxOSG::ImageCaptureBase::setCaptureStarted ( bool  f)
protectedinherited
static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

void agxOSG::ImageCapture::setDirectoryPath ( const std::string &  path)
inline

Definition at line 166 of file ImageCapture.h.

void agxOSG::ImageCaptureBase::setEnableSyncWithSimulation ( bool  enableSync)
inherited
void agxOSG::ImageCaptureBase::setFps ( agx::Real  fps)
inherited

Set the desired frame rate (rate of capture).

void agxOSG::ImageCaptureBase::setImageCapture ( ImageCaptureBase *  ic)
inherited
void agxOSG::ImageCaptureBase::setImageResolution ( agx::UInt  width,
agx::UInt  height 
)
inherited
void agxOSG::ImageCaptureBase::setMaxImages ( int  i)
inherited

Set a limit of the maximum number of images that should be captured

Set -1 for no limit

void agxOSG::ImageCapture::setPostfix ( const std::string &  postfix)
inline

Sets the postfix.

Should be of form "bmp", "png" and so on. Default is "bmp".

Definition at line 146 of file ImageCapture.h.

void agxOSG::ImageCapture::setPrefix ( const std::string &  prefix)
inline

Definition at line 156 of file ImageCapture.h.

void agxOSG::ImageCaptureBase::setSimulation ( agxSDK::Simulation *  simulation)
inherited
void agxOSG::ImageCaptureBase::shutdown ( )
protectedinherited
virtual void agxOSG::ImageCaptureBase::startCapture ( int  startImageNumber = 0)
virtualinherited

Enable/disable capturing.

virtual bool agxOSG::ImageCaptureBase::stopCapture ( )
virtualinherited

Return false if stopping an already stopped capture process.

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited
virtual void agxOSG::ImageCapture::writeImage ( osg::Image *  image,
agx::Index  index 
)
virtual

Member Data Documentation

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


The documentation for this class was generated from the following file: