AGX Dynamics  2.35.0.1
Interaction.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, 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:
38 
43  void setName( const agx::Name& name );
44 
48  const agx::Name& getName() const;
49 
54  void setPropertyContainer( agx::PropertyContainer* propertyContainer );
55 
60 
65 
70 
75 
76  public:
86  virtual void updateForce(agx::DynamicsSystem* dynamicsSystem);
87 
88 #ifndef SWIG
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 }
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
#define AGXPHYSICS_EXPORT
Interface class used by internal objects running in parallel.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:45
The complete physical system with bodies, interactions, data layout, time stepper,...
The base class for interactions.
Definition: Interaction.h:32
const agx::Name & getName() const
agxSDK::SimulationProxy * getSimulationProxy() const
void setName(const agx::Name &name)
Name this interaction.
virtual ~Interaction()
Reference counted object, protected destructor.
Definition: Interaction.h:105
void setPropertyContainer(agx::PropertyContainer *propertyContainer)
Assign a new property container.
agx::PropertyContainer * getPropertyContainer()
virtual void setSimulation(agxSDK::Simulation *simulation)
Assign simulation.
agx::Bool hasPropertyContainer() const
const agx::PropertyContainer * getPropertyContainer() const
Interaction()
Default constructor.
virtual void removeNotification()
Called when removed from a simulation.
virtual void preSystemCallback(agx::DynamicsSystem *)
Called after all pre step events, before solve.
Definition: Interaction.h:92
virtual void postSystemCallback(agx::DynamicsSystem *)
Called after all post step events, after solve.
Definition: Interaction.h:96
virtual void addNotification()
Called when added to a simulation.
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
Representation of a name string.
Definition: Name.h:33
Class that is a container of named properties.
Definition: Property.h:129
Base class providing referencing counted objects.
Definition: Referenced.h:114
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: SetVector.h:38
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:48
agx::SetVector< InteractionRef > InteractionRefSetVector