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

Class for containing and managing the different agxTerrain::Terrain settings. More...

#include <TerrainProperties.h>

+ Inheritance diagram for agxTerrain::TerrainProperties:

Public Member Functions

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
 
agx::Real getAvalancheDecayFraction () const
 
agx::Real getAvalancheErrorThreshold () const
 
agx::Real getAvalancheMaxHeightGrowth () const
 Get the maximum allowed height transfer per time step due to avalanching. More...
 
bool getCreateParticles () const
 
agx::Real getDeformerActivationSpeed () const
 Get the shovel speed threshold in the excavation plane of shovel deformers when static mass in the active zone is converted to dynamic mass. More...
 
bool getDeleteSoilParticlesOutsideBounds () const
 
bool getEnableAvalanching () const
 
bool getEnableCreateDynamicMass () const
 
bool getEnableLockedBorders () const
 
bool getEnableSoilCompaction () const
 
agx::Real getMaximumParticleActivationVolume () const
 
agx::Real getPenetrationForceVelocityScaling () const
 
int getReferenceCount () const
 
agx::Real getSoilAggregateLockCompliance (agx::Int dof) const
 Set the compliance of the soil aggregate lock joint the local constraint dimensions to relax or increase the force feedback interaction from shovel - terrain interaction. More...
 
agx::Real getSoilMergeSpeedThreshold () const
 
agx::Real getSoilParticleGrowthRate () const
 
agx::Real getSoilParticleLifeTime () const
 
agx::Real getSoilParticleMergeRate () const
 
agx::Real getSoilParticleMergeThreshold () const
 
float getSoilParticleSizeScaling ()
 Get soil particle size scaling factor. More...
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isDirty () const
 
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 setAvalancheDecayFraction (agx::Real decayFraction)
 Set the fraction of the height difference that violates the angle of repose condition that will be transferred in each time step during avalanching. More...
 
void setAvalancheErrorThreshold (agx::Real errorThreshold)
 Set the fractional error threshold for the height difference that will trigger avalanching in a grid point. More...
 
void setAvalancheMaxHeightGrowth (agx::Real maxHeightGrowth)
 Set the maximum allowed height (m) transfer per time step due to avalanching. More...
 
void setCreateParticles (bool enable)
 Set whether the terrain should create particles or not during shovel interactions. More...
 
void setDeformerActivationSpeed (agx::Real activationSpeed)
 Set the shovel speed threshold in the excavation plane of shovel deformers when static mass in the active zone is converted to dynamic mass. More...
 
void setDeleteSoilParticlesOutsideBounds (bool enable)
 Set if terrain should delete soil particles outside of terrain bounds. More...
 
void setDirty (bool isDirty)
 Set dirty flag on the TerrainProperties. More...
 
void setEnableAvalanching (bool enable)
 Set whether to enable avalanching in the terrain. More...
 
void setEnableCreateDynamicMass (bool enable)
 Sets if dynamic mass should be created during excavation. More...
 
void setEnableLockedBorders (bool enable)
 Set whether to fixate the height of the borders in the terrain. More...
 
void setEnableSoilCompaction (bool enable)
 Set whether or not to use the soil compaction calculations in the terrain. More...
 
void setMaximumParticleActivationVolume (agx::Real volume)
 Sets the maximum volume (m3) of active zone wedges that should wake particles. More...
 
void setPenetrationForceVelocityScaling (agx::Real penetrationForceVelocityScaling)
 Set the penetration force velocity scaling constant. More...
 
void setSoilAggregateLockCompliance (agx::Real compliance, agx::Int dof)
 Set the compliance of the soil aggregate lock joint the local constraint dimensions to relax or increase the force feedback interaction from shovel -terrain interaction. More...
 
void setSoilMergeSpeedThreshold (agx::Real speedThreshold)
 Set the absolute lower speed (m/s) threshold where soil particles are allowed to merge with the terrain. More...
 
void setSoilParticleGrowthRate (agx::Real growthRateFactor)
 Set the rate factor in the algorithm for growing soil particles from fluid mass and particle resizing. More...
 
void setSoilParticleLifeTime (agx::Real lifeTime)
 Set the lifetime (s) of created soil particles in the terrain. More...
 
void setSoilParticleMergeRate (agx::Real mergeRate)
 Set the merge rate for soil particles into the terrain. More...
 
void setSoilParticleMergeThreshold (agx::Real radiusFraction)
 Set the fraction of the particle nominal radius that will trigger instant merge of soil particles into the terrain during merging. More...
 
void setSoilParticleSizeScaling (float scalingFactor)
 Set soil particle size scaling factor. 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 Types

using Flags = agx::BitState< StateFlags, agx::UInt32 >
 
enum  StateFlags : agx::UInt32 {
  LOCKED_BORDERS = 1 << 0, CREATE_PATICLES = 1 << 1, DELETE_PARTICLES_OUTSIDE_BOUNDS = 1 << 2, ENABLE_SOIL_COMPACTION = 1 << 3,
  ENABLE_AVALANCHING = 1 << 4, ENABLE_DYNAMIC_MASS = 1 << 5
}
 

Protected Member Functions

virtual ~TerrainProperties ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

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

Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Class for containing and managing the different agxTerrain::Terrain settings.

Definition at line 31 of file TerrainProperties.h.

Member Typedef Documentation

using agxTerrain::TerrainProperties::Flags = agx::BitState<StateFlags, agx::UInt32>
protected

Definition at line 316 of file TerrainProperties.h.

Member Enumeration Documentation

Enumerator
LOCKED_BORDERS 
CREATE_PATICLES 
DELETE_PARTICLES_OUTSIDE_BOUNDS 
ENABLE_SOIL_COMPACTION 
ENABLE_AVALANCHING 
ENABLE_DYNAMIC_MASS 

Definition at line 307 of file TerrainProperties.h.

Constructor & Destructor Documentation

virtual agxTerrain::TerrainProperties::~TerrainProperties ( )
protectedvirtual

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
agx::Real agxTerrain::TerrainProperties::getAvalancheDecayFraction ( ) const
inline
Returns
the fraction of the height difference that violates the angle of repose condition that will be transferred in each time step during avalanching.

Definition at line 353 of file TerrainProperties.h.

agx::Real agxTerrain::TerrainProperties::getAvalancheErrorThreshold ( ) const
Returns
the the fractional error threshold for the height difference that will trigger avalanching in a grid point.
Note
- the height difference error threshold is calculated using: errorThreshold / elementSize.
agx::Real agxTerrain::TerrainProperties::getAvalancheMaxHeightGrowth ( ) const
inline

Get the maximum allowed height transfer per time step due to avalanching.

Definition at line 346 of file TerrainProperties.h.

bool agxTerrain::TerrainProperties::getCreateParticles ( ) const
Returns
whether the terrain should create particles or not during shovel interactions.
agx::Real agxTerrain::TerrainProperties::getDeformerActivationSpeed ( ) const

Get the shovel speed threshold in the excavation plane of shovel deformers when static mass in the active zone is converted to dynamic mass.

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
bool agxTerrain::TerrainProperties::getDeleteSoilParticlesOutsideBounds ( ) const
inline
Returns
true if particles outside the terrain bounds should be deleted - otherwise false (default).

Definition at line 360 of file TerrainProperties.h.

bool agxTerrain::TerrainProperties::getEnableAvalanching ( ) const
Returns
whether or not to use avalanching in the terrain.
bool agxTerrain::TerrainProperties::getEnableCreateDynamicMass ( ) const
inline
Returns
true if dynamic mass should be created during excavation. If false, this will prevent the creation of fluid and soil particle mass during shovel excavation; thus only solid removal will be active.

Definition at line 388 of file TerrainProperties.h.

bool agxTerrain::TerrainProperties::getEnableLockedBorders ( ) const
inline
Returns
whether or not to use locked borders. I.e the borders of the terrain are not allowed to change from excavation and avalanching.

Definition at line 339 of file TerrainProperties.h.

bool agxTerrain::TerrainProperties::getEnableSoilCompaction ( ) const
Returns
whether or not to use soil compaction calculation in the terrain.
agx::Real agxTerrain::TerrainProperties::getMaximumParticleActivationVolume ( ) const
inline
Returns
the maximum volume of active zone wedges that should wake particles.

Definition at line 374 of file TerrainProperties.h.

agx::Real agxTerrain::TerrainProperties::getPenetrationForceVelocityScaling ( ) const
inline
Returns
the penetration force velocity scaling constant. This will scale the penetration force with the shovel velocity squared in the cutting direction according to: ( 1.0 + C * v^2 ) (Default: 0.0)

Definition at line 367 of file TerrainProperties.h.

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agx::Real agxTerrain::TerrainProperties::getSoilAggregateLockCompliance ( agx::Int  dof) const
inline

Set the compliance of the soil aggregate lock joint the local constraint dimensions to relax or increase the force feedback interaction from shovel - terrain interaction.

Note
The z - direction(dof = 5) is perpendicular to the plane that the cutting edge and the top edge exists in, which is typically in the digging direction. dof: 0 - 2 = translational direction dof: 3 - 5 = rotational direction
Returns
the current compliance in the lock joint in the specified degree of freedom.

Definition at line 381 of file TerrainProperties.h.

agx::Real agxTerrain::TerrainProperties::getSoilMergeSpeedThreshold ( ) const
Returns
the absolute lower speed (m/s) threshold where soil particles are allowed to merge with the terrain.
agx::Real agxTerrain::TerrainProperties::getSoilParticleGrowthRate ( ) const
Returns
the rate factor in the algorithm that governs particle growth from fluid mass and resizing. (Default: 0.125)
agx::Real agxTerrain::TerrainProperties::getSoilParticleLifeTime ( ) const
Returns
the lifetime (s) of the created soil particles. (Default: Infinity).
agx::Real agxTerrain::TerrainProperties::getSoilParticleMergeRate ( ) const
Returns
the merge rate for soil particles in the terrain. The merge rate is defined as the fraction of the current particle mass that should be merged into the terrain for each second.
agx::Real agxTerrain::TerrainProperties::getSoilParticleMergeThreshold ( ) const
Returns
the fraction of the particle nominal radius that will trigger instant merge of particles into the terrain during merging.
float agxTerrain::TerrainProperties::getSoilParticleSizeScaling ( )

Get soil particle size scaling factor.

template<typename T >
bool agx::Referenced::is ( ) const
inherited
bool agxTerrain::TerrainProperties::isDirty ( ) const
Returns
whether the TerainProperties is dirty.
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 agxTerrain::TerrainProperties::setAvalancheDecayFraction ( agx::Real  decayFraction)

Set the fraction of the height difference that violates the angle of repose condition that will be transferred in each time step during avalanching.

Parameters
decayFraction- The fraction of the height difference that violates the angle of repose that will be transferred. (Default: 0.1)
void agxTerrain::TerrainProperties::setAvalancheErrorThreshold ( agx::Real  errorThreshold)

Set the fractional error threshold for the height difference that will trigger avalanching in a grid point.

Parameters
errorThreshold- the fractional error threshold that will determine if a height difference will trigger avalanching. (Default: 1E-4)
Note
- the height difference error threshold is calculated using: errorThreshold / elementSize.
void agxTerrain::TerrainProperties::setAvalancheMaxHeightGrowth ( agx::Real  maxHeightGrowth)

Set the maximum allowed height (m) transfer per time step due to avalanching.

Parameters
maxHeightGrowth- The maximum height allowed during a height (m) transfer. (Default: infinity)
void agxTerrain::TerrainProperties::setCreateParticles ( bool  enable)

Set whether the terrain should create particles or not during shovel interactions.

Parameters
enable- true if particles should be created from excavation - false otherwise.
void agxTerrain::TerrainProperties::setDeformerActivationSpeed ( agx::Real  activationSpeed)

Set the shovel speed threshold in the excavation plane of shovel deformers when static mass in the active zone is converted to dynamic mass.

Parameters
activationSpeed- the specified speed threshold where static mass is converted to dynamic mass in the deformer active zone. (Default: 0.1 m/s)
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 agxTerrain::TerrainProperties::setDeleteSoilParticlesOutsideBounds ( bool  enable)

Set if terrain should delete soil particles outside of terrain bounds.

Parameters
enable- true if particle should be deleted when outside terrain bounds - false otherwise.
void agxTerrain::TerrainProperties::setDirty ( bool  isDirty)

Set dirty flag on the TerrainProperties.

Parameters
isDirty- set whether the properties should be marked as dirty or not.
void agxTerrain::TerrainProperties::setEnableAvalanching ( bool  enable)

Set whether to enable avalanching in the terrain.

Parameters
enable- true if avalanching should be enabled - false otherwise.
void agxTerrain::TerrainProperties::setEnableCreateDynamicMass ( bool  enable)

Sets if dynamic mass should be created during excavation.

Setting this to false will prevent the creation of fluid and soil particle mass during shovel excavation; thus only solid removal will be active.

Parameters
enable- True if dynamic mass should be created during excavation, false otherwise ( Default: True )
void agxTerrain::TerrainProperties::setEnableLockedBorders ( bool  enable)

Set whether to fixate the height of the borders in the terrain.

I.e the borders of the terrain are not allowed to change from excavation and avalanching.

Parameters
enable- true if borders should be locked - false otherwise.
void agxTerrain::TerrainProperties::setEnableSoilCompaction ( bool  enable)

Set whether or not to use the soil compaction calculations in the terrain.

Parameters
enable- true if compaction should be calculated in the terrain - false otherwise.
void agxTerrain::TerrainProperties::setMaximumParticleActivationVolume ( agx::Real  volume)

Sets the maximum volume (m3) of active zone wedges that should wake particles.

Parameters
volume- the maximum volume of active zone wedges that should wake particles. ( Default:Infinity )
void agxTerrain::TerrainProperties::setPenetrationForceVelocityScaling ( agx::Real  penetrationForceVelocityScaling)

Set the penetration force velocity scaling constant.

This will scale the penetration force with the shovel velocity squared in the cutting direction according to: ( 1.0 + C * v^2 )

Parameters
penetrationForceVelocityScaling- The coefficient for scaling the penetration force with the shovel velocity in the cutting direction (Default: 0.0)
void agxTerrain::TerrainProperties::setSoilAggregateLockCompliance ( agx::Real  compliance,
agx::Int  dof 
)

Set the compliance of the soil aggregate lock joint the local constraint dimensions to relax or increase the force feedback interaction from shovel -terrain interaction.

Note
The z-direction (dof = 5) is perpendicular to the plane that the cutting edge and the top edge exists in, which is typically in the digging direction. dof: 0-2 = translational direction dof: 3-5 = rotational direction
Parameters
compliance- the compliance to set in the specified degree of freedom
dof- Target dof for the change of compliance
void agxTerrain::TerrainProperties::setSoilMergeSpeedThreshold ( agx::Real  speedThreshold)

Set the absolute lower speed (m/s) threshold where soil particles are allowed to merge with the terrain.

Parameters
speedThreshold- The lower speed threshold where soil particles are allowed to merge with the terrain. ( Default: 4 )
void agxTerrain::TerrainProperties::setSoilParticleGrowthRate ( agx::Real  growthRateFactor)

Set the rate factor in the algorithm for growing soil particles from fluid mass and particle resizing.

Parameters
growthRateFactor- the rate factor in the algorithm that governs particle growth from fluid mass and resizing. (Default: 0.125)
void agxTerrain::TerrainProperties::setSoilParticleLifeTime ( agx::Real  lifeTime)

Set the lifetime (s) of created soil particles in the terrain.

The particle will be deleted after existing for the specified lifetime.

Parameters
lifeTime- The lifetime of created particles. ( Default: Infinity )
void agxTerrain::TerrainProperties::setSoilParticleMergeRate ( agx::Real  mergeRate)

Set the merge rate for soil particles into the terrain.

The merge rate is defined as the fraction of the current particle mass that should be merged into the terrain for each second.

Parameters
mergeRate- the fraction of the current particle mass that should be merged into the terrain for each second. ( Default: 9)
void agxTerrain::TerrainProperties::setSoilParticleMergeThreshold ( agx::Real  radiusFraction)

Set the fraction of the particle nominal radius that will trigger instant merge of soil particles into the terrain during merging.

Parameters
radiusFraction- the fraction of the particle nominal radius that will trigger instant merge for a particle. (Default: 0.4)
Note
- radiusFractionvalue must be in the interval (0, 1.0] to be valid ( zero excluded ).
void agxTerrain::TerrainProperties::setSoilParticleSizeScaling ( float  scalingFactor)

Set soil particle size scaling factor.

The soil particle size scaling factor scales the nominal radius that the algorithm will aim for during the dynamic resizing of particles that occur during terrain interaction. This is used to alter the desired number of soil particles in the terrain. Default value: 1.0

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

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.


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