AGXDynamics  2.35.0.3
JournalCustomDataRecorder.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 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
agx::Journal
Definition: Journal.h:46
agx::Real
double Real
Definition: Real.h:42
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
agx::JournalCustomDataRecorder::m_journal
agx::Journal * m_journal
Definition: JournalCustomDataRecorder.h:117
Simulation.h
agx::JournalCustomDataRecorder::m_dataRoot
agx::ComponentRef m_dataRoot
Definition: JournalCustomDataRecorder.h:115
StepEventListener.h
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agx::VectorPOD
Vector containing 'raw' data.
Definition: Vector.h:245
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
AGX_DECLARE_VECTOR_TYPES
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34
agx::ref_ptr< Component >
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agx::JournalCustomDataRecorder::m_dataNodeName
agx::Name m_dataNodeName
Definition: JournalCustomDataRecorder.h:116
agx::LinearProbingHashTable
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition: LinearProbingHashTable.h:871
agx::JournalCustomDataRecorder
Definition: JournalCustomDataRecorder.h:31
agx::Name
Representation of a name string.
Definition: Name.h:32
agx.h
Uuid.h
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agx::AgXString< std::string >
agx::JournalCustomDataRecorder::m_journalAttachedCallback
agxSDK::Simulation::JournalAttachEvent::CallbackType m_journalAttachedCallback
Definition: JournalCustomDataRecorder.h:113
agx::Callback2
Templated callback with two arguments.
Definition: Callback.h:139
agx::JournalCustomDataRecorder::m_valueTable
agx::HashTable< agx::Name, agxData::ValueRef > m_valueTable
Definition: JournalCustomDataRecorder.h:114