AGX Dynamics  2.37.2.0
Interaction.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 <agxSDK/SimulationProxy.h>
20 
21 namespace agx
22 {
23  class DynamicsSystem;
26 
27 
32  {
33  public:
37  Interaction();
38 
43  void setName( const agx::Name& name );
44 
48  const agx::Name& getName() const;
49 
54  void setPropertyContainer( agx::PropertyContainer* propertyContainer );
55 
59  agx::PropertyContainer* getPropertyContainer();
60 
64  const agx::PropertyContainer* getPropertyContainer() const;
65 
69  agx::Bool hasPropertyContainer() const;
70 
74  agxSDK::SimulationProxy* getSimulationProxy() const;
75 
76  public:
86  virtual void updateForce(agx::DynamicsSystem* dynamicsSystem);
87 
88 #ifndef SWIG
89 
92  virtual void preSystemCallback( agx::DynamicsSystem* /*dynamicsSystem*/ ) {}
96  virtual void postSystemCallback( agx::DynamicsSystem* /*dynamicsSystem*/ ) {}
97 #endif
98 
100 
101  protected:
105  virtual ~Interaction() {}
106 
110  virtual void addNotification();
111 
115  virtual void removeNotification();
116 
117  friend class agxSDK::Simulation;
121  virtual void setSimulation( agxSDK::Simulation* simulation );
122 
123  private:
124  mutable PropertyContainerRef m_propertyContainer;
125  Name m_name;
126  agxSDK::SimulationProxyRef m_simulationProxy;
127  };
128 
129  inline void Interaction::updateForce(agx::DynamicsSystem* /*dynamicsSystem*/) {}
130 
131 }
bool Bool
Definition: Integer.h:48
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Representation of a name string.
Definition: Name.h:32
Base class providing referencing counted objects.
Definition: Referenced.h:119
The base class for interactions.
Definition: Interaction.h:31
virtual ~Interaction()
Reference counted object, protected destructor.
Definition: Interaction.h:105
Class that is a container of named properties.
Definition: Property.h:158
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::SetVector< InteractionRef > InteractionRefSetVector
virtual void postSystemCallback(agx::DynamicsSystem *)
Called after all post step events, after solve.
Definition: Interaction.h:96
The complete physical system with bodies, interactions, data layout, time stepper, and solver.
#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
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
virtual void preSystemCallback(agx::DynamicsSystem *)
Called after all pre step events, before solve.
Definition: Interaction.h:92
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
virtual void updateForce(agx::DynamicsSystem *dynamicsSystem)
This virtual method is implemented so that it computes the interaction forces on all the physical bod...
Definition: Interaction.h:129
Interface class used by internal objects running in parallel.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: SetVector.h:37