AGX Dynamics  2.35.0.1
GranularModelReductionOperations.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXCONTROL_GRANULARMODELREDUCTIONOPERATIONS_H
18 #define AGXCONTROL_GRANULARMODELREDUCTIONOPERATIONS_H
19 
20 #include <agxControl/SensorEvent.h>
22 
23 /*
24 This file defines some operations used in conjunction with the granular model reduction
25 */
26 namespace agxControl
27 {
29  {
30  public:
32 
33  void triggerEvent(const agx::TimeStamp& /*t*/, agxSDK::Simulation * simulation, agxCollide::GeometryContact *cd, agxControl::EventSensor * sensor) override;
34 
36  agxSDK::Simulation* /*simulation*/,
37  agx::Physics::ParticleGeometryContactInstance contact,
38  agx::Physics::ParticleData& particleData,
39  agx::Physics::GeometryData& /*geometryData*/,
40  agxControl::EventSensor* /*sensor*/) override;
41 
42  void postContactHandling(agxSDK::Simulation *simulation, EventSensor * sensor) override;
43 
45 
46  protected:
47  class ParticleStorageListener : public agxData::EntityStorage::EventListener
48  {
49  friend class SplitSensorOperation;
50  public:
52 
53  virtual void destroyInstanceCallback(agxData::EntityStorage* storage, agxData::EntityPtr instance) override;
55  virtual void destroyInstancesCallback(agxData::EntityStorage* storage, agxData::EntityRange instance) override;
56 
58  // Variables
60  protected:
62  };
64 
65  protected:
67 
69 
71 
73  // Variables
75  protected:
79  };
80 }
81 
82 #endif
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXPHYSICS_EXPORT
A contact between two geometries.
Definition: Contacts.h:270
This is a sensor class that can be attached to an geometry in the simulation.
Definition: EventSensor.h:48
A specific type of sensor event that triggers a change in the simulation when activated by a contact.
Definition: SensorEvent.h:118
virtual void destroyInstancesCallback(agxData::EntityStorage *storage, agxData::Array< agxData::EntityPtr > instances) override
virtual void destroyInstancesCallback(agxData::EntityStorage *storage, agxData::EntityRange instance) override
virtual void destroyInstanceCallback(agxData::EntityStorage *storage, agxData::EntityPtr instance) override
void postContactHandling(agxSDK::Simulation *simulation, EventSensor *sensor) override
Post function that will be triggered for the event after all the contacts have handled in the operati...
void triggerEvent(const agx::TimeStamp &, agxSDK::Simulation *simulation, agxCollide::GeometryContact *cd, agxControl::EventSensor *sensor) override
Triggers the sensor event by passing contact information.
void triggerParticleEvent(const agx::TimeStamp &, agxSDK::Simulation *, agx::Physics::ParticleGeometryContactInstance contact, agx::Physics::ParticleData &particleData, agx::Physics::GeometryData &, agxControl::EventSensor *) override
Triggers the sensor event by passing particle contact information.
void connectToParticleStorage(agx::ParticleSystem *system)
void singalParticleDestroyed(agx::Index id)
agx::HashSet< agx::Index > m_previousParticleIdsInSensor
SplitSensorOperation(const agx::Name &name=agx::Name())
Type-specific Array used for fast access into the data held by a Buffer.
Definition: Array.h:107
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition: EntityPtr.h:52
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:73
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Representation of a name string.
Definition: Name.h:33
A basic particle system that contains all the storages and buffers required for basic operation and a...
This namespace contains general operation and action classes which can be used to control a agxSDK::S...
agx::Real TimeStamp
Definition: TimeStamp.h:26
UInt32 Index
Definition: Integer.h:52