AGX Dynamics  2.35.0.1
agxTerrain::TerrainToolCollection Class Reference

Collection of terrain tool (currently Shovel) related objects which are terrain instance specific. More...

#include <TerrainToolCollection.h>

+ Inheritance diagram for agxTerrain::TerrainToolCollection:

Public Member Functions

 TerrainToolCollection (Terrain *terrain, Shovel *shovel)
 Construct given terrain and shovel. More...
 
void clearActiveZoneWedges () const
 Clear the active zone wedges of the primary active zones and deformers. More...
 
bool collisionGeometriesAreInsideTerrain () const
 Check if any of the collision geometries are inside terrain bounds. More...
 
void enable (bool enabled)
 Set enable/disable of the ToolCollection. More...
 
PrimaryActiveZone * getActiveZone () const
 
AggregateContactGenerator * getAggregateContactGenerator () const
 
agx::Real getAggregateTerrainContactDepth (Shovel::ExcavationMode excavationMode) const
 
DeformController * getDeformController () const
 
bool getEnable ()
 
agx::Frame * getParentFrame () const
 
SoilPenetrationResistance * getPenetrationResistance () const
 
agx::Bool getSetZeroAggregateVelocity () const
 
Shovel * getShovel () const
 
ShovelAggregateContactMaterialContainer * getShovelTerrainContactMaterialContainer ()
 
SoilParticleAggregate * getSoilParticleAggregate () const
 
Terrain * getTerrain () const
 
const agxCollide::GeometryRefVector & getVoxelCollisionGeometries () const
 
const agx::RigidBody * getWedgeAggregate (Shovel::ExcavationMode excavationMode) const
 
void handleEnableChange ()
 Update ToolCollection if shovel enable has changed. More...
 
virtual agx::Bool initialize (agxSDK::Simulation *simulation)
 
agx::Bool initialized () const
 
virtual void onPost ()
 Callback from terrain post-solve. More...
 
virtual void onPre ()
 Callback from terrain pre-solve. More...
 
virtual void onPreCollide ()
 Callback from terrain preCollide. More...
 
void setActiveZone (PrimaryActiveZone *activeZone)
 Assign active zone for the shovel in this terrain. More...
 
void setAggregateContactGenerator (AggregateContactGenerator *aggregateContactGenerator)
 Assign aggregate contact generator for the soil particle aggregate in this terrain. More...
 
void setDeformController (DeformController *deformController)
 Assign aggregate contact generator for the soil particle aggregate in this terrain. More...
 
void setEnableShovelTerrainGeometryContacts (bool enable)
 Set if regular geometry contacts should be created between the shovel geometries and the associated terrain geometry. More...
 
void setPenetrationResistance (SoilPenetrationResistance *penetrationResistance)
 Assign penetration resistance instance for the shovel in this terrain. More...
 
void setSoilParticleAggregate (SoilParticleAggregate *soilParticleAggregate)
 Assign soil particle aggregate for the shovel in this terrain. More...
 
void setVoxelCollisionGeometries (const agxCollide::GeometryRefVector &geometries)
 Assign collision geometries used to test voxel overlaps. More...
 
void setZeroAggregateVelocity (bool enable)
 Set whenever the innerbody aggregate should have zero velocity before solve step as opposed to using particle or cached post-solve velocities from the previous time step. More...
 
agx::Bool shouldUpdate ()
 
bool shovelEnableHasChanged () const
 
virtual void uninitialize (agxSDK::Simulation *simulation)
 
- 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...
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings. More...
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object. More...
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 

Protected Types

using Flags = agx::BitState< StateFlags, agx::UInt32 >
 
enum  StateFlags : agx::UInt32 { ENABLED = 1 << 0 , SHOVEL_ENABLED = 1 << 1 , SET_ZERO_AGGREGATE_VELOCITY = 1 << 2 }
 

Protected Member Functions

 TerrainToolCollection ()
 Default constructor used in serialization. More...
 
virtual ~TerrainToolCollection ()
 Reference counted object - protected destructor. More...
 
bool getShovelEnabled () const
 
void setEnable (bool enabled)
 
void setShovelEnabled (bool enabled)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor. More...
 
 Serializable (const Serializable &other)
 Copy constructor. More...
 
void generateUuid ()
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 
- 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...
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Collection of terrain tool (currently Shovel) related objects which are terrain instance specific.

Definition at line 35 of file TerrainToolCollection.h.

Member Typedef Documentation

◆ Flags

Definition at line 258 of file TerrainToolCollection.h.

Member Enumeration Documentation

◆ StateFlags

Enumerator
ENABLED 
SHOVEL_ENABLED 
SET_ZERO_AGGREGATE_VELOCITY 

Definition at line 252 of file TerrainToolCollection.h.

Constructor & Destructor Documentation

◆ TerrainToolCollection() [1/2]

agxTerrain::TerrainToolCollection::TerrainToolCollection ( Terrain *  terrain,
Shovel *  shovel 
)

Construct given terrain and shovel.

Parameters
terrain- terrain instance this collection belongs to
shovel- user shovel instance

◆ TerrainToolCollection() [2/2]

agxTerrain::TerrainToolCollection::TerrainToolCollection ( )
protected

Default constructor used in serialization.

◆ ~TerrainToolCollection()

virtual agxTerrain::TerrainToolCollection::~TerrainToolCollection ( )
protectedvirtual

Reference counted object - protected destructor.

Member Function Documentation

◆ clearActiveZoneWedges()

void agxTerrain::TerrainToolCollection::clearActiveZoneWedges ( ) const

Clear the active zone wedges of the primary active zones and deformers.

◆ collisionGeometriesAreInsideTerrain()

bool agxTerrain::TerrainToolCollection::collisionGeometriesAreInsideTerrain ( ) const

Check if any of the collision geometries are inside terrain bounds.

◆ enable()

void agxTerrain::TerrainToolCollection::enable ( bool  enabled)

Set enable/disable of the ToolCollection.

◆ getActiveZone()

PrimaryActiveZone* agxTerrain::TerrainToolCollection::getActiveZone ( ) const
Returns
shovel active zone specific for this terrain instance

◆ getAggregateContactGenerator()

AggregateContactGenerator* agxTerrain::TerrainToolCollection::getAggregateContactGenerator ( ) const
Returns
aggregate contact generator specific for this terrain instance

◆ getAggregateTerrainContactDepth()

agx::Real agxTerrain::TerrainToolCollection::getAggregateTerrainContactDepth ( Shovel::ExcavationMode  excavationMode) const
Returns
the current wedge aggregate depth in the specified collection given an excavation mode.

◆ getDeformController()

DeformController* agxTerrain::TerrainToolCollection::getDeformController ( ) const
Returns
aggregate contact generator specific for this terrain instance

◆ getEnable()

bool agxTerrain::TerrainToolCollection::getEnable ( )
Returns
true if the ToolCollection is enabled

◆ getParentFrame()

agx::Frame* agxTerrain::TerrainToolCollection::getParentFrame ( ) const
Returns
parent frame located at model center of the shovel

◆ getPenetrationResistance()

SoilPenetrationResistance* agxTerrain::TerrainToolCollection::getPenetrationResistance ( ) const
Returns
shovel penetration resistance specific for this terrain instance

◆ getSetZeroAggregateVelocity()

agx::Bool agxTerrain::TerrainToolCollection::getSetZeroAggregateVelocity ( ) const
Returns
true if the innerbody aggregate should have zero velocity, false otherwise.

◆ getShovel()

Shovel* agxTerrain::TerrainToolCollection::getShovel ( ) const
Returns
user shovel instance

◆ getShovelEnabled()

bool agxTerrain::TerrainToolCollection::getShovelEnabled ( ) const
protected

◆ getShovelTerrainContactMaterialContainer()

ShovelAggregateContactMaterialContainer* agxTerrain::TerrainToolCollection::getShovelTerrainContactMaterialContainer ( )
Returns
the ShovelAggregateContactMaterialContainer that contains all contact materials explicitly set for this tool collection.

◆ getSoilParticleAggregate()

SoilParticleAggregate* agxTerrain::TerrainToolCollection::getSoilParticleAggregate ( ) const
Returns
soil particle aggregate specific for this terrain instance

◆ getTerrain()

Terrain* agxTerrain::TerrainToolCollection::getTerrain ( ) const
Returns
terrain instance this collection belongs to

◆ getVoxelCollisionGeometries()

const agxCollide::GeometryRefVector& agxTerrain::TerrainToolCollection::getVoxelCollisionGeometries ( ) const
Returns
the shovel geometries colliding with voxels in the terrain

◆ getWedgeAggregate()

const agx::RigidBody* agxTerrain::TerrainToolCollection::getWedgeAggregate ( Shovel::ExcavationMode  excavationMode) const
Returns
the current wedge aggregate in the specified collection given an excavation mode if it exists, nullptr otherwise.

◆ handleEnableChange()

void agxTerrain::TerrainToolCollection::handleEnableChange ( )

Update ToolCollection if shovel enable has changed.

◆ initialize()

virtual agx::Bool agxTerrain::TerrainToolCollection::initialize ( agxSDK::Simulation *  simulation)
virtual

◆ initialized()

agx::Bool agxTerrain::TerrainToolCollection::initialized ( ) const
Returns
true if initialized (initializes in addNotification) - otherwise false

◆ onPost()

virtual void agxTerrain::TerrainToolCollection::onPost ( )
virtual

Callback from terrain post-solve.

◆ onPre()

virtual void agxTerrain::TerrainToolCollection::onPre ( )
virtual

Callback from terrain pre-solve.

◆ onPreCollide()

virtual void agxTerrain::TerrainToolCollection::onPreCollide ( )
virtual

Callback from terrain preCollide.

◆ setActiveZone()

void agxTerrain::TerrainToolCollection::setActiveZone ( PrimaryActiveZone *  activeZone)

Assign active zone for the shovel in this terrain.

Parameters
activeZone- active zone instance

◆ setAggregateContactGenerator()

void agxTerrain::TerrainToolCollection::setAggregateContactGenerator ( AggregateContactGenerator *  aggregateContactGenerator)

Assign aggregate contact generator for the soil particle aggregate in this terrain.

Parameters
aggregateContactGenerator- aggregate contact generator instance

◆ setDeformController()

void agxTerrain::TerrainToolCollection::setDeformController ( DeformController *  deformController)

Assign aggregate contact generator for the soil particle aggregate in this terrain.

Parameters
deformController- aggregate contact generator instance

◆ setEnable()

void agxTerrain::TerrainToolCollection::setEnable ( bool  enabled)
protected

◆ setEnableShovelTerrainGeometryContacts()

void agxTerrain::TerrainToolCollection::setEnableShovelTerrainGeometryContacts ( bool  enable)

Set if regular geometry contacts should be created between the shovel geometries and the associated terrain geometry.

◆ setPenetrationResistance()

void agxTerrain::TerrainToolCollection::setPenetrationResistance ( SoilPenetrationResistance *  penetrationResistance)

Assign penetration resistance instance for the shovel in this terrain.

Parameters
penetrationResistance- penetration resistance instance

◆ setShovelEnabled()

void agxTerrain::TerrainToolCollection::setShovelEnabled ( bool  enabled)
protected

◆ setSoilParticleAggregate()

void agxTerrain::TerrainToolCollection::setSoilParticleAggregate ( SoilParticleAggregate *  soilParticleAggregate)

Assign soil particle aggregate for the shovel in this terrain.

Parameters
soilParticleAggregate- soil particle aggregate instance

◆ setVoxelCollisionGeometries()

void agxTerrain::TerrainToolCollection::setVoxelCollisionGeometries ( const agxCollide::GeometryRefVector &  geometries)

Assign collision geometries used to test voxel overlaps.

Parameters
geometries- voxel collision geometries

◆ setZeroAggregateVelocity()

void agxTerrain::TerrainToolCollection::setZeroAggregateVelocity ( bool  enable)

Set whenever the innerbody aggregate should have zero velocity before solve step as opposed to using particle or cached post-solve velocities from the previous time step.

Parameters
enable- true if the innerbody aggregate should have zero velocity, false otherwise.

◆ shouldUpdate()

agx::Bool agxTerrain::TerrainToolCollection::shouldUpdate ( )
Returns
true if the ToolCollection should update in preCollide, pre and post

◆ shovelEnableHasChanged()

bool agxTerrain::TerrainToolCollection::shovelEnableHasChanged ( ) const
Returns
true if shovel enable has changed, mismatching the collection internal shovel enable variable

◆ uninitialize()

virtual void agxTerrain::TerrainToolCollection::uninitialize ( agxSDK::Simulation *  simulation)
virtual

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