AGX Dynamics  2.35.0.1
MergeSplitAlgorithm.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 
21 
22 namespace agxSDK
23 {
26 
33  {
34  public:
35  enum Callback
36  {
37  NONE = 0,
38  CONTACTS = 1 << 0,
39  CONSTRAINTS = 1 << 1,
40  WIRES = 1 << 2,
41  POST_SOLVE = 1 << 3,
42  GRANULARS = 1 << 4,
43  END_OF_CALLBACKS = 1 << 5
44  };
45 
46  public:
48 
49  protected:
54 
59 
60  protected:
65 
70  virtual void onPreStepCompute();
71 
77 
83  virtual void onPostSolveCompute( const agxSDK::MergeSplitPostSolveData& postSolveData );
84 
91  virtual void onPostSolveComputeEx( const agxSDK::MergeSplitPostSolveData& postSolveData,
92  const agxSDK::MergedBodyMergeSplitAlgorithm& mergedBodyAlgorithm );
93 
99  virtual void onPostSolveActions( const agxSDK::MergeSplitPostSolveData& postSolveData,
101 
105  virtual void store( agxStream::OutputArchive& out ) const override;
106 
110  virtual void restore( agxStream::InputArchive& in ) override;
111 
112  private:
114  void setMergeSplitHandler( agxSDK::MergeSplitHandler* handler );
115 
116  private:
117  MergeSplitHandler* m_mergeSplitHandler;
118  };
119 }
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXPHYSICS_EXPORT
Object containing merge-split actions to be processed by the agxSDK::MergeSplitHandler.
Stateless base class for merge and split of interactions.
virtual void onPreStepActions(agxSDK::MergeSplitActionContainer &actions)
Push merge and/or split actions in simulation preStep.
virtual void store(agxStream::OutputArchive &out) const override
Stores internal data.
MergeSplitAlgorithm()
Default constructor.
virtual ~MergeSplitAlgorithm()
Reference counted object, protected destructor.
virtual void onPreStepCompute()
Compute callback in preStep.
virtual void onPostSolveComputeEx(const agxSDK::MergeSplitPostSolveData &postSolveData, const agxSDK::MergedBodyMergeSplitAlgorithm &mergedBodyAlgorithm)
Extended compute callback in postSolve.
agxSDK::MergeSplitHandler * getMergeSplitHandler() const
virtual void onPostSolveCompute(const agxSDK::MergeSplitPostSolveData &postSolveData)
Compute callback in postSolve.
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxSDK::MergeSplitAlgorithm)
virtual void restore(agxStream::InputArchive &in) override
Restores internal data.
virtual void onPostSolveActions(const agxSDK::MergeSplitPostSolveData &postSolveData, agxSDK::MergeSplitActionContainer &actions)
Push merge and/or split actions in simulation postSolve.
Base class for a merge split algorithm handling a set of merged bodies.
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:52
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:45
Base class providing referencing counted objects.
Definition: Referenced.h:114
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:400
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.