AGXDynamics  2.35.0.2
StepEventListener.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/agxSDK.h>
20 
21 #include <agxSDK/EventListener.h>
22 #include <agx/TimeStamp.h>
23 
24 namespace agxSDK
25 {
38  {
39  public:
40 
43  STEP_NONE = 0x0,
44  PRE_COLLIDE = 0x1,
45  PRE_STEP = 0x2,
46  POST_STEP = 0x4,
47  LAST_STEP = 0x8,
48  DEFAULT = PRE_STEP | POST_STEP,
49  ALL = PRE_COLLIDE | PRE_STEP | POST_STEP | LAST_STEP
50  };
51 
53  StepEventListener( int mask = DEFAULT );
54 
59  virtual void setMask(int mask) override;
60 
61 
62  // ================ Override these three methods to catch events
68  virtual void preCollide(const agx::TimeStamp& time);
69 
75  virtual void pre(const agx::TimeStamp& time);
76 
82  virtual void post(const agx::TimeStamp& time);
83 
90  virtual void last(const agx::TimeStamp& time);
91 
92 #ifndef SWIG
94 #endif
95 
96  protected:
97 
98 
100  virtual ~StepEventListener();
101  };
102 
103 
104 
105  inline void StepEventListener::preCollide(const agx::TimeStamp& /*time*/) { }
106  inline void StepEventListener::pre(const agx::TimeStamp& /*time*/) { }
107  inline void StepEventListener::post(const agx::TimeStamp& /*time*/) { }
108  inline void StepEventListener::last(const agx::TimeStamp& /*time*/) { }
109 
110 
111 }
agxSDK::StepEventListener::pre
virtual void pre(const agx::TimeStamp &time)
Called before a step is taken in the simulation Implement this method in the derived class to get cal...
Definition: StepEventListener.h:106
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
EventListener.h
agxSDK::StepEventListener::ActivationMask
ActivationMask
Defines the event states for which a listener will be activated, a mask can be bitwise OR:ed from the...
Definition: StepEventListener.h:42
agxSDK::EventListener
An EventListener can be associated to a Simulation and triggered upon various events.
Definition: EventListener.h:40
agxSDK::StepEventListener::post
virtual void post(const agx::TimeStamp &time)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
Definition: StepEventListener.h:107
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
agxSDK::StepEventListener::last
virtual void last(const agx::TimeStamp &time)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
Definition: StepEventListener.h:108
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
AGX_DECLARE_VECTOR_TYPES
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
TimeStamp.h
agxSDK::StepEventListener::preCollide
virtual void preCollide(const agx::TimeStamp &time)
Called before collision detection is performed in the simulation Implement this method in the derived...
Definition: StepEventListener.h:105
agxSDK.h