AGX Dynamics  2.35.0.1
AnalysisBox.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 #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 
48 
50  void setAnalysisBound(const agx::Vec3& center, const agx::Vec3& halfVec);
51 
53  agx::Bound3 getAnalysisBound() const;
54 
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 
75 
78 
79  void printContents();
80 
81  protected:
83  virtual ~AnalysisBox();
84  void updateBound(const agx::Vec3& center, const agx::Vec3& halfVec);
85 
87 
89  // Variables
91  protected:
96  bool m_enabled;
97  };
98 
100 
102 
104 
105  AGX_FORCE_INLINE void AnalysisBox::setEnable(bool enable) { m_enabled = enable; }
106 }
107 
108 #endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXPHYSICS_EXPORT
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Class that can be used to extract data from elements in a simulation within a specified bound.
Definition: AnalysisBox.h:32
agx::ParticleSystem * getParticleSystem()
Real getParticleMassInsideBound()
Return the particle mass in the particles inside the Analysis Box.
ParticleIdSet getParticlesInside() const
Returns the particles ids inside the Analysis Box.
Definition: AnalysisBox.h:101
virtual ~AnalysisBox()
Virtual Destructor.
agx::Bound3 m_bound
Definition: AnalysisBox.h:93
AnalysisBox(agxSDK::Simulation *simulation, const agx::Vec3 &center, const agx::Vec3 &halfVec)
Constructor for the AnalysisBox.
ParticleIdSet m_particleIdsInside
Definition: AnalysisBox.h:95
agx::Bound3 getAnalysisBound() const
Get the bound of the Analysis Box.
Definition: AnalysisBox.h:99
agxSDK::Simulation * m_simulation
Definition: AnalysisBox.h:92
bool containsParticle(agx::Index particleId) const
Returns true/false if the particle given the specified particle id is inside the box.
void setEnable(bool enable)
Set true/false to enable/enable the Analysis Box.
Definition: AnalysisBox.h:105
void updateContents()
Update the analysis box contents.
agx::Vec3 getBoundCenter()
Get the center point of the Analysis Box bound.
void setAnalysisBound(const agx::Vec3 &center, const agx::Vec3 &halfVec)
Update the bounds of the Analysis Box.
void updateBound(const agx::Vec3 &center, const agx::Vec3 &halfVec)
HashSet< agx::Index > ParticleIdSet
Definition: AnalysisBox.h:34
bool getEnable() const
Return true/false if the box is enabled.
Definition: AnalysisBox.h:103
RigidBodyPtrVector m_rigidBodiesInside
Definition: AnalysisBox.h:94
agx::Vec3 getBoundHalfVec()
Get the half vector of the Analysis Box bound.
bool containsPoint(const agx::Vec3 &point)
Returns true/false if the point is contained inside the Analysis Box bound.
A basic particle system that contains all the storages and buffers required for basic operation and a...
Base class providing referencing counted objects.
Definition: Referenced.h:114
#define AGX_FORCE_INLINE
Definition: macros.h:58
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:42
UInt32 Index
Definition: Integer.h:52