AGXDynamics  2.35.0.2
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:
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 }
agx::Interaction::updateForce
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
SimulationProxy.h
agxStream::Serializable
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agx::PropertyContainer
Class that is a container of named properties.
Definition: Property.h:128
agx::Interaction::postSystemCallback
virtual void postSystemCallback(agx::DynamicsSystem *)
Called after all post step events, after solve.
Definition: Interaction.h:96
agx::ref_ptr< PropertyContainer >
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agx::SetVector
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: SetVector.h:37
agx::InteractionRefSetVector
agx::SetVector< InteractionRef > InteractionRefSetVector
Definition: DynamicsSystem.h:48
agx::Name
Representation of a name string.
Definition: Name.h:32
agx::Interaction::~Interaction
virtual ~Interaction()
Reference counted object, protected destructor.
Definition: Interaction.h:105
agx::Interaction
The base class for interactions.
Definition: Interaction.h:31
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agx::Bool
bool Bool
Definition: Integer.h:48
agx::DynamicsSystem
The complete physical system with bodies, interactions, data layout, time stepper,...
Definition: DynamicsSystem.h:65
agxSDK::SimulationProxy
Interface class used by internal objects running in parallel.
Definition: SimulationProxy.h:49
agx::Interaction::preSystemCallback
virtual void preSystemCallback(agx::DynamicsSystem *)
Called after all pre step events, before solve.
Definition: Interaction.h:92