AGX Dynamics  2.38.0.2
TerrainJournalRecorder.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 #pragma once
18 
19 #include <agxTerrain/Terrain.h>
20 #include <agx/Journal.h>
22 
23 namespace agxTerrain
24 {
25 
36  {
37  public:
42  static TerrainJournalRecorder* find( const agxTerrain::Terrain* terrain, const agxSDK::Simulation* simulation );
43 
47  static size_t addTerrainJournalRecorders( agxSDK::Simulation* simulation );
48 
49  public:
55 
60  virtual void preCollide( const agx::TimeStamp& time ) override;
61 
66  virtual void pre( const agx::TimeStamp& time ) override;
67 
72  virtual void post( const agx::TimeStamp& time ) override;
73 
75  virtual void addNotification() override;
76 
78  agxTerrain::Terrain* getTerrain();
79 
81 
82  protected:
83 
84  bool heigthBufferIsValid();
85 
86  void storeHeights();
87 
88  void storeChangedVertices();
89 
90  void restoreHeights();
91 
92  void initHeightFieldStorage();
93 
94  void createJournalBindings( agx::Journal* journal );
95 
96  void journalAttachedCallback( agxSDK::Simulation* simulation, agx::Journal* journal );
97 
98  agxData::Buffer* getHeightBuffer();
99 
100  virtual ~TerrainJournalRecorder();
101 
102  private:
104 
106  // Variables
108  protected:
116  };
117 }
agx::Journal
Definition: Journal.h:46
agxTerrain::Terrain
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition: Terrain.h:85
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
agxTerrain
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:58
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< Real >
agx::observer_ptr< Journal >
agx::ref_ptr< Terrain >
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:125
Journal.h
agxData::Buffer
Abstract representation of a data buffer.
Definition: Buffer.h:55
agxTerrain::TerrainJournalRecorder::m_journal
agx::JournalObserver m_journal
Definition: TerrainJournalRecorder.h:115
agxTerrain::TerrainJournalRecorder::m_dataRoot
agx::ComponentRef m_dataRoot
Definition: TerrainJournalRecorder.h:113
agxTerrain::TerrainJournalRecorder::m_journalAttachedCallback
agxSDK::Simulation::JournalAttachEvent::CallbackType m_journalAttachedCallback
Definition: TerrainJournalRecorder.h:109
agxTerrain::TerrainJournalRecorder::m_heigthBuffer
agxData::BufferRef m_heigthBuffer
Definition: TerrainJournalRecorder.h:112
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
AGXTERRAIN_EXPORT
#define AGXTERRAIN_EXPORT
Definition: agxTerrain/export.h:41
agxTerrain::TerrainJournalRecorder::m_dataRootUUID
agx::Uuid m_dataRootUUID
Definition: TerrainJournalRecorder.h:114
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxTerrain::TerrainJournalRecorder::m_terrain
agxTerrain::TerrainRef m_terrain
Definition: TerrainJournalRecorder.h:110
agxTerrain::TerrainJournalRecorder
Definition: TerrainJournalRecorder.h:35
Terrain.h
agx::Uuid
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Definition: Uuid.h:41
agx::Callback2
Templated callback with two arguments.
Definition: Callback.h:139
agxTerrain::TerrainJournalRecorder::m_heightIndices
agx::RealVector m_heightIndices
Definition: TerrainJournalRecorder.h:111