AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agx::AnalysisBox Class Reference

Class that can be used to extract data from elements in a simulation within a specified bound. More...

#include <AnalysisBox.h>

+ Inheritance diagram for agx::AnalysisBox:

Public Types

typedef HashSet< agx::Index > ParticleIdSet
 

Public Member Functions

 AnalysisBox (agxSDK::Simulation *simulation, const agx::Vec3 &halfVec, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
 Constructor for the AnalysisBox.
 
Real calculateBodyMassInside (bool onlyIncludeEmittedBodies=false)
 Return the body mass in the particles inside the Analysis Box.
 
Real calculateBoxVolume () const
 Return the volume of the Analysis Box.
 
Real calculateBulkDensity () const
 Return the estimated bulk density inside the Analysis Box based on the current contents.
 
Real calculateParticleMassInside ()
 Return the particle mass in the particles inside the Analysis Box.
 
void clearContentData ()
 Clears all content data inside the box.
 
bool containsParticle (agx::Index particleId) const
 Returns true/false if the particle given the specified particle id is inside the box.
 
bool containsPoint (const agx::Vec3 &point) const
 Returns true/false if the point is contained inside the Analysis Box bound.
 
Real estimateMassFlowInside (bool includeParticles=true, bool includeBodies=true)
 Estimate the particle mass flow inside the Analysis Box.
 
RigidBodyPtrVector getBodiesInside () const
 Returns the rigid bodies inside the Analysis Box.
 
agx::Real getBodyMassInside () const
 Get rigid body mass inside bound from last content update.
 
agx::Vec3 getBoxCenter () const
 Get the center point of the Analysis Box bound.
 
agx::Vec3 getBoxHalfVec () const
 Get the half vector of the Analysis Box bound.
 
agx::Quat getBoxRotation () const
 Get the rotation of the Analysis Box bound.
 
bool getEnable () const
 Return true/false if the box is enabled.
 
bool getEnableRendering () const
 Return true/false if the box rendering is enabled.
 
agx::Vec3 getLocalPositionInBox (const agx::Vec3 &worldPosition) const
 Get the local position of the specified world position.
 
size_t getNumBodiesInside ()
 Get number of rigid bodies in bound from last content update.
 
size_t getNumParticlesInside ()
 Get number of particles in bound from last content update.
 
agx::Real getParticleMassInside () const
 Get particle mass inside bound from last content update.
 
ParticleIdSet getParticlesInside () const
 Returns the particles ids inside the Analysis Box.
 
agx::Real getTotalMassInside () const
 Get total mass inside bound from last content update.
 
agx::AffineMatrix4x4 getTransform () const
 Get the transform of the Analysis box.
 
void setBoxCenter (const agx::Vec3 &center)
 Set the center of the Analysis Box bound.
 
void setBoxHalfVec (const agx::Vec3 &halfVec)
 Set the half vector of the Analysis Box bound.
 
void setBoxRotation (const agx::Quat &rotation)
 Set the rotation of the Analysis Box bound.
 
void setEnable (bool enable)
 Set true/false to enable/enable the Analysis Box.
 
void setEnableRendering (bool enable)
 Set true/false to enable/enable rendering of the Analysis Box.
 
void updateContents (bool includeRigidBodies=false, bool onlyIncludeEmittedBodies=false)
 Update the analysis box contents.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Protected Member Functions

virtual ~AnalysisBox ()
 Virtual Destructor.
 
agx::AffineMatrix4x4 getInvTransform () const
 
agx::ParticleSystem * getParticleSystem ()
 
void updateInvTransform ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

agx::Real m_bodyMassInside
 
agx::Bound3 m_bound
 
bool m_enabled
 
bool m_enableDebugRenderContents
 
bool m_enableRendering
 
agx::AffineMatrix4x4 m_invBoxTransform
 
ParticleIdSet m_particleIdsInside
 
agx::Real m_particleMassInside
 
RigidBodyPtrVector m_rigidBodiesInside
 
agxSDK::Simulation * m_simulation
 
agx::AffineMatrix4x4 m_transform
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Class that can be used to extract data from elements in a simulation within a specified bound.

Definition at line 30 of file AnalysisBox.h.

Member Typedef Documentation

◆ ParticleIdSet

Definition at line 33 of file AnalysisBox.h.

Constructor & Destructor Documentation

◆ AnalysisBox()

agx::AnalysisBox::AnalysisBox ( agxSDK::Simulation *  simulation,
const agx::Vec3 &  halfVec,
const agx::AffineMatrix4x4 &  transform = agx::AffineMatrix4x4() 
)

Constructor for the AnalysisBox.

Parameters
simulationThe simulation to couple the analysis box too.
halfVecHalf vector that spans the box.
transformThe transformation of the analysis box, translation and rotation.

◆ ~AnalysisBox()

virtual agx::AnalysisBox::~AnalysisBox ( )
protectedvirtual

Virtual Destructor.

Member Function Documentation

◆ calculateBodyMassInside()

Real agx::AnalysisBox::calculateBodyMassInside ( bool  onlyIncludeEmittedBodies = false)

Return the body mass in the particles inside the Analysis Box.

◆ calculateBoxVolume()

Real agx::AnalysisBox::calculateBoxVolume ( ) const

Return the volume of the Analysis Box.

◆ calculateBulkDensity()

Real agx::AnalysisBox::calculateBulkDensity ( ) const

Return the estimated bulk density inside the Analysis Box based on the current contents.

◆ calculateParticleMassInside()

Real agx::AnalysisBox::calculateParticleMassInside ( )

Return the particle mass in the particles inside the Analysis Box.

◆ clearContentData()

void agx::AnalysisBox::clearContentData ( )

Clears all content data inside the box.

◆ containsParticle()

bool agx::AnalysisBox::containsParticle ( agx::Index  particleId) const

Returns true/false if the particle given the specified particle id is inside the box.

◆ containsPoint()

bool agx::AnalysisBox::containsPoint ( const agx::Vec3 &  point) const

Returns true/false if the point is contained inside the Analysis Box bound.

◆ estimateMassFlowInside()

Real agx::AnalysisBox::estimateMassFlowInside ( bool  includeParticles = true,
bool  includeBodies = true 
)

Estimate the particle mass flow inside the Analysis Box.

◆ getBodiesInside()

agx::RigidBodyPtrVector agx::AnalysisBox::getBodiesInside ( ) const

Returns the rigid bodies inside the Analysis Box.

Definition at line 173 of file AnalysisBox.h.

◆ getBodyMassInside()

agx::Real agx::AnalysisBox::getBodyMassInside ( ) const

Get rigid body mass inside bound from last content update.

◆ getBoxCenter()

agx::Vec3 agx::AnalysisBox::getBoxCenter ( ) const

Get the center point of the Analysis Box bound.

◆ getBoxHalfVec()

agx::Vec3 agx::AnalysisBox::getBoxHalfVec ( ) const

Get the half vector of the Analysis Box bound.

◆ getBoxRotation()

agx::Quat agx::AnalysisBox::getBoxRotation ( ) const

Get the rotation of the Analysis Box bound.

◆ getEnable()

bool agx::AnalysisBox::getEnable ( ) const

Return true/false if the box is enabled.

Definition at line 175 of file AnalysisBox.h.

◆ getEnableRendering()

bool agx::AnalysisBox::getEnableRendering ( ) const

Return true/false if the box rendering is enabled.

◆ getInvTransform()

agx::AffineMatrix4x4 agx::AnalysisBox::getInvTransform ( ) const
protected

Definition at line 185 of file AnalysisBox.h.

◆ getLocalPositionInBox()

agx::Vec3 agx::AnalysisBox::getLocalPositionInBox ( const agx::Vec3 &  worldPosition) const

Get the local position of the specified world position.

◆ getNumBodiesInside()

size_t agx::AnalysisBox::getNumBodiesInside ( )

Get number of rigid bodies in bound from last content update.

◆ getNumParticlesInside()

size_t agx::AnalysisBox::getNumParticlesInside ( )

Get number of particles in bound from last content update.

◆ getParticleMassInside()

agx::Real agx::AnalysisBox::getParticleMassInside ( ) const

Get particle mass inside bound from last content update.

◆ getParticlesInside()

agx::AnalysisBox::ParticleIdSet agx::AnalysisBox::getParticlesInside ( ) const

Returns the particles ids inside the Analysis Box.

Definition at line 171 of file AnalysisBox.h.

◆ getParticleSystem()

agx::ParticleSystem * agx::AnalysisBox::getParticleSystem ( )
protected

◆ getTotalMassInside()

agx::Real agx::AnalysisBox::getTotalMassInside ( ) const

Get total mass inside bound from last content update.

◆ getTransform()

agx::AffineMatrix4x4 agx::AnalysisBox::getTransform ( ) const

Get the transform of the Analysis box.

Definition at line 183 of file AnalysisBox.h.

◆ setBoxCenter()

void agx::AnalysisBox::setBoxCenter ( const agx::Vec3 &  center)

Set the center of the Analysis Box bound.

◆ setBoxHalfVec()

void agx::AnalysisBox::setBoxHalfVec ( const agx::Vec3 &  halfVec)

Set the half vector of the Analysis Box bound.

◆ setBoxRotation()

void agx::AnalysisBox::setBoxRotation ( const agx::Quat &  rotation)

Set the rotation of the Analysis Box bound.

◆ setEnable()

void agx::AnalysisBox::setEnable ( bool  enable)

Set true/false to enable/enable the Analysis Box.

Definition at line 177 of file AnalysisBox.h.

◆ setEnableRendering()

void agx::AnalysisBox::setEnableRendering ( bool  enable)

Set true/false to enable/enable rendering of the Analysis Box.

◆ updateContents()

void agx::AnalysisBox::updateContents ( bool  includeRigidBodies = false,
bool  onlyIncludeEmittedBodies = false 
)

Update the analysis box contents.

◆ updateInvTransform()

void agx::AnalysisBox::updateInvTransform ( )
protected

Member Data Documentation

◆ m_bodyMassInside

agx::Real agx::AnalysisBox::m_bodyMassInside
protected

Definition at line 165 of file AnalysisBox.h.

◆ m_bound

agx::Bound3 agx::AnalysisBox::m_bound
protected

Definition at line 159 of file AnalysisBox.h.

◆ m_enabled

bool agx::AnalysisBox::m_enabled
protected

Definition at line 166 of file AnalysisBox.h.

◆ m_enableDebugRenderContents

bool agx::AnalysisBox::m_enableDebugRenderContents
protected

Definition at line 168 of file AnalysisBox.h.

◆ m_enableRendering

bool agx::AnalysisBox::m_enableRendering
protected

Definition at line 167 of file AnalysisBox.h.

◆ m_invBoxTransform

agx::AffineMatrix4x4 agx::AnalysisBox::m_invBoxTransform
protected

Definition at line 161 of file AnalysisBox.h.

◆ m_particleIdsInside

ParticleIdSet agx::AnalysisBox::m_particleIdsInside
protected

Definition at line 163 of file AnalysisBox.h.

◆ m_particleMassInside

agx::Real agx::AnalysisBox::m_particleMassInside
protected

Definition at line 164 of file AnalysisBox.h.

◆ m_rigidBodiesInside

RigidBodyPtrVector agx::AnalysisBox::m_rigidBodiesInside
protected

Definition at line 162 of file AnalysisBox.h.

◆ m_simulation

agxSDK::Simulation* agx::AnalysisBox::m_simulation
protected

Definition at line 158 of file AnalysisBox.h.

◆ m_transform

agx::AffineMatrix4x4 agx::AnalysisBox::m_transform
protected

Definition at line 160 of file AnalysisBox.h.


The documentation for this class was generated from the following file: