AGXDynamics  2.31.1.0
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 &center, const agx::Vec3 &halfVec)
 Constructor for the AnalysisBox. More...
 
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
 
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)
 Returns true/false if the point is contained inside the Analysis Box bound. More...
 
agx::Bound3 getAnalysisBound () const
 Get the bound of the Analysis Box. More...
 
agx::Vec3 getBoundCenter ()
 Get the center point of the Analysis Box bound. More...
 
agx::Vec3 getBoundHalfVec ()
 Get the half vector 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...
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
void printContents ()
 
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 setAnalysisBound (const agx::Vec3 &center, const agx::Vec3 &halfVec)
 Update the bounds of the Analysis Box. More...
 
void setEnable (bool enable)
 Set true/false to enable/enable the Analysis Box. 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...
 
void updateContents ()
 Update the analysis box contents. More...
 

Static Public Member Functions

template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~AnalysisBox ()
 Virtual Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
agx::ParticleSystem * getParticleSystem ()
 
void updateBound (const agx::Vec3 &center, const agx::Vec3 &halfVec)
 

Static Protected Member Functions

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

Protected Attributes

agx::Bound3 m_bound
 
bool m_enabled
 
Mutex m_mutex
 
ObserverContainer m_observers
 
ParticleIdSet m_particleIdsInside
 
AtomicValue m_refCount
 
RigidBodyPtrVector m_rigidBodiesInside
 
agxSDK::Simulation * m_simulation
 

Detailed Description

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

Definition at line 31 of file AnalysisBox.h.

Member Typedef Documentation

◆ ParticleIdSet

Definition at line 34 of file AnalysisBox.h.

Constructor & Destructor Documentation

◆ AnalysisBox()

agx::AnalysisBox::AnalysisBox ( agxSDK::Simulation *  simulation,
const agx::Vec3 &  center,
const agx::Vec3 &  halfVec 
)

Constructor for the AnalysisBox.

Parameters
simulationThe simulation to couple the analysis box too.
centerCenter of the Analysis Box.
halfVecHalf vector that span the bound.

◆ ~AnalysisBox()

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

Virtual Destructor.

Member Function Documentation

◆ allocateObserverVector()

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited

◆ as() [1/2]

template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().

◆ as() [2/2]

template<typename T >
const T* agx::Referenced::as ( ) const
inherited

◆ asSafe() [1/2]

template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

◆ asSafe() [2/2]

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited

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

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

◆ deleteUsingDeleteHandler()

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited

◆ getAnalysisBound()

agx::Bound3 agx::AnalysisBox::getAnalysisBound ( ) const

Get the bound of the Analysis Box.

Definition at line 99 of file AnalysisBox.h.

◆ getBoundCenter()

agx::Vec3 agx::AnalysisBox::getBoundCenter ( )

Get the center point of the Analysis Box bound.

◆ getBoundHalfVec()

agx::Vec3 agx::AnalysisBox::getBoundHalfVec ( )

Get the half vector of the Analysis Box bound.

◆ getDeleteHandler()

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.

◆ getEnable()

bool agx::AnalysisBox::getEnable ( ) const

Return true/false if the box is enabled.

Definition at line 103 of file AnalysisBox.h.

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

◆ getParticleSystem()

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

◆ getReferenceCount()

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.

◆ is()

template<typename T >
bool agx::Referenced::is ( ) const
inherited

◆ printContents()

void agx::AnalysisBox::printContents ( )

◆ reference()

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

◆ setAnalysisBound()

void agx::AnalysisBox::setAnalysisBound ( const agx::Vec3 &  center,
const agx::Vec3 &  halfVec 
)

Update the bounds of the Analysis Box.

◆ setDeleteHandler()

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

◆ setEnable()

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

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

Definition at line 105 of file AnalysisBox.h.

◆ unreference()

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().

◆ unreference_nodelete()

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

◆ updateBound()

void agx::AnalysisBox::updateBound ( const agx::Vec3 &  center,
const agx::Vec3 &  halfVec 
)
protected

◆ updateContents()

void agx::AnalysisBox::updateContents ( )

Update the analysis box contents.

◆ ValidateCast()

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

◆ m_bound

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

Definition at line 93 of file AnalysisBox.h.

◆ m_enabled

bool agx::AnalysisBox::m_enabled
protected

Definition at line 96 of file AnalysisBox.h.

◆ m_mutex

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

◆ m_observers

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

◆ m_particleIdsInside

ParticleIdSet agx::AnalysisBox::m_particleIdsInside
protected

Definition at line 95 of file AnalysisBox.h.

◆ m_refCount

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

◆ m_rigidBodiesInside

RigidBodyPtrVector agx::AnalysisBox::m_rigidBodiesInside
protected

Definition at line 94 of file AnalysisBox.h.

◆ m_simulation

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

Definition at line 92 of file AnalysisBox.h.


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