AGX Dynamics  2.37.3.2
JournalCustomDataRecorder.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 AGX_JOURNAL_CUSTOM_DATA_RECORDER_H
18 #define AGX_JOURNAL_CUSTOM_DATA_RECORDER_H
19 
20 #include <agx/agx.h>
22 #include <agxSDK/Simulation.h>
23 #include <agx/Uuid.h>
24 
25 namespace agx
26 {
27  class Journal;
28 
32  {
33  public:
38  JournalCustomDataRecorder(const agx::Name& dataNodeName);
39 
44  virtual void preCollide(const agx::TimeStamp& time) override;
45 
50  virtual void pre(const agx::TimeStamp& time) override;
51 
56  virtual void post(const agx::TimeStamp& time) override;
57 
61  virtual void addNotification() override;
62 
69  void addCustomValueReal(const agx::String& name, agx::Real initialValue);
70 
77  agx::Real getCustomValueReal(const agx::String& name) const;
78 
86  bool setCustomValueReal(const agx::String& name, agx::Real val) const;
87 
93  static bool extractJournalCustomDataRecorders(agx::JournalCustomDataRecorderPtrVector& recorders, agxSDK::Simulation* simulation);
94 
96 
97  protected:
98  void initStorageBuffer();
99 
100  void createJournalBindings(agx::Journal* journal);
101 
102  void journalAttachedCallback(agxSDK::Simulation*, agx::Journal*);
103 
104  virtual ~JournalCustomDataRecorder();
105 
106  private:
108 
110  // Variables
112  protected:
118  };
119 }
120 
121 
122 
123 
124 #endif
Derive from this class to implement a listener for simulation step events.
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Representation of a name string.
Definition: Name.h:32
agx::Real TimeStamp
Definition: TimeStamp.h:26
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agxSDK::Simulation::JournalAttachEvent::CallbackType m_journalAttachedCallback
Templated callback with two arguments.
Definition: Callback.h:139
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
double Real
Definition: Real.h:42
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::HashTable< agx::Name, agxData::ValueRef > m_valueTable