AGX Dynamics
2.38.0.2
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
>
21
#include <
agx/Physics/GranularBodySystem.h
>
22
23
/*
24
This file defines some operations used in conjunction with the granular model reduction
25
*/
26
namespace
agxControl
27
{
28
class
AGXPHYSICS_EXPORT
SplitSensorOperation
:
public
agxControl::SensorOperation
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
44
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxControl::SplitSensorOperation
);
45
46
protected
:
47
class
ParticleStorageListener
:
public
agxData::EntityStorage::EventListener
48
{
49
friend
class
SplitSensorOperation
;
50
public
:
51
ParticleStorageListener
(
SplitSensorOperation
* op);
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
:
61
SplitSensorOperation
*
m_splitOperation
;
62
};
63
friend
class
ParticleStorageListener
;
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
:
76
agx::HashSet<agx::Index>
m_previousParticleIdsInSensor
;
77
ParticleStorageListener
m_particleStorageListener
;
78
agx::ParticleSystem
*
m_particleSystem
;
79
};
80
}
81
82
#endif
agxControl::SplitSensorOperation::ParticleStorageListener
Definition:
GranularModelReductionOperations.h:47
agxControl
This namespace contains general operation and action classes which can be used to control a agxSDK::S...
agxControl::SplitSensorOperation::m_previousParticleIdsInSensor
agx::HashSet< agx::Index > m_previousParticleIdsInSensor
Definition:
GranularModelReductionOperations.h:76
agxControl::SensorOperation
A specific type of sensor event that triggers a change in the simulation when activated by a contact.
Definition:
SensorEvent.h:117
agxControl::SplitSensorOperation
Definition:
GranularModelReductionOperations.h:28
agxControl::SplitSensorOperation::m_particleStorageListener
ParticleStorageListener m_particleStorageListener
Definition:
GranularModelReductionOperations.h:77
agxData::EntityStorage
Data storage for a collection of entity instances of a specified EntityModel.
Definition:
EntityStorage.h:72
AGXSTREAM_DECLARE_SERIALIZABLE
#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
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxData::Array
Type-specific Array used for fast access into the data held by a Buffer.
Definition:
agxData.h:30
agxControl::EventSensor
This is a sensor class that can be attached to an geometry in the simulation.
Definition:
EventSensor.h:47
agx::ParticleSystem
A basic particle system that contains all the storages and buffers required for basic operation and a...
Definition:
ParticleSystem.h:67
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition:
Simulation.h:125
SensorEvent.h
agx::Index
UInt32 Index
Definition:
Integer.h:44
agx::Name
Representation of a name string.
Definition:
Name.h:32
agx::HashSet< agx::Index >
agxControl::SplitSensorOperation::ParticleStorageListener::m_splitOperation
SplitSensorOperation * m_splitOperation
Definition:
GranularModelReductionOperations.h:61
agxCollide::GeometryContact
A contact between two geometries.
Definition:
Contacts.h:270
agx::TimeStamp
agx::Real TimeStamp
Definition:
TimeStamp.h:26
agxData::EntityPtr
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition:
EntityPtr.h:51
GranularBodySystem.h
agxControl::SplitSensorOperation::m_particleSystem
agx::ParticleSystem * m_particleSystem
Definition:
GranularModelReductionOperations.h:78
agxData::EntityRange
Definition:
EntityPtr.h:247
include
agxControl
GranularModelReductionOperations.h
Generated on Sun Sep 1 2024 11:18:39 for AGX Dynamics by
1.8.17