AGXDynamics  2.31.1.0
Interaction.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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_INTERACTION_H
18 #define AGX_INTERACTION_H
19 
20 #include <agxSDK/SimulationProxy.h>
21 
22 namespace agx
23 {
24  class DynamicsSystem;
26 
31  {
32  public:
36  Interaction();
37 
42  void setName( const agx::Name& name );
43 
47  const agx::Name& getName() const;
48 
53  void setPropertyContainer( agx::PropertyContainer* propertyContainer );
54 
58  agx::PropertyContainer* getPropertyContainer();
59 
63  const agx::PropertyContainer* getPropertyContainer() const;
64 
68  agx::Bool hasPropertyContainer() const;
69 
73  agxSDK::SimulationProxy* getSimulationProxy() const;
74 
75  public:
85  virtual void updateForce(agx::DynamicsSystem* dynamicsSystem);
86 
87 #ifndef SWIG
88 
91  virtual void preSystemCallback( agx::DynamicsSystem* /*dynamicsSystem*/ ) {}
95  virtual void postSystemCallback( agx::DynamicsSystem* /*dynamicsSystem*/ ) {}
96 #endif
97 
99 
100  protected:
104  virtual ~Interaction() {}
105 
109  virtual void addNotification();
110 
114  virtual void removeNotification();
115 
116  friend class agxSDK::Simulation;
120  virtual void setSimulation( agxSDK::Simulation* simulation );
121 
122  private:
123  mutable PropertyContainerRef m_propertyContainer;
124  Name m_name;
125  agxSDK::SimulationProxyRef m_simulationProxy;
126  };
127 
128  inline void Interaction::updateForce(agx::DynamicsSystem* /*dynamicsSystem*/) {}
129 
130 }
131 
132 #endif
bool Bool
Definition: Integer.h:48
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
Representation of a name string.
Definition: Name.h:32
Base class providing referencing counted objects.
Definition: Referenced.h:113
The base class for interactions.
Definition: Interaction.h:30
virtual ~Interaction()
Reference counted object, protected destructor.
Definition: Interaction.h:104
Class that is a container of named properties.
Definition: Property.h:158
Namespace agx contains the dynamics/math part of the AGX Dynamics API.
virtual void postSystemCallback(agx::DynamicsSystem *)
Called after all post step events, after solve.
Definition: Interaction.h:95
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:206
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:91
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:121
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:128
Interface class used by internal objects running in parallel.