AGXDynamics
2.35.0.3
GranularFieldPostProcessor.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
# pragma once
18
19
#include <
agxModel/export.h
>
20
21
#include <
agx/Frame.h
>
22
#include <
agx/Physics/GranularBodySystem.h
>
23
#include <
agxModel/GranularFields.h
>
24
25
#include <
agx/ref_ptr.h
>
26
27
namespace
agxModel
28
{
29
class
GranularField
;
30
31
typedef
std::pair<agx::Physics::GranularBodyPtr, agx::Real>
ParticleWeightPair
;
32
typedef
agx::Vector<ParticleWeightPair>
ParticleWeightPairVector
;
33
34
AGX_DECLARE_POINTER_TYPES
(
GranularFieldPostProcessor
);
35
42
class
AGXMODEL_EXPORT
GranularFieldPostProcessor
:
public
agx::Referenced
43
{
44
public
:
45
52
GranularFieldPostProcessor
(
agx::Physics::GranularBodySystem
* gbs,
const
agx::Vec3u
& voxelCount,
const
agx::Vec3
& halfExtents);
53
58
bool
calculateFields();
59
64
bool
addField(
agxModel::GranularField
* gf);
65
70
bool
removeField(
const
agx::String
& name);
71
75
agx::Real
getVoxelVolume();
76
80
agx::Vec3u
getVoxelCount();
81
85
agx::Vec3
getHalfExtents();
86
90
agx::Vec3
getVoxelSize();
91
95
agx::Frame
* getFrame();
96
102
agxModel::GranularField
* getField(
const
agx::String
& name);
103
107
const
agxModel::GranularFieldRefVector
& getFields();
108
112
agx::Physics::GranularBodySystem
* getGranularBodySystem();
113
118
void
setPosition(
const
agx::Vec3
& pos);
119
124
void
setRotation(
const
agx::Quat
& quat);
125
130
void
createDebugVisualization(
agxSDK::Simulation
* simulation);
131
132
protected
:
133
virtual
~
GranularFieldPostProcessor
();
134
135
private
:
136
agx::Physics::GranularBodySystemRef
m_granularBodySystem;
137
agx::FrameRef
m_frame;
138
agx::Vec3u
m_voxelCount;
// x is width, y is depth, z is height
139
agx::Vec3
m_halfExtents;
140
agx::Vec3
m_voxelSize;
141
142
agxModel::GranularFieldRefVector
m_fields;
143
144
public
:
145
agxData::BufferRef
m_particleInfo
;
146
agxData::BufferRef
m_particleVoxelIndices
;
147
agxData::BufferRef
m_particleVoxelWeights
;
148
149
private
:
150
/* Sorts the particles into voxels. The result is in the particleWeightPairVector. */
151
bool
sortParticlesIntoVoxels();
152
agx::Vec3i
getVoxelIndexFromPosition(
const
agx::Vec3
& position)
const
;
153
agx::Vec3
getPositionRelativeFirstVoxel(
const
agx::Vec3
& position)
const
;
154
155
agx::UInt
getFlatIndex(
const
agx::Vec3i
& index)
const
;
156
157
void
addRequiredFields(
const
agx::Vector<agx::String>
& fields);
158
159
};
160
161
}
agxModel::GranularFieldPostProcessor
Class for calculating different granular fields.
Definition:
GranularFieldPostProcessor.h:42
agxModel::GranularFieldPostProcessor::m_particleVoxelIndices
agxData::BufferRef m_particleVoxelIndices
Definition:
GranularFieldPostProcessor.h:146
agx::Real
double Real
Definition:
Real.h:42
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition:
FlowUnit.h:36
agx::Vector< ParticleWeightPair >
export.h
agxModel::ParticleWeightPairVector
agx::Vector< ParticleWeightPair > ParticleWeightPairVector
Definition:
GranularFieldPostProcessor.h:32
agxModel::ParticleWeightPair
std::pair< agx::Physics::GranularBodyPtr, agx::Real > ParticleWeightPair
Definition:
GranularFieldPostProcessor.h:29
agx::ref_ptr< GranularBodySystem >
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition:
Simulation.h:126
agx::Physics::GranularBodySystem
Definition:
GranularBodySystem.h:32
Frame.h
agx::QuatT< Real >
ref_ptr.h
agxModel::GranularFieldPostProcessor::m_particleVoxelWeights
agxData::BufferRef m_particleVoxelWeights
Definition:
GranularFieldPostProcessor.h:147
agx::Referenced
Base class providing referencing counted objects.
Definition:
Referenced.h:113
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition:
Referenced.h:248
agx::UInt
uint32_t UInt
Definition:
Integer.h:34
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition:
agxModel/export.h:42
GranularFields.h
agx::AgXString< std::string >
agx::Vec3T
A class holding 3 dimensional vectors and providing basic arithmetic.
Definition:
Vec3Template.h:45
agxModel::GranularField
Base class for a GranularField.
Definition:
GranularFields.h:44
agx::Frame
The object defining a frame of reference and providing transformations operations.
Definition:
Frame.h:67
GranularBodySystem.h
agxModel::GranularFieldPostProcessor::m_particleInfo
agxData::BufferRef m_particleInfo
Definition:
GranularFieldPostProcessor.h:145
include
agxModel
GranularFieldPostProcessor.h
Generated on Fri Feb 10 2023 14:06:10 for AGXDynamics by
1.8.17