AGXDynamics  2.31.1.0
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

◆ ImageCapture()

agxOSG::ImageCapture::ImageCapture ( agxSDK::Simulation *  sim = nullptr)

◆ ~ImageCapture()

virtual agxOSG::ImageCapture::~ImageCapture ( )
protectedvirtual

Member Function Documentation

◆ allocateObserverVector()

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited

◆ apply()

virtual void agxOSG::ImageCaptureBase::apply ( osg::RenderInfo &  renderInfo)
virtualinherited

◆ as() [1/2]

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(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().

◆ as() [2/2]

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

◆ asSafe() [1/2]

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

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

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

◆ asSafe() [2/2]

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

◆ deleteUsingDeleteHandler()

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited

◆ DrawCallback()

agxOSG::ImageCaptureBase::DrawCallback ( ImageCaptureBase *  capture)
inherited

◆ getCaptureStarted()

bool agxOSG::ImageCaptureBase::getCaptureStarted ( ) const
inherited

Return whether the capturing is enabled or not.

◆ getDeleteHandler()

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.

◆ getDirectoryPath()

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

Definition at line 161 of file ImageCapture.h.

◆ getDrawCallback()

DrawCallback* agxOSG::ImageCaptureBase::getDrawCallback ( )
inherited

◆ getEnableSyncWithSimulation()

bool agxOSG::ImageCaptureBase::getEnableSyncWithSimulation ( ) const
inherited

◆ getFps()

agx::Real agxOSG::ImageCaptureBase::getFps ( )
inherited

Return the specified desired frame rate for capture.

◆ getImageCapture()

ImageCaptureBase* agxOSG::ImageCaptureBase::getImageCapture ( )
inherited

◆ getImageNum()

int agxOSG::ImageCaptureBase::getImageNum ( ) const
inherited

◆ getImageResolution()

agx::Vec2u agxOSG::ImageCaptureBase::getImageResolution ( ) const
inherited

◆ getPostfix()

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

Definition at line 136 of file ImageCapture.h.

◆ getPrefix()

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

Definition at line 151 of file ImageCapture.h.

◆ getReferenceCount()

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.

◆ getSimulation()

agxSDK::Simulation* agxOSG::ImageCaptureBase::getSimulation ( )
inherited

◆ is()

template<typename T >
bool agx::Referenced::is ( ) const
inherited

◆ operator()()

virtual void agxOSG::ImageCaptureBase::operator() ( osg::RenderInfo &  renderInfo) const
virtualinherited

◆ reference()

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.

◆ resetTime()

void agxOSG::ImageCaptureBase::resetTime ( )
inherited

◆ setCaptureStarted()

void agxOSG::ImageCaptureBase::setCaptureStarted ( bool  f)
protectedinherited

◆ setDeleteHandler()

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

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

◆ setDirectoryPath()

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

Definition at line 166 of file ImageCapture.h.

◆ setEnableSyncWithSimulation()

void agxOSG::ImageCaptureBase::setEnableSyncWithSimulation ( bool  enableSync)
inherited

◆ setFps()

void agxOSG::ImageCaptureBase::setFps ( agx::Real  fps)
inherited

Set the desired frame rate (rate of capture).

◆ setImageCapture()

void agxOSG::ImageCaptureBase::setImageCapture ( ImageCaptureBase *  ic)
inherited

◆ setImageResolution()

void agxOSG::ImageCaptureBase::setImageResolution ( agx::UInt  width,
agx::UInt  height 
)
inherited

◆ setMaxImages()

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.

◆ setPostfix()

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.

◆ setPrefix()

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

Definition at line 156 of file ImageCapture.h.

◆ setSimulation()

void agxOSG::ImageCaptureBase::setSimulation ( agxSDK::Simulation *  simulation)
inherited

◆ shutdown()

void agxOSG::ImageCaptureBase::shutdown ( )
protectedinherited

◆ startCapture()

virtual void agxOSG::ImageCaptureBase::startCapture ( int  startImageNumber = 0)
virtualinherited

Enable/disable capturing.

◆ stopCapture()

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

Return false if stopping an already stopped capture process.

◆ unreference()

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.

Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().

◆ unreference_nodelete()

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.

◆ ValidateCast()

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

◆ writeImage()

virtual void agxOSG::ImageCapture::writeImage ( osg::Image *  image,
agx::Index  index 
)
virtual

Member Data Documentation

◆ m_observers

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

◆ m_refCount

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: