AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
agxTerrain::ExternalDeformer Class Reference

ExternaDeformer is a TerrainToolInstance class that models deformer surfaces that are not attached to a shovel object. More...

#include <ExternalDeformer.h>

+ Inheritance diagram for agxTerrain::ExternalDeformer:

Public Member Functions

 ExternalDeformer (agx::RigidBody *parentBody)
 Empty constructor, for creating a external deformer body to which can be added multiple deformers later.
 
 ExternalDeformer (agx::RigidBody *parentBody, const agx::Line &cuttingEdge, const agx::Line &topEdge, const agx::Vec3 &cuttingDirection)
 Basic constructor.
 
void addDeformer (const agx::Line &cuttingEdge, const agx::Line &topEdge, const agx::Vec3 &cuttingDirection)
 Add new deformer.
 
bool collisionGeometriesAreInsideTerrain (Terrain *terrain) const
 Check if any of the collision geometries are inside terrain bounds.
 
TerraingetActiveTerrain () const
 
DeformControllergetDeformController () const
 
agx::RigidBodygetRigidBody () const
 
const agxCollide::GeometryRefVectorgetVoxelCollisionGeometries () const
 
bool isActive () const
 
virtual bool isValid () const override
 
- Public Member Functions inherited from agxSDK::TerrainToolInstance
void addEventListener (agxSDK::StepEventListener *listener)
 Add a StepEventListener which follows the shovel - ie added and removed from a simulation at the same time as the shovel is added/removed from the simulation.
 
agxSDK::SimulationgetSimulation () const
 
virtual bool isValid () const =0
 
bool removeEventListener (agxSDK::StepEventListener *listener)
 Remove an added StepEventListener from the shovel.
 
- Public Member Functions inherited from agx::Component
 Component (const agx::Name &name=agx::Name(), agx::Model *model=agx::Component::ClassModel(), agx::Device *device=nullptr)
 
virtual void addObject (agx::Object *object, bool assignContext=true)
 Add an object to the component.
 
virtual String autoComplete (const String &partialName, StringVector &matchingNames) const
 
virtual void buildNavigationTree (agxJson::Value &eNode) const override
 
void configure (Model *model)
 
virtual void configure (TiXmlElement *eComponent) override
 
agx::DevicegetDevice ()
 
template<typename T >
T * getDevice ()
 
const agx::DevicegetDevice () const
 
template<typename T >
const T * getDevice () const
 
size_t getNumObjects (const agx::Name &name) const
 
agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0) const
 
agx::ObjectgetObject (const agx::Name &name, size_t index=0)
 
template<typename T >
T * getObject (const agx::Name &name, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, size_t index=0) const
 
template<typename T >
const T * getObject (const agx::Name &name, size_t index=0) const
 
const agx::ObjectRefVectorgetObjects () const
 
template<typename T >
void getObjects (agx::ObjectPtrVector &result, bool recursive=false) const
 
void getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const
 
virtual ObjectgetResourceImpl (const Path &path, agx::Model *model) override
 
virtual void printSubtree () const override
 
void printSubtree (std::ostream &stream, int depth=0) const
 
virtual void rebind () override
 
void removeAllObjects ()
 Remove all components.
 
virtual void removeObject (agx::Object *object)
 Remove an object from the component.
 
void removeObject (const agx::Name &name, size_t index=0)
 Remove an object with a specified name (and optional index) from the component.
 
virtual void snapshot (TiXmlNode *eParent, const String &directory) const override
 
void traverse (ComponentVisitor *)
 
void traverse (const TraverseCallback &callback)
 
- Public Member Functions inherited from agx::Object
 Object (const Name &name=Name(), Model *model=Object::ClassModel())
 
void addListener (EventListener *listener)
 
virtual void buildNavigationTree (agxJson::Value &eNode) const
 
virtual void configure (TiXmlElement *)
 
agx::String fullName () const
 
agx::String fullPath () const
 
agx::String fullPath (const agx::Object *root) const
 
template<typename T >
T * getAutoScopedResource (const agx::Path &path)
 
template<typename T >
const T * getAutoScopedResource (const agx::Path &path) const
 
agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const
 
agx::ObjectgetContext ()
 
template<typename T >
T * getContext ()
 
const agx::ObjectgetContext () const
 
template<typename T >
const T * getContext () const
 
agx::UInt32 getId () const
 
const agx::NamegetImplementationName () const
 
agx::ModelgetModel ()
 
const agx::ModelgetModel () const
 
const agx::NamegetName () const
 
agx::ObjectgetNextSibling ()
 
const agx::ObjectgetNextSibling () const
 
agx::Path getPath () const
 
agx::Path getPath (const agx::Object *root) const
 
template<typename T >
T * getResource (const agx::Path &path)
 
template<typename T >
const T * getResource (const agx::Path &path) const
 
agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr) const
 
virtual agx::ObjectgetResourceImpl (const agx::Path &path, agx::Model *model)
 
agx::ObjectgetRootContext ()
 
const agx::ObjectgetRootContext () const
 
bool hasListener (EventListener *listener)
 
bool hasParent (const agx::Object *node) const
 
bool isUnique () const
 
virtual void printSubtree () const
 
virtual void rebind ()
 
void removeListener (EventListener *listener)
 
virtual void save (TiXmlElement *) const
 
virtual void setContext (agx::Object *context)
 
void setId (UInt32 id)
 
void setModel (agx::Model *model)
 Set the object model (handled automatically).
 
void setName (const agx::Name &name)
 Set the name of the object.
 
virtual void snapshot (TiXmlNode *, const String &) const
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
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.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Protected Member Functions

 ExternalDeformer ()
 Default constructor used in serialization.
 
virtual ~ExternalDeformer ()
 Reference counted object - protected destructor.
 
virtual void addNotification () override
 Add notification when a deformer is added to a simulation.
 
void checkContactMaterials ()
 
void clearActiveZoneWedges () const
 Clear the active zone wedges of the deformer active zones.
 
agx::FramecreateParentFrame ()
 
agxSDK::TerrainManager * getTerrainManager ()
 
TerrainPtrVec getTerrainsInSimulation ()
 
void initalizeContactMaterialsForExistingTerrains (agxSDK::Simulation *simulation)
 Initialize contact materials when added to simulation.
 
virtual void last () override
 Callback to be executed at the end of the time step Deformer and Terrain step events are synchronized via the TerrainManager.
 
virtual void post () override
 Executes post-step events for agxTerrain::ExternalDeformer in the simulation.
 
virtual void pre () override
 Executes pre-step events for agxTerrain::ExternalDeformer in the simulation.
 
virtual void preCollide () override
 Executes pre-collide events for agxTerrain::ExternalDeformer in the simulation.
 
virtual void removeNotification () override
 Remove notification when this deformer is removed from a simulation.
 
void setAggregateMaterial (agx::Material *material)
 Set the common material used by the SoilParticleAggregates inside the deformers.
 
- Protected Member Functions inherited from agxSDK::TerrainToolInstance
 TerrainToolInstance ()
 Default constructor.
 
virtual ~TerrainToolInstance ()
 Reference counted object - protected destructor.
 
virtual void addNotification ()
 
virtual void last ()
 
virtual void post ()
 
virtual void pre ()
 
virtual void preCollide ()
 
virtual void removeNotification ()
 
- Protected Member Functions inherited from agx::Component
virtual ~Component ()
 
String expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const
 
void setDevice (Device *device)
 
- Protected Member Functions inherited from agx::Object
virtual ~Object ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

Terrainm_activeTerrain
 
agx::MaterialRef m_aggregateMaterial
 
agxCollide::BoundingAABB m_collisionBound
 
DeformControllerRef m_deformController
 
agx::Vector< DeformerCollectionRefm_deformers
 
bool m_isActive
 
agx::RigidBodyRef m_parentBody
 
agx::FrameRef m_parentFrame
 
agxCollide::GeometryRefVector m_voxelCollisionGeometries
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Public Types inherited from agx::Component
typedef Event2< Component *, Object * > ObjectEvent
 Event when adding removing child objects.
 
typedef Callback1< Object * > TraverseCallback
 
- Public Types inherited from agx::Object
typedef agx::observer_ptr< const EventEventConstObserver
 
typedef agx::ref_ptr< const EventEventConstRef
 
typedef agx::observer_ptr< EventEventObserver
 
typedef agx::Vector< EventObserverEventObserverVector
 
typedef agx::VectorPOD< Event * > EventPtrVector
 
typedef agx::ref_ptr< EventEventRef
 
typedef agx::Vector< EventRefEventRefVector
 
- Static Public Member Functions inherited from agx::Component
static Component_load (TiXmlElement *eComponent, Device *device)
 
static agx::ModelClassModel ()
 
static Componentload (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path())
 
static Componentload (const String &path, const Path &_namespace=Path())
 
static Componentload (const String &path, Device *device, const Path &_namespace=Path())
 
static Componentload (TiXmlElement *eComponent, Device *device)
 
- Static Public Member Functions inherited from agx::Object
static agx::ModelClassModel ()
 
static agx::String generateName (const agx::String &bindPath)
 
static const HashSet< Object * > & getActiveObjects ()
 
static bool getEnableRebind ()
 Should rebinding be allowed? Right now a global setting.
 
static Objectload (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
static Objectload (const String &path, Device *device, const String &type="", size_t instance=0)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
static void load (const String &path, Device *device, ObjectPtrVector &loadedObjects)
 
static Objectload (TiXmlElement *eObject, Device *device)
 
template<typename T >
static T * load (TiXmlElement *eObject, Device *device)
 
static TiXmlDocument openDocument (const String &path)
 
static void setEnableRebind (bool flag)
 Sets if rebinding of objects should be allowed (Right now a global setting).
 
- 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.
 
- Public Attributes inherited from agx::Component
ObjectEvent addObjectEvent
 
ObjectEvent removeObjectEvent
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

ExternaDeformer is a TerrainToolInstance class that models deformer surfaces that are not attached to a shovel object.

Deformers are used to have surfaces push and deform terrain (but not dig in the terrain).

A shovel object has three deformers on the bottom and two sides. However, the ExternalDeformer object can be attached to any surface that should be deforming the terrain when the surface is being pushed against the terrain. For example the sides of a track model that is turning, or any heavy objects that are being pushed in the soil.

Definition at line 56 of file ExternalDeformer.h.

Constructor & Destructor Documentation

◆ ExternalDeformer() [1/3]

agxTerrain::ExternalDeformer::ExternalDeformer ( agx::RigidBody parentBody,
const agx::Line cuttingEdge,
const agx::Line topEdge,
const agx::Vec3 cuttingDirection 
)

Basic constructor.

Parameters
parentBody- The parent body of the external deformer.
cuttingEdge- The lowest edge on the deformer, specified in the LOCAL parentBody frame that serves as the cutting edge of the active zone.
topEdge- The top edge of the active zone, specified in the LOCAL parentBody frame that will be created in front of the deformer.
cuttingDirection- The cutting direction of the deformer.

◆ ExternalDeformer() [2/3]

agxTerrain::ExternalDeformer::ExternalDeformer ( agx::RigidBody parentBody)

Empty constructor, for creating a external deformer body to which can be added multiple deformers later.

◆ ExternalDeformer() [3/3]

agxTerrain::ExternalDeformer::ExternalDeformer ( )
protected

Default constructor used in serialization.

◆ ~ExternalDeformer()

virtual agxTerrain::ExternalDeformer::~ExternalDeformer ( )
protectedvirtual

Reference counted object - protected destructor.

Member Function Documentation

◆ addDeformer()

void agxTerrain::ExternalDeformer::addDeformer ( const agx::Line cuttingEdge,
const agx::Line topEdge,
const agx::Vec3 cuttingDirection 
)

Add new deformer.

◆ addNotification()

virtual void agxTerrain::ExternalDeformer::addNotification ( )
overrideprotectedvirtual

Add notification when a deformer is added to a simulation.

Reimplemented from agxSDK::TerrainToolInstance.

◆ checkContactMaterials()

void agxTerrain::ExternalDeformer::checkContactMaterials ( )
protected

◆ clearActiveZoneWedges()

void agxTerrain::ExternalDeformer::clearActiveZoneWedges ( ) const
protected

Clear the active zone wedges of the deformer active zones.

◆ collisionGeometriesAreInsideTerrain()

bool agxTerrain::ExternalDeformer::collisionGeometriesAreInsideTerrain ( Terrain terrain) const

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

◆ createParentFrame()

agx::Frame * agxTerrain::ExternalDeformer::createParentFrame ( )
protected

◆ getActiveTerrain()

Terrain * agxTerrain::ExternalDeformer::getActiveTerrain ( ) const

◆ getDeformController()

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

◆ getRigidBody()

agx::RigidBody * agxTerrain::ExternalDeformer::getRigidBody ( ) const
Returns
the base rigid body from the ExternalDeformer object.

◆ getTerrainManager()

agxSDK::TerrainManager * agxTerrain::ExternalDeformer::getTerrainManager ( )
protected

◆ getTerrainsInSimulation()

TerrainPtrVec agxTerrain::ExternalDeformer::getTerrainsInSimulation ( )
protected

◆ getVoxelCollisionGeometries()

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

◆ initalizeContactMaterialsForExistingTerrains()

void agxTerrain::ExternalDeformer::initalizeContactMaterialsForExistingTerrains ( agxSDK::Simulation simulation)
protected

Initialize contact materials when added to simulation.

◆ isActive()

bool agxTerrain::ExternalDeformer::isActive ( ) const

◆ isValid()

virtual bool agxTerrain::ExternalDeformer::isValid ( ) const
overridevirtual

◆ last()

virtual void agxTerrain::ExternalDeformer::last ( )
overrideprotectedvirtual

Callback to be executed at the end of the time step Deformer and Terrain step events are synchronized via the TerrainManager.

Reimplemented from agxSDK::TerrainToolInstance.

◆ post()

virtual void agxTerrain::ExternalDeformer::post ( )
overrideprotectedvirtual

Executes post-step events for agxTerrain::ExternalDeformer in the simulation.

Deformer and Terrain step events are synchronized via the TerrainManager.

Reimplemented from agxSDK::TerrainToolInstance.

◆ pre()

virtual void agxTerrain::ExternalDeformer::pre ( )
overrideprotectedvirtual

Executes pre-step events for agxTerrain::ExternalDeformer in the simulation.

Deformer and Terrain step events are synchronized via the TerrainManager. In the pre step we:

  • Filter contact points for the deformers
  • Calculate dead load fraction
  • Check and if need be, set the internal contact materials (this is a new ContactMaterial and transfer each pre step)
  • Run the onPre calls in all internal classes (aggregates, deformers, pen resistance)

Reimplemented from agxSDK::TerrainToolInstance.

◆ preCollide()

virtual void agxTerrain::ExternalDeformer::preCollide ( )
overrideprotectedvirtual

Executes pre-collide events for agxTerrain::ExternalDeformer in the simulation.

Deformer and Terrain step events are synchronized via the TerrainManager. In the preCollide step, we:

  • Check if the deformer is active by colliding with a terrain.
  • If we need to, we create soil wedges in the deformers. (onPreCollide calls)

Reimplemented from agxSDK::TerrainToolInstance.

◆ removeNotification()

virtual void agxTerrain::ExternalDeformer::removeNotification ( )
overrideprotectedvirtual

Remove notification when this deformer is removed from a simulation.

Reimplemented from agxSDK::TerrainToolInstance.

◆ setAggregateMaterial()

void agxTerrain::ExternalDeformer::setAggregateMaterial ( agx::Material material)
protected

Set the common material used by the SoilParticleAggregates inside the deformers.

Propagates the material into the internal classes.

Member Data Documentation

◆ m_activeTerrain

Terrain* agxTerrain::ExternalDeformer::m_activeTerrain
protected

Definition at line 238 of file ExternalDeformer.h.

◆ m_aggregateMaterial

agx::MaterialRef agxTerrain::ExternalDeformer::m_aggregateMaterial
protected

Definition at line 236 of file ExternalDeformer.h.

◆ m_collisionBound

agxCollide::BoundingAABB agxTerrain::ExternalDeformer::m_collisionBound
protected

Definition at line 240 of file ExternalDeformer.h.

◆ m_deformController

DeformControllerRef agxTerrain::ExternalDeformer::m_deformController
protected

Definition at line 233 of file ExternalDeformer.h.

◆ m_deformers

agx::Vector<DeformerCollectionRef> agxTerrain::ExternalDeformer::m_deformers
protected

Definition at line 243 of file ExternalDeformer.h.

◆ m_isActive

bool agxTerrain::ExternalDeformer::m_isActive
protected

Definition at line 239 of file ExternalDeformer.h.

◆ m_parentBody

agx::RigidBodyRef agxTerrain::ExternalDeformer::m_parentBody
protected

Definition at line 229 of file ExternalDeformer.h.

◆ m_parentFrame

agx::FrameRef agxTerrain::ExternalDeformer::m_parentFrame
protected

Definition at line 231 of file ExternalDeformer.h.

◆ m_voxelCollisionGeometries

agxCollide::GeometryRefVector agxTerrain::ExternalDeformer::m_voxelCollisionGeometries
protected

Definition at line 237 of file ExternalDeformer.h.


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