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

Class that contains information about a terrain contact between an external object and the terrain geometry. More...

#include <TerrainContact.h>

+ Inheritance diagram for agxTerrain::TerrainContact:

Classes

struct  SurfaceForce
 Struct holding information about a surface force of the Terrain contact. More...
 

Public Types

typedef agx::Vector< SurfaceForce > SurfaceForceVector
 

Public Member Functions

 TerrainContact ()
 Internal method. More...
 
 TerrainContact (const agxCollide::Geometry *geometry, const TerrainIndexToDepthTable terrainIndicesToDepth, const agx::Real area, const agx::Real meanGridDepth, const agx::Real currentContactTime, const agx::Bound3 contactBound)
 Internal method. 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
 
agx::Real calculateTotalForce () const
 
agx::Real getArea () const
 Get the contact area. More...
 
agx::Bound3 getContactBound () const
 The 3D bound spanned by the contact points of the colliding geometry. More...
 
agx::Real getCurrentContactTime () const
 Get the time that the colliding geometry has been in contact with the terrain. More...
 
const TerrainIndexToDepthTable & getDepthTable () const
 Get the table which holds information about the contact depth at each terrain index in the contact area. More...
 
const agxCollide::Geometry * getGeometry () const
 Get the geometry colliding with the terrain. More...
 
agx::Real getMaxSurfaceForce () const
 Get the maximum force of the Terrain contact from the associated contact points. More...
 
agx::Real getMeanGridDepth () const
 Get the mean depth of the intersected grid points in the TerrainContact. More...
 
int getReferenceCount () const
 
agx::Real getSurfaceForce () const
 Get the total surface force of the Terrain contact from all the contact points. More...
 
const SurfaceForceVector & getSurfacePointForces () const
 Get the surface point forces active in the Terrain contact. More...
 
agx::Real getSurfaceStress () const
 Get the average surface stress of the contact which is calculated using the approximated contact area and the total surface force of the contact. More...
 
agx::Real getSurfaceStressInIndex (const agx::Vec2i &terrainIndex) const
 Get the specific contact stress in a terrain index in the contact by scaling the average stress with the depth in the specific index. More...
 
template<typename T >
bool is () const
 Subclass test. 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 setContactArea (agx::Real area)
 Internal method. More...
 
void setSurfaceForce (agx::Real surfaceForce)
 Internal method. More...
 
void setSurfacePointForces (const SurfaceForceVector &pointForces)
 Internal method. More...
 
void setSurfaceStress (agx::Real surfaceStress)
 Internal method. 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

virtual ~TerrainContact ()
 Reference counted object - protected destructor. More...
 
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 that contains information about a terrain contact between an external object and the terrain geometry.

The contact contains an estimated area calculated from grid points intersecting the colliding geometry as well as mean stress calculated from estimated area and contact forces. Stress distribution can also be estimated by scaling the surface stress with the depth in each grid point.

This data container is used primarily in soil compaction calculation.

Definition at line 40 of file TerrainContact.h.

Member Typedef Documentation

Constructor & Destructor Documentation

agxTerrain::TerrainContact::TerrainContact ( )

Internal method.

Default constructor

agxTerrain::TerrainContact::TerrainContact ( const agxCollide::Geometry *  geometry,
const TerrainIndexToDepthTable  terrainIndicesToDepth,
const agx::Real  area,
const agx::Real  meanGridDepth,
const agx::Real  currentContactTime,
const agx::Bound3  contactBound 
)

Internal method.

Construct a Terrain contact with specified arguments.

virtual agxTerrain::TerrainContact::~TerrainContact ( )
protectedvirtual

Reference counted object - protected destructor.

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
agx::Real agxTerrain::TerrainContact::calculateTotalForce ( ) const
void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
agx::Real agxTerrain::TerrainContact::getArea ( ) const

Get the contact area.

The contact area is approximated by doing intersection tests between the colliding geometry and the terrain in grid points close to the contact points. All the grid points which intersect the collider are used when calculating the total area which is given by: number_of_grid_points * gridElementArea.

Returns
The approximated contact area from intersected grid points.
agx::Bound3 agxTerrain::TerrainContact::getContactBound ( ) const

The 3D bound spanned by the contact points of the colliding geometry.

Returns
The contact bound.
agx::Real agxTerrain::TerrainContact::getCurrentContactTime ( ) const

Get the time that the colliding geometry has been in contact with the terrain.

Mainly used in compression calculation in order to include compression rate relaxation.

Returns
The current contact time of the Terrain contact.
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
const TerrainIndexToDepthTable& agxTerrain::TerrainContact::getDepthTable ( ) const

Get the table which holds information about the contact depth at each terrain index in the contact area.

Returns
The geometry colliding with the terrain.
const agxCollide::Geometry* agxTerrain::TerrainContact::getGeometry ( ) const

Get the geometry colliding with the terrain.

Returns
The geometry colliding with the terrain.
agx::Real agxTerrain::TerrainContact::getMaxSurfaceForce ( ) const

Get the maximum force of the Terrain contact from the associated contact points.

Returns
The total surface force of the Terrain contact.
agx::Real agxTerrain::TerrainContact::getMeanGridDepth ( ) const

Get the mean depth of the intersected grid points in the TerrainContact.

Returns
The mean depth of the Terrain contact.
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agx::Real agxTerrain::TerrainContact::getSurfaceForce ( ) const

Get the total surface force of the Terrain contact from all the contact points.

Note
- This is only accessible in post-update of the simulation
Returns
The total surface force of the Terrain contact.
const SurfaceForceVector& agxTerrain::TerrainContact::getSurfacePointForces ( ) const

Get the surface point forces active in the Terrain contact.

The surface point forces consists of the contact points in the associated geometry contact, which has been projected onto the terrain surface.

Returns
The surface points forces in the Terrain contact.
agx::Real agxTerrain::TerrainContact::getSurfaceStress ( ) const

Get the average surface stress of the contact which is calculated using the approximated contact area and the total surface force of the contact.

Returns
The average surface stress of the contact.
agx::Real agxTerrain::TerrainContact::getSurfaceStressInIndex ( const agx::Vec2i &  terrainIndex) const

Get the specific contact stress in a terrain index in the contact by scaling the average stress with the depth in the specific index.

Returns
The specific surface stress in the contact terrain index.
template<typename T >
bool agx::Referenced::is ( ) const
inherited
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::TerrainContact::setContactArea ( agx::Real  area)

Internal method.

Set the contact area of the contact.

Parameters
area- The surface area of the contact.
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::TerrainContact::setSurfaceForce ( agx::Real  surfaceForce)

Internal method.

Set the surface force of the contact.

Parameters
surfaceForce- The surface force to set on the contact
void agxTerrain::TerrainContact::setSurfacePointForces ( const SurfaceForceVector &  pointForces)

Internal method.

Set the surface point forces of the contact.

Parameters
pointForces- The point forces to set on the contact.
void agxTerrain::TerrainContact::setSurfaceStress ( agx::Real  surfaceStress)

Internal method.

Set the surface stress of the contact.

Parameters
surfaceStress- The surface stress to set.
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: