AGX Dynamics  2.37.2.0
WireParallelCallbacksHandler.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 #pragma once
18 
19 #include <agx/Referenced.h>
20 #include <agx/Task.h>
21 
23 
24 namespace agxSDK
25 {
26  class Simulation;
27 }
28 
29 namespace agxWire
30 {
31  class Wire;
32 
36  class AGXPHYSICS_EXPORT WireParallelCallbacksHandler : public agx::Referenced
37  {
38  public:
42  enum CallbackTypes
43  {
44  PRE_COLLIDE,
45  PRE,
46  POST,
47  COLLIDE,
48  COLLECT_SPLIT_INFO,
49  NUM_CALLBACKS
50  };
51 
52  public:
56  WireParallelCallbacksHandler( agxSDK::Simulation* simulation );
57 
61  virtual void reset( agxSDK::Simulation* simulation );
62 
66  virtual void execute( agxWire::WireParallelCallbacksHandler::CallbackTypes type, agxSDK::Simulation* simulation );
67 
73  void setExecuteSerial( agx::Bool executeSerial );
74 
79  agx::Bool getExecuteSerial() const;
81 
82  public:
83  typedef agx::Vector< agx::ref_ptr< agxWire::Wire > > WireContainer;
84 
85  protected:
86  virtual ~WireParallelCallbacksHandler() {}
87 
91  virtual void executeParallel( agxWire::WireParallelCallbacksHandler::CallbackTypes type, agxSDK::Simulation* simulation );
92 
96  virtual void executeSerial( agxWire::WireParallelCallbacksHandler::CallbackTypes type, agxSDK::Simulation* simulation );
97 
101  virtual void handleSimplified( agxWire::WireParallelCallbacksHandler::CallbackTypes type, agxSDK::Simulation* simulation );
102 
106  virtual void handleLinks( agxWire::WireParallelCallbacksHandler::CallbackTypes type, agxSDK::Simulation* simulation );
107 
111  WireContainer prepareAndCollectWires( WireParallelCallbacksHandler::CallbackTypes type, agxSDK::Simulation* simulation );
112 
113  protected:
114  agxData::BufferRef m_wireDataBuffer;
115  agx::TaskRef m_executeCallback[ NUM_CALLBACKS ];
116  agx::Bool m_executeSerial;
117  };
118 
119  typedef agx::ref_ptr< WireParallelCallbacksHandler > WireParallelCallbacksHandlerRef;
120 
121  class AGXPHYSICS_EXPORT WireParallelCallbacksHandlerFactory : public agx::Referenced
122  {
123  public:
124  WireParallelCallbacksHandlerFactory();
125  virtual agxWire::WireParallelCallbacksHandler* create( agxSDK::Simulation* simulation ) const;
126 
127  protected:
128  virtual ~WireParallelCallbacksHandlerFactory() {}
129  };
130 
131  typedef agx::ref_ptr< WireParallelCallbacksHandlerFactory > WireParallelCallbacksHandlerFactoryRef;
132 }
133 
bool Bool
Definition: Integer.h:48
#define AGXPHYSICS_EXPORT
Base class providing referencing counted objects.
Definition: Referenced.h:119
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Implements a Wire model with adaptive resolution.
Definition: MergedBody.h:39
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97