AGX Dynamics  2.38.0.2
SolveBodyManager.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 #ifndef AGX_PHYSISCS_HIERARCHICAL_GRID_SOLVE_BODY_MANAGER_H
18 #define AGX_PHYSISCS_HIERARCHICAL_GRID_SOLVE_BODY_MANAGER_H
19 
20 
21 #include <agx/debug.h>
22 #include <agx/AtomicValue.h>
24 #include <agx/Component.h>
25 #include <agxData/Buffer.h>
26 
27 #ifdef _MSC_VER
28 # pragma warning(push)
29 // warning C4251: 'X' : class 'Y' needs to have dll-interface to be used by clients of class 'Z'
30 # pragma warning( disable : 4251 )
31 #endif
32 
33 namespace agx { namespace Physics { namespace HierarchicalGrid {
34 
37  {
38  public:
39  static agx::Model* ClassModel();
40 
41  static const Index ArraySize = 32;
42 
43  public:
45 
46  void registerCell(CellPtr cell);
47  void unregisterCell(CellPtr cell);
48 
49  void clear();
50  void resetCounters();
51 
52  protected:
53  virtual ~SolveBodyManager();
54 
55  private:
56  void reallocationCallback(agxData::Buffer *);
57 
58  private:
59  agxData::BufferRef m_solveBodyCounterBuffer;
60 
61  typedef HashSet<CellPtr> CellHash;
62  CellHash m_activeCells;
63 
64  agxData::Buffer::Event::CallbackType m_reallocationCallback;
65  IndexVector m_inactiveCounterArrays;
66  AtomicValue *m_currentBuffer;
67  };
68 
69 }}}
70 
71 #ifdef _MSC_VER
72 # pragma warning(pop)
73 #endif
74 
75 
76 #endif
agx::EventT< Callback1< Buffer * > >::CallbackType
Callback1< Buffer * > CallbackType
Definition: Event.h:37
agx::VectorPOD< Index >
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agx::Model
A model is an abstract representation of the class of an agx::Object.
Definition: Model.h:40
agx::ref_ptr< Buffer >
CellEntity.h
agx::Index
UInt32 Index
Definition: Integer.h:44
AtomicValue.h
agxData::Buffer
Abstract representation of a data buffer.
Definition: Buffer.h:55
Buffer.h
Component.h
agx::HashSet< CellPtr >
agx::Component
A component is an object containing other objects, enabling hierarchical structuring.
Definition: Component.h:38
agx::Physics::HierarchicalGrid::SolveBodyManager
Definition: SolveBodyManager.h:36
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agxTerrain::Profiler::clear
AGXTERRAIN_EXPORT void clear()
debug.h
agx::AtomicValueT< agx::Int32 >
agx::Physics::HierarchicalGrid::CellPtr
Pointer to a entity instance of type Physics.HierarchicalGrid.Cell.
Definition: CellEntity.h:249