AGX Dynamics  2.37.3.2
Operation.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 
18 
20 
21 
22 #ifndef AGXCONTROL_OPERATION_H
23 #define AGXCONTROL_OPERATION_H
24 
25 
26 #include <agx/config.h>
27 
28 #include <agx/Referenced.h>
29 #include <agxStream/Serializable.h>
30 
31 #include <agxControl/Action.h>
33 
34 
35 namespace agxSDK
36 {
37  class Simulation;
38 }
39 
40 namespace agxControl
41 {
42 
43  class Action;
44  class ActionManager;
45  class ActionImplementation;
46  class CallbackActionImplementation;
47  template<typename T> class Callback1ActionImplementation;
48  template<typename R, typename T> class CallbackR1ActionImplementation;
49  template<typename T1, typename T2> class Callback2ActionImplementation;
50 
51  AGX_DECLARE_POINTER_TYPES(Operation);
52 
82  class AGXPHYSICS_EXPORT Operation : public agx::Referenced, public agxStream::Serializable
83  {
84  public:
85 
86  Operation(agxControl::Action* begin, agxControl::Action* end);
87 
88  virtual void activate(agx::Real time);
89  virtual void update(agx::Real time);
90  virtual void deactivate(agx::Real time);
91 
92  agx::Real getBeginTime() const;
93  agx::Real getEndTime() const;
94 
95  agxControl::Action* getBeginAction();
96  const agxControl::Action* getBeginAction() const;
97  agxControl::Action* getEndAction();
98  const agxControl::Action* getEndAction() const;
99 
100  const agxSDK::Simulation* getSimulation() const;
101 
102 
103  AGXSTREAM_DECLARE_SERIALIZABLE(agxControl::Operation);
105  Operation();
106 
107  private:
108  friend class agxSDK::Simulation;
109  friend class agxControl::ActionManager;
110  void setSimulation(agxSDK::Simulation* simulation);
111 
112  private:
113  agx::ref_ptr<agxControl::Action> m_beginAction;
116  agxSDK::Simulation* m_simulation;
117  };
118 
119 
120 
121 
122 }
123 
124 // Include guard.
125 #endif
126 
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Base class providing referencing counted objects.
Definition: Referenced.h:119
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
LinearProbingHashSetImplementation< KeyT, HashT >::iterator begin(LinearProbingHashSetImplementation< KeyT, HashT > &set)
This namespace contains general operation and action classes which can be used to control a agxSDK::S...
#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
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
double Real
Definition: Real.h:42
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30