17 #ifndef AGXSDK_SIMULATIONSTATISTICSLISTENER_H
18 #define AGXSDK_SIMULATIONSTATISTICSLISTENER_H
89 void reset( T val=0 );
186 void collectSystemData(
agx::Real time = 0);
253 void updateContactData(
agx::Real time );
258 virtual void addNotification()
override;
259 virtual void removeNotification()
override;
264 bool calculateShapeFeatures(
269 bool calculateFeatures(
292 m_parent(parent), m_name(id)
304 m_group->addObject( m_value );
307 m_group->addObject( m_time );
310 m_group->addObject( body1 );
312 m_group->addObject( body2 );
314 m_group->addObject( geometry1 );
316 m_group->addObject( geometry2 );
335 return m_value->get();
341 m_value->set(m_value->get()+1);
agx::ref_ptr< StatisticsData > StatisticsDataRef
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
agx::UInt64 getBody2() const
RealStatisticsListenerData maxFeatureSpeed
Derive from this class to implement a listener for simulation Step events.
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
agx::UInt64 getGeometry2() const
A component is an object containing other objects, enabling hierarchical structuring.
Store all the various statistics of a simulation.
UInt32StatisticsListenerData numShapes
void reset(T val=0)
reset the value to the given value
agx::Component * getDataRoot()
RealStatisticsListenerData maxLinearSpeed
RealStatisticsListenerData maxContactSpeedFeatureRatio
StatisticsListenerData< agx::UInt32 > UInt32StatisticsListenerData
void set(T val)
Set the value explicitly without comparison.
#define AGXPHYSICS_EXPORT
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
UInt32StatisticsListenerData numContacts
StatisticsListenerData< agx::Real > RealStatisticsListenerData
StatisticsDataRef m_statisticsData
RealStatisticsListenerData maxConstraintViolation
UInt32StatisticsListenerData numConstraints
This class will collect statistics and sizes of a simulation.
Base class providing referencing counted objects.
agx::observer_ptr< agxSDK::Simulation > m_simulation
The geometry representation used by the collision detection engine.
RealStatisticsListenerData maxFeature
void inc()
Increment by one.
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 ...
void store(agxStream::OutputArchive &out) const
Serialization store.
agxSDK::Simulation * getSimulation()
RealStatisticsListenerData minContactFeature
agx::UInt64 getBody1() const
RealStatisticsListenerData maxContactSpeed
void restore(agxStream::InputArchive &in)
Serialization restore.
agx::ref_ptr< SimulationStatisticsListener > SimulationStatisticsListenerRef
RealStatisticsListenerData minFeature
UInt32StatisticsListenerData totalNumContacts
The rigid body class, combining a geometric model and a frame of reference.
RealStatisticsListenerData maxPenetrationDepth
virtual ~SimulationStatisticsListener()
Destructor.
agx::ComponentRef m_dataRoot
RealStatisticsListenerData maxAngularSpeed
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Class for writing serialized data in binary format to a stream.
UInt32StatisticsListenerData maxNumContactsPerTimestep
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
StatisticsListenerData(StatisticsData *parent, const agx::String &id)
agx::UInt64 getGeometry1() const
Class for storing min/max values together with a ID for the associated RigidBody/Geometry.
virtual void addObject(agx::Object *object, bool assignContext=true)
Add an object to the component.
UInt32StatisticsListenerData numBodies
UInt32StatisticsListenerData numTriangles
AGXCORE_EXPORT Component * root()
agx::UInt32 m_numTimeSteps
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 p...
agx::Real getTime() const