AGX Dynamics  2.35.0.1
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 
78 
86  bool setCustomValueReal(const agx::String& name, agx::Real val) const;
87 
94 
96 
97  protected:
99 
101 
103 
105 
106  private:
108 
110  // Variables
112  protected:
118  };
119 }
120 
121 
122 
123 
124 #endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Derive from this class to implement a listener for simulation step events.
T CallbackType
Definition: Event.h:37
virtual void pre(const agx::TimeStamp &time) override
Called before a step is taken in the simulation.
void createJournalBindings(agx::Journal *journal)
virtual void preCollide(const agx::TimeStamp &time) override
Called before the collision detection step is taken in the simulation.
bool setCustomValueReal(const agx::String &name, agx::Real val) const
Set a custom real value to the simulation given a name identifier.
JournalCustomDataRecorder(const agx::Name &dataNodeName)
Standard constructor for the JournalCustomDataRecorder class.
agx::HashTable< agx::Name, agxData::ValueRef > m_valueTable
void journalAttachedCallback(agxSDK::Simulation *, agx::Journal *)
agx::Real getCustomValueReal(const agx::String &name) const
Gets a custom real value to the simulation given a name identifier.
static bool extractJournalCustomDataRecorders(agx::JournalCustomDataRecorderPtrVector &recorders, agxSDK::Simulation *simulation)
Extracts all JournalCustomDataRecorders from a simulation.
virtual void post(const agx::TimeStamp &time) override
Called after a step is taken in the simulation.
agxSDK::Simulation::JournalAttachEvent::CallbackType m_journalAttachedCallback
virtual void addNotification() override
Called when this object is added to a simulation.
void addCustomValueReal(const agx::String &name, agx::Real initialValue)
Gets a custom real value to the simulation given a name identifier.
Inheritance with partial specialization due to bug with ref_ptr containers.
Representation of a name string.
Definition: Name.h:33
Vector containing 'raw' data.
Definition: agx/Vector.h:246
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:42
agx::Real TimeStamp
Definition: TimeStamp.h:26