AGXDynamics  2.35.0.3
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 
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:
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
agx::AnalysisBox::getEnable
bool getEnable() const
Return true/false if the box is enabled.
Definition: AnalysisBox.h:103
Referenced.h
agx::Real
double Real
Definition: Real.h:42
agx::AnalysisBox::getAnalysisBound
agx::Bound3 getAnalysisBound() const
Get the bound of the Analysis Box.
Definition: AnalysisBox.h:99
agx::AnalysisBox::m_rigidBodiesInside
RigidBodyPtrVector m_rigidBodiesInside
Definition: AnalysisBox.h:94
Simulation.h
agx::AnalysisBox::setEnable
void setEnable(bool enable)
Set true/false to enable/enable the Analysis Box.
Definition: AnalysisBox.h:105
agx::AnalysisBox
Class that can be used to extract data from elements in a simulation within a specified bound.
Definition: AnalysisBox.h:31
agx::AnalysisBox::m_particleIdsInside
ParticleIdSet m_particleIdsInside
Definition: AnalysisBox.h:95
agx::VectorPOD< RigidBody * >
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agx::BoundT< Vec3 >
agx::AnalysisBox::getParticlesInside
ParticleIdSet getParticlesInside() const
Returns the particles ids inside the Analysis Box.
Definition: AnalysisBox.h:101
agx::AnalysisBox::m_enabled
bool m_enabled
Definition: AnalysisBox.h:96
agx::ParticleSystem
A basic particle system that contains all the storages and buffers required for basic operation and a...
Definition: ParticleSystem.h:67
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agx::AnalysisBox::ParticleIdSet
HashSet< agx::Index > ParticleIdSet
Definition: AnalysisBox.h:34
agx::AnalysisBox::m_simulation
agxSDK::Simulation * m_simulation
Definition: AnalysisBox.h:92
agx::Index
UInt32 Index
Definition: Integer.h:52
Bound.h
agx::HashSet< agx::Index >
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agx::Vec3T< Real >
agx::AnalysisBox::m_bound
agx::Bound3 m_bound
Definition: AnalysisBox.h:93
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58