AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxQt::ParticleRenderFilterManager Class Reference

#include <ParticleFilters.h>

+ Inheritance diagram for agxQt::ParticleRenderFilterManager:

Public Types

typedef agx::HashTable
< agx::Name,
ParticleFilterMode > 
ParticleColorModeTable
 

Public Member Functions

 ParticleRenderFilterManager ()
 
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
 
ParticleFilterMode getActiveParticleRenderFilterMode () const
 Returns the ParticleFilterMode struct for the active filter in the manager. More...
 
ParticleRenderFilterModeVector getAvailableParticleRenderModes () const
 Returns the ParticleFilterMode structs added to the manager. More...
 
agx::Real getFilterThresholdScalar () const
 Returns the filter threshold of the ParticleRenderFilter. More...
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool particleRenderFilterExists (const agx::String &name)
 Returns true/false if an ParticleRenderFilter with given name identifier exists in the manager. More...
 
void postRender (agx::ParticleSystem *system)
 Execute after render state. More...
 
void preRender (agx::ParticleSystem *system)
 Execute on particles before rendering. 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 resetParticleFilterState (agx::ParticleSystem *system) const
 Resets the filtered state in the particle system. More...
 
void setActiveParticleRenderFilter (ParticleFilterMode mode)
 Switches active particle render filter based on a ParticleFilter mode. More...
 
void setActiveParticleRenderFilterFromString (const agx::String &name)
 Switches active particle render filter based on name identifier. More...
 
void setFilterThresholdScalar (agx::Real threshold)
 Sets the filter threshold of the ParticleRenderFilter. 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...
 

Static Public Member Functions

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

Protected Member Functions

 ~ParticleRenderFilterManager ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void initStandardFilters ()
 

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

ParticleRenderFilter * m_activeParticleFilter
 
ParticleColorModeTable m_availableParticleFilters
 
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 
agx::Real m_scalarThreshold
 

Detailed Description

Definition at line 53 of file ParticleFilters.h.

Member Typedef Documentation

Constructor & Destructor Documentation

agxQt::ParticleRenderFilterManager::ParticleRenderFilterManager ( )
agxQt::ParticleRenderFilterManager::~ParticleRenderFilterManager ( )
protected

Member Function Documentation

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
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(), and agx::InternalData::getOrCreate().

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

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

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

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
ParticleFilterMode agxQt::ParticleRenderFilterManager::getActiveParticleRenderFilterMode ( ) const

Returns the ParticleFilterMode struct for the active filter in the manager.

Returns
The mode identifier of the active particle filter.
ParticleRenderFilterModeVector agxQt::ParticleRenderFilterManager::getAvailableParticleRenderModes ( ) const

Returns the ParticleFilterMode structs added to the manager.

Returns
The modes currently existing in the filter manager
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
agx::Real agxQt::ParticleRenderFilterManager::getFilterThresholdScalar ( ) const

Returns the filter threshold of the ParticleRenderFilter.

What this means and how it is interpreted depends on the currently active filter. What it usually means is that if a certain particle value is beneth the threshold, the particle will be filitered out.

Returns
The filter threshold scalar that is used in the particle filter.
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
void agxQt::ParticleRenderFilterManager::initStandardFilters ( )
protected
template<typename T >
bool agx::Referenced::is ( ) const
inherited
bool agxQt::ParticleRenderFilterManager::particleRenderFilterExists ( const agx::String &  name)

Returns true/false if an ParticleRenderFilter with given name identifier exists in the manager.

Parameters
nameThe name identifier for the ParticleRenderFilter
Returns
true/false if ParticleRenderFilter exists.
void agxQt::ParticleRenderFilterManager::postRender ( agx::ParticleSystem *  system)

Execute after render state.

void agxQt::ParticleRenderFilterManager::preRender ( agx::ParticleSystem *  system)

Execute on particles before rendering.

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.

Referenced by agxData::Val< UInt >::Val().

void agxQt::ParticleRenderFilterManager::resetParticleFilterState ( agx::ParticleSystem *  system) const

Resets the filtered state in the particle system.

Usually used after setting the "None" filter as active.

void agxQt::ParticleRenderFilterManager::setActiveParticleRenderFilter ( ParticleFilterMode  mode)

Switches active particle render filter based on a ParticleFilter mode.

This mode must already exist in the manager for the switch to happen.

Parameters
modeThe mode identifier of a particle filter already added in the manager.
void agxQt::ParticleRenderFilterManager::setActiveParticleRenderFilterFromString ( const agx::String &  name)

Switches active particle render filter based on name identifier.

A particle filter with the specified name must exist in the manager for the switch to happen.

Parameters
nameThe name identifier of a particle filter already added in the manager.
static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

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

void agxQt::ParticleRenderFilterManager::setFilterThresholdScalar ( agx::Real  threshold)

Sets the filter threshold of the ParticleRenderFilter.

What this means and how it is interpreted depends on the currently active filter. What it usually means is that if a certain particle value is beneth the threshold, the particle will be filitered out.

Parameters
thresholdThe filter threshold scalar to be used in the particle filter.
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.

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.

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

Member Data Documentation

ParticleRenderFilter* agxQt::ParticleRenderFilterManager::m_activeParticleFilter
protected

Definition at line 131 of file ParticleFilters.h.

ParticleColorModeTable agxQt::ParticleRenderFilterManager::m_availableParticleFilters
protected

Definition at line 130 of file ParticleFilters.h.

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

agx::Real agxQt::ParticleRenderFilterManager::m_scalarThreshold
protected

Definition at line 132 of file ParticleFilters.h.


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