 |
AGXDynamics
2.35.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();
230 void setEnableBlocker(
bool isBlocker);
235 bool getEnableBlocker();
262 virtual void addNotification()
override;
268 virtual void removeNotification()
override;
293 agx::Real getNumParticlesInSensor()
const;
298 agx::Real getNumParticleParticleContactsInSensor();
306 bool hasOnlyReference();
312 void setRealDummyMethod(
agx::
Real ) { }
317 template <typename T>
326 inline operator T () {
329 inline operator const T ()
const {
332 inline operator int ()
const {
348 typedef std::map<agx::Uuid, EventPrioHolder<SensorEventRef> >
SensorEvents;
378 agx::Physics::ParticleGeometryContactInstance contactIn,
379 agx::Physics::ParticleData& particleDataIn,
380 agx::Physics::GeometryData& geometryDataIn)
381 :t(tIn),contact(contactIn), particleData(particleDataIn), geometryData(geometryDataIn)
385 agx::Physics::ParticleGeometryContactInstance
contact;
399 void constructSortedEventList();
405 void clearContactInformation();
407 void refreshParticlesInsideSensorData();
409 void refreshRigidBodiesInsideSensorData();
415 void triggerContactEvents();
417 void triggerEvents();
419 void triggerPostContactHandling();
421 void triggerEventAddNotification();
427 agx::Physics::ParticleGeometryContactInstance contact,
428 agx::Physics::ParticleData& particleData,
429 agx::Physics::GeometryData& geometryData);
431 void triggerParticleEvents();
435 agx::Physics::ParticleGeometryContactInstance contact,
436 agx::Physics::ParticleData& particleData,
437 agx::Physics::GeometryData& geometryData);
441 agx::Physics::ParticleGeometryContactInstance contact,
442 agx::Physics::ParticleData& particleData,
443 agx::Physics::GeometryData& geometryData);
446 agx::Physics::ParticleGeometryContactInstance contact,
447 agx::Physics::ParticleData& particleData,
448 agx::Physics::GeometryData& geometryData);
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::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)
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.
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
SensorEvents m_sensorEvents
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.
@ SENSOR_PRE_STEP
Triggered in a PRE solve/integration step.
agx::Vector< ContactInformation > GeometryContactQueue
SensorEventList m_sensorEventList
ParticleContactQueue m_particleContactQueue