AGX Dynamics  2.35.0.1
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 
73 
75 
77 
79 
81 
84 
85  protected:
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
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXOSG_EXPORT
Triangle mesh for geometric intersection tests.
Definition: Trimesh.h:43
agx::HashTable< const agxCollide::Trimesh *, std::pair< agxCollide::TrimeshConstObserver, agxOSG::PressureAtlasRef > > MeshToAtlasTable
PressureAtlasManager(agxSDK::Simulation *simulation, agx::Real defaultTexelsPerMeter)
agxSDK::Simulation * getSimulation() const
const MeshToAtlasTable & getAtlases()
agxOSG::PressureAtlas * registerMesh(const agxCollide::Trimesh *mesh, agx::Real texelsPerMeter=agx::Real(-1.0))
Create a pressure atlas for a mesh.
agxOSG::PressureAtlas * getAtlas(const agxCollide::Trimesh *mesh)
void createContactPressureGenerator(const agxCollide::Trimesh *mesh)
void createConstraintPressureGenerator(const agxCollide::Trimesh *mesh, const agx::Constraint *constraint)
Not implemented.
A pressure map for a single trimesh.
Definition: PressureAtlas.h:44
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.
The base class for a constraint.
Definition: Constraint.h:89
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::Object is a refcounted object with a name.
Definition: Object.h:60
This namespace consists of a set of classes for handling geometric intersection tests including boole...
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
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