AGXDynamics  2.35.0.3
PressureAtlasManager.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, is 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 AGXOSG_PRESSURE_ATLAS_MANAGER_H
18 #define AGXOSG_PRESSURE_ATLAS_MANAGER_H
19 
20 #include <agx/HashTable.h>
21 #include <agx/Object.h>
22 
24 #include <agxSDK/Simulation.h>
25 
26 #include <agxOSG/export.h>
27 #include <agxOSG/PressureAtlas.h>
28 
29 namespace agx
30 {
31  class Constraint;
32 }
33 
34 namespace agxCollide
35 {
36  class Trimesh;
37 }
38 
39 namespace agxSDK
40 {
41  class Simulation;
42 }
43 
44 namespace agxOSG
45 {
46 
49  {
50  public:
52 
53  public:
54  PressureAtlasManager(agxSDK::Simulation* simulation, agx::Real defaultTexelsPerMeter);
55 
72  agxOSG::PressureAtlas* registerMesh(const agxCollide::Trimesh* mesh, agx::Real texelsPerMeter = agx::Real(-1.0));
73 
74  agxOSG::PressureAtlas* getAtlas(const agxCollide::Trimesh* mesh);
75 
76  const MeshToAtlasTable& getAtlases();
77 
78  void createContactPressureGenerator(const agxCollide::Trimesh* mesh);
79 
80  agxSDK::Simulation* getSimulation() const;
81 
83  void createConstraintPressureGenerator(const agxCollide::Trimesh* mesh, const agx::Constraint* constraint);
84 
85  protected:
86  virtual ~PressureAtlasManager();
87 
88 
89  private:
90  AGX_DECLARE_POINTER_TYPES(AtlasCommitter);
91  class AtlasCommitter : public agxSDK::StepEventListener
92  {
93  public:
94  AtlasCommitter(PressureAtlasManager* master);
95  virtual void post(const agx::TimeStamp& time);
96 
97  protected:
98  virtual ~AtlasCommitter() {}
99 
100  private:
101  PressureAtlasManager* m_master;
102  };
103 
104 
105  friend class AtlasCommitter;
106  void commitPressures();
107  AtlasCommitterRef m_committer;
108 
109  private:
110  MeshToAtlasTable m_meshes;
111  agxSDK::SimulationObserver m_simulation;
112  agx::Real m_defaultTexelsPerMeter;
113  };
114 
115 }
116 
117 
118 #endif
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
PressureAtlas.h
Simulation.h
HashTable.h
agxOSG::PressureAtlasManager::MeshToAtlasTable
agx::HashTable< const agxCollide::Trimesh *, std::pair< agxCollide::TrimeshConstObserver, agxOSG::PressureAtlasRef > > MeshToAtlasTable
Definition: PressureAtlasManager.h:51
agxOSG::PressureAtlasManager
Definition: PressureAtlasManager.h:48
StepEventListener.h
agx::observer_ptr< Simulation >
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agxOSG::PressureAtlas
A pressure map for a single trimesh.
Definition: PressureAtlas.h:43
agx::ref_ptr< AtlasCommitter >
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agx::LinearProbingHashTable
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition: LinearProbingHashTable.h:871
Object.h
agx::Object
agx::Object is a refcounted object with a name.
Definition: Object.h:59
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agx::Constraint
The base class for a constraint.
Definition: Constraint.h:88
export.h
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agxCollide::Trimesh
Triangle mesh for geometric intersection tests.
Definition: Trimesh.h:42
AGXOSG_EXPORT
#define AGXOSG_EXPORT