AGX Dynamics  2.37.2.0
BodyCaptureDeterminism.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 
41  BodyCaptureDeterminism(const agx::String &file );
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 
47  void removeNotification();
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 
54  agx::Real getError();
55 
56 protected:
58  SessionVector m_sessions;
59 
61  std::ofstream m_stream;
64 };
65 
66 }
67 
68 #endif
69 
Derive from this class to implement a listener for simulation step events.
#define AGXPHYSICS_EXPORT
agx::Real TimeStamp
Definition: TimeStamp.h:26
Class for capturing data for measuring determinism.
Base class providing referencing counted objects.
Definition: Referenced.h:119
Templated vector class.
Definition: Vector.h:52
agx::Vector< agx::ref_ptr< Session > > SessionVector
agx::observer_ptr< agx::RigidBody > m_body
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
void setRigidBody(agx::RigidBody *body)
double Real
Definition: Real.h:42