AGX Dynamics  2.38.0.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 <agxCollide/Box.h>
23 #include <agxSDK/Simulation.h>
24 
25 namespace agx
26 {
28 
33  {
34  public:
36 
37  public:
45  AnalysisBox(agxSDK::Simulation* simulation,
46  const agx::Vec3& halfVec,
48 
50  void updateContents();
51 
53  Real getParticleMassInsideBound();
54 
56  ParticleIdSet getParticlesInside() const;
57 
59  bool containsParticle(agx::Index particleId) const;
60 
62  bool containsPoint(const agx::Vec3& point) const;
63 
65  bool getEnable() const;
66 
68  void setEnable(bool enable);
69 
71  agx::Vec3 getBoxCenter() const;
72 
74  agx::Vec3 getBoxHalfVec() const;
75 
77  void setBoxHalfVec( const agx::Vec3& halfVec );
78 
80  void setBoxCenter( const agx::Vec3& center );
81 
83  void setBoxRotation( const agx::Quat& rotation );
84 
86  agx::Quat getBoxRotation() const;
87 
89  agx::AffineMatrix4x4 getTransform() const;
90 
91  void printContents();
92 
93  protected:
95  virtual ~AnalysisBox();
96 
97  void updateInvTransform();
98 
99  agx::AffineMatrix4x4 getInvTransform() const;
100 
101  agx::ParticleSystem * getParticleSystem();
102 
104  // Variables
106  protected:
113  bool m_enabled;
114  };
115 
117 
119 
120  AGX_FORCE_INLINE void AnalysisBox::setEnable(bool enable) { m_enabled = enable; }
121 
123 
125 }
126 
127 #endif
agx::AnalysisBox::getEnable
bool getEnable() const
Return true/false if the box is enabled.
Definition: AnalysisBox.h:118
Referenced.h
agx::Real
double Real
Definition: Real.h:42
agxData::transform
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
agx::AnalysisBox::m_rigidBodiesInside
RigidBodyPtrVector m_rigidBodiesInside
Definition: AnalysisBox.h:111
Simulation.h
agx::AffineMatrix4x4T< Real >
agx::AnalysisBox::setEnable
void setEnable(bool enable)
Set true/false to enable/enable the Analysis Box.
Definition: AnalysisBox.h:120
agx::AnalysisBox::m_transform
agx::AffineMatrix4x4 m_transform
Definition: AnalysisBox.h:109
agx::AnalysisBox
Class that can be used to extract data from elements in a simulation within a specified bound.
Definition: AnalysisBox.h:32
agx::AnalysisBox::m_particleIdsInside
ParticleIdSet m_particleIdsInside
Definition: AnalysisBox.h:112
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:116
agx::AnalysisBox::m_enabled
bool m_enabled
Definition: AnalysisBox.h:113
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:125
agx::AnalysisBox::ParticleIdSet
HashSet< agx::Index > ParticleIdSet
Definition: AnalysisBox.h:35
agx::AnalysisBox::m_simulation
agxSDK::Simulation * m_simulation
Definition: AnalysisBox.h:107
agx::Index
UInt32 Index
Definition: Integer.h:44
Bound.h
agx::HashSet< agx::Index >
agx::QuatT< Real >
agx::AnalysisBox::m_invBoxTransform
agx::AffineMatrix4x4 m_invBoxTransform
Definition: AnalysisBox.h:110
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:119
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::AnalysisBox::getTransform
agx::AffineMatrix4x4 getTransform() const
Get the transform of the Analysis box.
Definition: AnalysisBox.h:122
agx::AnalysisBox::getInvTransform
agx::AffineMatrix4x4 getInvTransform() const
Definition: AnalysisBox.h:124
agx::Vec3T< Real >
Box.h
agx::AnalysisBox::m_bound
agx::Bound3 m_bound
Definition: AnalysisBox.h:108
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58