AGX Dynamics  2.35.0.1
BodyCaptureDeterminism.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXUNIT_BODYCAPTUREDETERMINISM_H
18 #define AGXUNIT_BODYCAPTUREDETERMINISM_H
19 
20 #include <agx/agxPhysics_export.h>
21 
23 #include <agx/RigidBody.h>
24 #include <fstream>
25 namespace agxUnit
26 {
27 
28 
31 {
32 public:
33 
34  struct Session : public agx::Referenced
35  {
39  };
40 
42  void setRigidBody( agx::RigidBody *body) { m_body=body; newSession(); }
43 
44  void post(const agx::TimeStamp& t);
45  void capture(const agx::TimeStamp& t);
46 
48 
49  void newSession() { m_sessions.push_back( new Session ); }
50  void writeLine( Session *session, size_t i );
51 
52  void calcDiff( Session *s0, Session *s1, size_t i, agx::Real data[9] );
53 
55 
56 protected:
59 
61  std::ofstream m_stream;
64 };
65 
66 }
67 
68 #endif
69 
#define AGXPHYSICS_EXPORT
Derive from this class to implement a listener for simulation step events.
Class for capturing data for measuring determinism.
void capture(const agx::TimeStamp &t)
BodyCaptureDeterminism(const agx::String &file)
void removeNotification()
Called when this listener is removed from the simulation.
void calcDiff(Session *s0, Session *s1, size_t i, agx::Real data[9])
agx::observer_ptr< agx::RigidBody > m_body
void setRigidBody(agx::RigidBody *body)
agx::Vector< agx::ref_ptr< Session > > SessionVector
void writeLine(Session *session, size_t i)
void post(const agx::TimeStamp &t)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
Base class providing referencing counted objects.
Definition: Referenced.h:114
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
Templated vector class.
Definition: agx/Vector.h:53
double Real
Definition: Real.h:42
agx::Real TimeStamp
Definition: TimeStamp.h:26