 |
AGXDynamics
2.35.0.2
|
Go to the documentation of this file.
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::UInt64 getBody2() const
UInt32StatisticsListenerData totalNumContacts
void store(agxStream::OutputArchive &out) const
Serialization store.
agx::ref_ptr< StatisticsData > StatisticsDataRef
agxSDK::Simulation * getSimulation()
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...
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::Real getTime() const
The rigid body class, combining a geometric model and a frame of reference.
agx::UInt32 m_numTimeSteps
UInt32StatisticsListenerData numTriangles
RealStatisticsListenerData minFeature
UInt32StatisticsListenerData numShapes
StatisticsListenerData< agx::UInt32 > UInt32StatisticsListenerData
StatisticsDataRef m_statisticsData
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
StatisticsListenerData< agx::Real > RealStatisticsListenerData
agx::ref_ptr< SimulationStatisticsListener > SimulationStatisticsListenerRef
#define AGXPHYSICS_EXPORT
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 getGeometry1() const
agx::ComponentRef m_dataRoot
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
UInt32StatisticsListenerData numConstraints
RealStatisticsListenerData maxContactSpeedFeatureRatio
virtual void addObject(agx::Object *object, bool assignContext=true)
Add an object to the component.
RealStatisticsListenerData maxFeatureSpeed
StatisticsListenerData(StatisticsData *parent, const agx::String &id)
The geometry representation used by the collision detection engine.
RealStatisticsListenerData minContactFeature
RealStatisticsListenerData maxFeature
void set(T val)
Set the value explicitly without comparison.
Class for writing serialized data in binary format to a stream.
RealStatisticsListenerData maxAngularSpeed
A component is an object containing other objects, enabling hierarchical structuring.
AGXCORE_EXPORT Component * root()
RealStatisticsListenerData maxLinearSpeed
RealStatisticsListenerData maxContactSpeed
UInt32StatisticsListenerData maxNumContactsPerTimestep
Class for storing min/max values together with a ID for the associated RigidBody/Geometry.
Base class providing referencing counted objects.
RealStatisticsListenerData maxPenetrationDepth
Store all the various statistics of a simulation.
agx::observer_ptr< agxSDK::Simulation > m_simulation
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
void restore(agxStream::InputArchive &in)
Serialization restore.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
void reset(T val=0)
reset the value to the given value
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 ...
const AGXCORE_EXPORT InvalidIndexStruct InvalidIndex
RealStatisticsListenerData maxConstraintViolation
agx::UInt64 getGeometry2() const
agx::Component * getDataRoot()
UInt32StatisticsListenerData numContacts
This class will collect statistics and sizes of a simulation.
void inc()
Increment by one.
agx::UInt64 getBody1() const
UInt32StatisticsListenerData numBodies
virtual ~SimulationStatisticsListener()
Destructor.