AGX Dynamics  2.35.0.1
agxSDK::StatisticsListenerData< T > Class Template Reference

Class for storing min/max values together with a ID for the associated RigidBody/Geometry. More...

#include <SimulationStatisticsListener.h>

Public Member Functions

 StatisticsListenerData (StatisticsData *parent, const agx::String &id)
 
T compareAndStoreMax (agx::Real time, T val, const agx::RigidBody *b1=nullptr, const agx::RigidBody *b2=nullptr)
 will compare val with the previous value and store time, value, and bodies if val is larger than the previous More...
 
T compareAndStoreMax (agx::Real time, T val, const agxCollide::Geometry *geom1, const agxCollide::Geometry *geom2=nullptr)
 will compare val with the previous value and store time, value, and geometries if val is larger than the previous More...
 
T compareAndStoreMin (agx::Real time, T val, const agx::RigidBody *b1, const agx::RigidBody *b2=nullptr)
 will compare val with the previous value and store time, value, and bodies if val is lower than the previous More...
 
T compareAndStoreMin (agx::Real time, T val, const agxCollide::Geometry *geom1, const agxCollide::Geometry *geom2=nullptr)
 will compare val with the previous value and store time, value, and geometries if val is lower than the previous More...
 
T get () const
 
agx::UInt64 getBody1 () const
 
agx::UInt64 getBody2 () const
 
agx::UInt64 getGeometry1 () const
 
agx::UInt64 getGeometry2 () const
 
agx::Real getTime () const
 
void inc ()
 Increment by one. More...
 
void reset (T val=0)
 reset the value to the given value More...
 
void restore (agxStream::InputArchive &in)
 Serialization restore. More...
 
void set (agx::Real time, T val)
 Set the value explicitly without comparison including the time. More...
 
void set (T val)
 Set the value explicitly without comparison. More...
 
void store (agxStream::OutputArchive &out) const
 Serialization store. More...
 

Detailed Description

template<typename T>
class agxSDK::StatisticsListenerData< T >

Class for storing min/max values together with a ID for the associated RigidBody/Geometry.

Definition at line 42 of file SimulationStatisticsListener.h.

Constructor & Destructor Documentation

◆ StatisticsListenerData()

template<typename T >
agxSDK::StatisticsListenerData< T >::StatisticsListenerData ( StatisticsData *  parent,
const agx::String &  id 
)

Definition at line 291 of file SimulationStatisticsListener.h.

Member Function Documentation

◆ compareAndStoreMax() [1/2]

template<typename T >
T agxSDK::StatisticsListenerData< T >::compareAndStoreMax ( agx::Real  time,
T  val,
const agx::RigidBody *  b1 = nullptr,
const agx::RigidBody *  b2 = nullptr 
)

will compare val with the previous value and store time, value, and bodies if val is larger than the previous

◆ compareAndStoreMax() [2/2]

template<typename T >
T agxSDK::StatisticsListenerData< T >::compareAndStoreMax ( agx::Real  time,
T  val,
const agxCollide::Geometry *  geom1,
const agxCollide::Geometry *  geom2 = nullptr 
)

will compare val with the previous value and store time, value, and geometries if val is larger than the previous

◆ compareAndStoreMin() [1/2]

template<typename T >
T agxSDK::StatisticsListenerData< T >::compareAndStoreMin ( agx::Real  time,
T  val,
const agx::RigidBody *  b1,
const agx::RigidBody *  b2 = nullptr 
)

will compare val with the previous value and store time, value, and bodies if val is lower than the previous

◆ compareAndStoreMin() [2/2]

template<typename T >
T agxSDK::StatisticsListenerData< T >::compareAndStoreMin ( agx::Real  time,
T  val,
const agxCollide::Geometry *  geom1,
const agxCollide::Geometry *  geom2 = nullptr 
)

will compare val with the previous value and store time, value, and geometries if val is lower than the previous

◆ get()

template<typename T >
T agxSDK::StatisticsListenerData< T >::get
Returns
the stored value

Definition at line 334 of file SimulationStatisticsListener.h.

◆ getBody1()

template<typename T >
agx::UInt64 agxSDK::StatisticsListenerData< T >::getBody1
Returns
an ID of the first rigid body involved in the event, InvalidIndex if none.

Definition at line 327 of file SimulationStatisticsListener.h.

◆ getBody2()

template<typename T >
agx::UInt64 agxSDK::StatisticsListenerData< T >::getBody2
Returns
an ID of the second rigid body involved in the event, InvalidIndex if none.

Definition at line 329 of file SimulationStatisticsListener.h.

◆ getGeometry1()

template<typename T >
agx::UInt64 agxSDK::StatisticsListenerData< T >::getGeometry1
Returns
an ID of the first geometry involved in the event, InvalidIndex if none.

Definition at line 323 of file SimulationStatisticsListener.h.

◆ getGeometry2()

template<typename T >
agx::UInt64 agxSDK::StatisticsListenerData< T >::getGeometry2
Returns
an ID of the second geometry involved in the event, InvalidIndex if none.

Definition at line 325 of file SimulationStatisticsListener.h.

◆ getTime()

template<typename T >
agx::Real agxSDK::StatisticsListenerData< T >::getTime
Returns
time of the event

Definition at line 320 of file SimulationStatisticsListener.h.

◆ inc()

template<typename T >
void agxSDK::StatisticsListenerData< T >::inc

Increment by one.

Definition at line 340 of file SimulationStatisticsListener.h.

◆ reset()

template<typename T >
void agxSDK::StatisticsListenerData< T >::reset ( T  val = 0)

reset the value to the given value

Definition at line 356 of file SimulationStatisticsListener.h.

References agx::InvalidIndex.

◆ restore()

template<typename T >
void agxSDK::StatisticsListenerData< T >::restore ( agxStream::InputArchive &  in)

Serialization restore.

◆ set() [1/2]

template<typename T >
void agxSDK::StatisticsListenerData< T >::set ( agx::Real  time,
T  val 
)

Set the value explicitly without comparison including the time.

Definition at line 350 of file SimulationStatisticsListener.h.

◆ set() [2/2]

template<typename T >
void agxSDK::StatisticsListenerData< T >::set ( T  val)

Set the value explicitly without comparison.

Definition at line 345 of file SimulationStatisticsListener.h.

◆ store()

template<typename T >
void agxSDK::StatisticsListenerData< T >::store ( agxStream::OutputArchive &  out) const

Serialization store.


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