AGX Dynamics  2.38.0.2
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. More...
 
bool containsParticle (agx::Index particleId) const
 Returns true/false if the particle given the specified particle id is inside the box. More...
 
bool containsPoint (const agx::Vec3 &point) const
 Returns true/false if the point is contained inside the Analysis Box bound. More...
 
agx::Vec3 getBoxCenter () const
 Get the center point of the Analysis Box bound. More...
 
agx::Vec3 getBoxHalfVec () const
 Get the half vector of the Analysis Box bound. More...
 
agx::Quat getBoxRotation () const
 Get the rotation of the Analysis Box bound. More...
 
bool getEnable () const
 Return true/false if the box is enabled. More...
 
Real getParticleMassInsideBound ()
 Return the particle mass in the particles inside the Analysis Box. More...
 
ParticleIdSet getParticlesInside () const
 Returns the particles ids inside the Analysis Box. More...
 
agx::AffineMatrix4x4 getTransform () const
 Get the transform of the Analysis box. More...
 
void printContents ()
 
void setBoxCenter (const agx::Vec3 &center)
 Set the center of the Analysis Box bound. More...
 
void setBoxHalfVec (const agx::Vec3 &halfVec)
 Set the half vector of the Analysis Box bound. More...
 
void setBoxRotation (const agx::Quat &rotation)
 Set the rotation of the Analysis Box bound. More...
 
void setEnable (bool enable)
 Set true/false to enable/enable the Analysis Box. More...
 
void updateContents ()
 Update the analysis box contents. More...
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Protected Member Functions

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

Protected Attributes

agx::Bound3 m_bound
 
bool m_enabled
 
agx::AffineMatrix4x4 m_invBoxTransform
 
ParticleIdSet m_particleIdsInside
 
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. More...
 

Detailed Description

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

Definition at line 32 of file AnalysisBox.h.

Member Typedef Documentation

◆ ParticleIdSet

Definition at line 35 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

◆ 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.

◆ 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 118 of file AnalysisBox.h.

References m_enabled.

◆ getInvTransform()

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

Definition at line 124 of file AnalysisBox.h.

References m_invBoxTransform.

◆ getParticleMassInsideBound()

Real agx::AnalysisBox::getParticleMassInsideBound ( )

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

◆ getParticlesInside()

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

Returns the particles ids inside the Analysis Box.

Definition at line 116 of file AnalysisBox.h.

References m_particleIdsInside.

◆ getParticleSystem()

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

◆ getTransform()

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

Get the transform of the Analysis box.

Definition at line 122 of file AnalysisBox.h.

References m_transform.

◆ printContents()

void agx::AnalysisBox::printContents ( )

◆ 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 120 of file AnalysisBox.h.

References m_enabled.

◆ updateContents()

void agx::AnalysisBox::updateContents ( )

Update the analysis box contents.

◆ updateInvTransform()

void agx::AnalysisBox::updateInvTransform ( )
protected

Member Data Documentation

◆ m_bound

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

Definition at line 108 of file AnalysisBox.h.

◆ m_enabled

bool agx::AnalysisBox::m_enabled
protected

Definition at line 113 of file AnalysisBox.h.

Referenced by getEnable(), and setEnable().

◆ m_invBoxTransform

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

Definition at line 110 of file AnalysisBox.h.

Referenced by getInvTransform().

◆ m_particleIdsInside

ParticleIdSet agx::AnalysisBox::m_particleIdsInside
protected

Definition at line 112 of file AnalysisBox.h.

Referenced by getParticlesInside().

◆ m_rigidBodiesInside

RigidBodyPtrVector agx::AnalysisBox::m_rigidBodiesInside
protected

Definition at line 111 of file AnalysisBox.h.

◆ m_simulation

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

Definition at line 107 of file AnalysisBox.h.

◆ m_transform

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

Definition at line 109 of file AnalysisBox.h.

Referenced by getTransform().


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