AGX Dynamics  2.37.3.2
AnalysisBox.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_ANALYSISBOX_H
18 #define AGX_ANALYSISBOX_H
19 
20 #include <agx/Referenced.h>
21 #include <agx/Bound.h>
22 #include <agxSDK/Simulation.h>
23 
24 namespace agx
25 {
27 
32  {
33  public:
35 
36  public:
44  AnalysisBox(agxSDK::Simulation * simulation, const agx::Vec3& center, const agx::Vec3& halfVec);
45 
47  void updateContents();
48 
50  void setAnalysisBound(const agx::Vec3& center, const agx::Vec3& halfVec);
51 
53  agx::Bound3 getAnalysisBound() const;
54 
56  Real getParticleMassInsideBound();
57 
59  ParticleIdSet getParticlesInside() const;
60 
62  bool containsParticle(agx::Index particleId) const;
63 
65  bool containsPoint(const agx::Vec3& point);
66 
68  bool getEnable() const;
69 
71  void setEnable(bool enable);
72 
74  agx::Vec3 getBoundCenter();
75 
77  agx::Vec3 getBoundHalfVec();
78 
79  void printContents();
80 
81  protected:
83  virtual ~AnalysisBox();
84  void updateBound(const agx::Vec3& center, const agx::Vec3& halfVec);
85 
86  agx::ParticleSystem * getParticleSystem();
87 
89  // Variables
91  protected:
95  ParticleIdSet m_particleIdsInside;
96  bool m_enabled;
97  };
98 
100 
102 
103  AGX_FORCE_INLINE bool AnalysisBox::getEnable() const { return m_enabled; }
104 
105  AGX_FORCE_INLINE void AnalysisBox::setEnable(bool enable) { m_enabled = enable; }
106 }
107 
108 #endif
agx::Bound3 m_bound
Definition: AnalysisBox.h:93
void setEnable(bool enable)
Set true/false to enable/enable the Analysis Box.
Definition: AnalysisBox.h:105
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
RigidBodyPtrVector m_rigidBodiesInside
Definition: AnalysisBox.h:94
#define AGX_FORCE_INLINE
Definition: Object.h:59
agx::Bound3 getAnalysisBound() const
Get the bound of the Analysis Box.
Definition: AnalysisBox.h:99
Base class providing referencing counted objects.
Definition: Referenced.h:119
A basic particle system that contains all the storages and buffers required for basic operation and a...
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool getEnable() const
Return true/false if the box is enabled.
Definition: AnalysisBox.h:103
UInt32 Index
Definition: Integer.h:52
Class that can be used to extract data from elements in a simulation within a specified bound...
Definition: AnalysisBox.h:31
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
ParticleIdSet m_particleIdsInside
Definition: AnalysisBox.h:95
HashSet< agx::Index > ParticleIdSet
Definition: AnalysisBox.h:34
double Real
Definition: Real.h:42
agxSDK::Simulation * m_simulation
Definition: AnalysisBox.h:92
ParticleIdSet getParticlesInside() const
Returns the particles ids inside the Analysis Box.
Definition: AnalysisBox.h:101