AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
EventListener.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXSDK_EVENTLISTENER_H
18#define AGXSDK_EVENTLISTENER_H
19
20#include <agxSDK/agxSDK.h>
21#include <agx/Component.h>
22
24#include <agx/SetVector.h>
25
26namespace agxSDK
27{
28
29 class Simulation;
30
34
35
41 {
42 public:
43
51
56 virtual void setMask(int f);
57
59 int getMask() const;
60
65 void setEnable( bool enable );
66
70 bool isEnabled( ) const;
71
76
80 const Simulation* getSimulation() const;
81
86 virtual void addNotification() {}
87
91 virtual void removeNotification() {}
92
94 Type getType() const;
95
98
99#ifndef SWIG
101#endif
102
103 private:
105 void setPriority( agx::UInt32 priority );
106
107 protected:
112 EventListener( Type type = UNDEFINED_TYPE );
113
114
115 friend class Simulation;
116 friend class EventManager;
117
119 void setSimulation( Simulation* simulation );
120
122 virtual ~EventListener();
123
125
129 private:
130
131 Simulation* m_simulation;
132 };
133
134}
135
136#endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
An EventListener can be associated to a Simulation and triggered upon various events.
Type
Type of EventListener.
@ CONTACT_EVENT_LISTENER
Of type ContactEventListener.
@ UNDEFINED_TYPE
Undefined type.
@ STEP_EVENT_LISTENER
Of type StepEventListener.
void setEnable(bool enable)
Specify whether the listener should react at all at events.
virtual void addNotification()
Called when this listener is added to the simulation.
const Simulation * getSimulation() const
virtual void setMask(int f)
Specifies a bit mask which determines which event types that will activate this listener.
EventListener(Type type=UNDEFINED_TYPE)
Default constructor.
virtual void removeNotification()
Called when this listener is removed from the simulation.
Simulation * getSimulation()
virtual ~EventListener()
Destructor.
Type getType() const
void setSimulation(Simulation *simulation)
Set the associated simulation for this EventListener.
bool isEnabled() const
agx::UInt32 getPriority() const
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition Simulation.h:126
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
A component is an object containing other objects, enabling hierarchical structuring.
Definition Component.h:39
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition SetVector.h:38
Templated vector class.
Definition agx/Vector.h:53
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition Constraint.h:31
agx::SetVector< agx::ref_ptr< agxSDK::EventListener > > EventListenerRefSetVector
agx::Vector< EventListener * > EventListenerPtrVector
uint32_t UInt32
Definition Integer.h:32