 |
AGX Dynamics
2.38.0.2
|
Go to the documentation of this file.
17 #ifndef AGXCONTROL_EVENTSENSOR_H
18 #define AGXCONTROL_EVENTSENSOR_H
19 #include <agx/config.h>
110 virtual void contactCallback(agx::Physics::ParticleGeometryContactInstance contact,
111 agx::Physics::ParticleData& particleData,
112 agx::Physics::GeometryData& geometryData);
155 void removeAllGroups();
164 bool addSensorEvent(
SensorEvent* sEvent,
int priority = 0);
198 void setTriggerFlag(
int flag);
203 int getTriggerFlag();
208 void setCollisionMask(
int mask);
213 int getCollisionMask();
228 bool wasParticleRemovedBySensor(
agx::UInt32 particle );
233 bool wasRigidBodyRemovedBySensor(
agx::UInt32 rigidBody );
240 void setEnableBlocker(
bool isBlocker);
245 bool getEnableBlocker();
272 virtual void addNotification()
override;
278 virtual void removeNotification()
override;
308 agx::Real getNumParticlesInSensor()
const;
313 agx::Real getNumParticleParticleContactsInSensor();
323 agx::Real getRemovedParticleMass()
const;
333 agx::UInt getNumRemovedParticles()
const;
346 bool hasOnlyReference();
356 void registerRemovedParticle(
agx::Physics::ParticlePtr particle );
358 void registerRemovedBody(
agx::RigidBody* body );
361 void setRealDummyMethod(
agx::
Real ) { }
366 template <typename T>
375 inline operator T () {
378 inline operator const T ()
const {
381 inline operator int ()
const {
397 typedef std::map<agx::Uuid, EventPrioHolder<SensorEventRef> >
SensorEvents;
427 agx::Physics::ParticleGeometryContactInstance contactIn,
428 agx::Physics::ParticleData& particleDataIn,
429 agx::Physics::GeometryData& geometryDataIn)
430 :t(tIn),contact(contactIn), particleData(particleDataIn), geometryData(geometryDataIn)
434 agx::Physics::ParticleGeometryContactInstance
contact;
448 void constructSortedEventList();
454 void clearContactInformation();
456 void refreshParticlesInsideSensorData();
458 void refreshRigidBodiesInsideSensorData();
464 void triggerContactEvents();
466 void triggerEvents();
468 void triggerPostContactHandling();
470 void triggerEventAddNotification();
476 agx::Physics::ParticleGeometryContactInstance contact,
477 agx::Physics::ParticleData& particleData,
478 agx::Physics::GeometryData& geometryData);
480 void triggerParticleEvents();
484 agx::Physics::ParticleGeometryContactInstance contact,
485 agx::Physics::ParticleData& particleData,
486 agx::Physics::GeometryData& geometryData);
490 agx::Physics::ParticleGeometryContactInstance contact,
491 agx::Physics::ParticleData& particleData,
492 agx::Physics::GeometryData& geometryData);
495 agx::Physics::ParticleGeometryContactInstance contact,
496 agx::Physics::ParticleData& particleData,
497 agx::Physics::GeometryData& geometryData);
agx::UInt m_numRemovedParticles
agx::HashSet< agx::RigidBody * > m_rigidBodiesInsideSensor
Holds pointers to the current rigid bodies (DEM Objects) where the midpoint is INSIDE the sensor.
ParticlePairContactVector m_particlePairContacts
Derive from this class to implement a listener for simulation step events.
agx::SymmetricPair< agx::Physics::GeometryPtr > GeometryPair
agx::Physics::ParticleGeometryContactInstance contact
This namespace contains general operation and action classes which can be used to control a agxSDK::S...
ParticleContactListenerRef m_particleContactListener
agx::Physics::GeometryData & geometryData
The rigid body class, combining a geometric model and a frame of reference.
agxCollide::Geometry * m_geometry
The coupled geometry of the sensor.
agxSDK::CollisionGroupFilter * m_filter
#define DOXYGEN_END_INTERNAL_BLOCK()
Placeholder for information regarding the particle contacts.
ParticleContactInformation(const agx::TimeStamp tIn, agx::Physics::ParticleGeometryContactInstance contactIn, agx::Physics::ParticleData &particleDataIn, agx::Physics::GeometryData &geometryDataIn)
#define DOXYGEN_START_INTERNAL_BLOCK()
TriggerEventStages
Defines the event execution states when the SensorEvents are executed during the timestep of the dete...
agx::HashSet< agx::UInt32 > m_removedParticles
agx::Vector< agxControl::SensorEvent * > SensorEventVector
EventPrioHolder(T obj, int priority)
agx::HashSet< agx::UInt32 > m_particlesInSensor
Holds a set of the current particle id:s that are present in the sensor.
AGXPHYSICS_EXPORT void addGroup(const agx::RigidBody *body, unsigned id)
For the specified body, add the collision group ID to its geometries.
static agx::UInt32Vector g_forbiddenParticles
agx::List< EventPrioHolder< SensorEventRef > > SensorEventList
GeometryContactEventListenerRef m_contactListener
Listeners that are coupled with the sensor.
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Vector containing 'raw' data.
agxSDK::CollisionGroupFilterRef m_filter
The collision group filter coupled with the ContactEventListener.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
This class is for detecting and handling particle collisions with geometries in the simulation.
#define AGXPHYSICS_EXPORT
agx::HashSet< agx::RigidBody * > m_rigidBodiesContactingSensor
Holds pointers to the current rigid bodies (DEM Objects) in the sensor.
std::map< agx::Uuid, EventPrioHolder< SensorEventRef > > SensorEvents
const T sensorEvent() const
int m_priority
Priority of the sensor over all the other sensors.
agx::Physics::ParticleData & particleData
This is a sensor class that can be attached to an geometry in the simulation.
#define AGX_DECLARE_VECTOR_TYPES(type)
agx::Real m_removedBodyMass
bool m_isBlocker
True if the sensor should block the contact from other sensors in the scene under the same timestep.
int m_triggerFlag
Flag for when the events are supposed to be executed during the time-step.
bool hasComputedParticlePairContactsInSensor
Vector that stores particle pair contacts. Will only be computed if the user asks for it (getParticle...
agx::Vector< ParticleContactInformation > ParticleContactQueue
GeometryContactQueue m_geomContactQueue
Queues for the contacts.
static agxCollide::GeometryPtrVector g_forbiddenGeometries
The geometry representation used by the collision detection engine.
Representation of a name string.
agx::Vector< agx::Physics::ParticlePairContactPtr > ParticlePairContactVector
#define AGX_DECLARE_POINTER_TYPES(type)
AGXPHYSICS_EXPORT void removeGroup(const agx::RigidBody *body, unsigned id)
For the specified body, remove the collision group ID to its geometries.
agx::HashSet< agx::UInt32 > m_particlesInsideSensor
Holds a set of the current particle id:s whose midpoint is inside the sensor.
A sensor event is an event triggered when the sensor is activated by a contact.
An ExecuteFilter that is used to filter out contacts matching a specified criteria based on Collision...
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
SensorEvents m_sensorEvents
agx::Real m_removedParticleMass
int m_collisionMask
Get the collision mask for the sensor.
bool m_particleCollision
Flags for doing when there is a collision for a particle or geometry.
agx::UInt m_numRemovedBodies
@ SENSOR_PRE_STEP
Triggered in a PRE solve/integration step.
agx::Vector< ContactInformation > GeometryContactQueue
agx::HashSet< agx::UInt32 > m_removedBodies
Holds a set of the current particles and bodies that have been marked as removed by an Operation duri...
SensorEventList m_sensorEventList
ParticleContactQueue m_particleContactQueue