AGX Dynamics  2.37.2.0
GranularModelReductionOperations.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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:
31  SplitSensorOperation(const agx::Name& name = agx::Name());
32 
33  void triggerEvent(const agx::TimeStamp& /*t*/, agxSDK::Simulation * simulation, agxCollide::GeometryContact *cd, agxControl::EventSensor * sensor) override;
34 
35  void triggerParticleEvent(const agx::TimeStamp& /*t*/,
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;
54  virtual void destroyInstancesCallback(agxData::EntityStorage* storage, agxData::Array<agxData::EntityPtr> instances) override;
55  virtual void destroyInstancesCallback(agxData::EntityStorage* storage, agxData::EntityRange instance) override;
56 
58  // Variables
60  protected:
62  };
64 
65  protected:
66  virtual ~SplitSensorOperation();
67 
68  void connectToParticleStorage(agx::ParticleSystem* system);
69 
70  void singalParticleDestroyed(agx::Index id);
71 
73  // Variables
75  protected:
79  };
80 }
81 
82 #endif
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:72
A contact between two geometries.
Definition: Contacts.h:270
#define AGXPHYSICS_EXPORT
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition: EntityPtr.h:51
Representation of a name string.
Definition: Name.h:32
agx::Real TimeStamp
Definition: TimeStamp.h:26
This is a sensor class that can be attached to an geometry in the simulation.
Definition: EventSensor.h:47
Type-specific Array used for fast access into the data held by a Buffer.
Definition: agxData.h:30
A basic particle system that contains all the storages and buffers required for basic operation and a...
agx::HashSet< agx::Index > m_previousParticleIdsInSensor
UInt32 Index
Definition: Integer.h:52
This namespace contains general operation and action classes which can be used to control a agxSDK::S...
#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
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
A specific type of sensor event that triggers a change in the simulation when activated by a contact...
Definition: SensorEvent.h:117