AGXDynamics  2.35.0.2
DeformableMineFace.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 AGXMODEL_DEFORMABLE_MINE_FACE_H
18 #define AGXMODEL_DEFORMABLE_MINE_FACE_H
19 
20 #include <agxModel/export.h>
21 
24 #include <agxData/Buffer.h>
25 
26 namespace agx
27 {
28  class Journal;
29 }
30 
31 namespace agxModel
32 {
33 
44  {
45  public:
46 
50  DeformableMineFace( agxCollide::HeightField* heightField, agxCollide::Shape* deformerShape );
51 
53  virtual void preCollide(const agx::TimeStamp& t) override;
54 
56  agx::Real getDeformedVolume() const;
57 
59  void resetDeformedVolume();
60 
62  agx::Real getDeepestDepthReached() const;
63 
65  void resetDeepestDepthReached();
66 
68  void setMinDeformableIndices(size_t x, size_t y);
69 
71  void setMaxDeformableIndices(size_t x, size_t y);
72 
74  agx::Vec2i getMinDeformableIndices() const;
75 
77  agx::Vec2i getMaxDeformableIndices() const;
78 
87  void deformHeightFieldFromGeometry( agxCollide::Geometry* geometry, bool recordDeformStats=true );
88 
93  const agx::RealVector& getVolumeDifferences() const;
94 
101  bool getConvexHullFromRemovedVolume( agx::Vec3Vector& convexHull ) const;
102 
106  agxCollide::Shape* getDeformerShape() const;
107 
112  void setForbiddenIndices( const agx::Vec2iVector& forbiddenIndices );
113 
119  void addForbiddenIndex( size_t x, size_t y );
120 
124  agx::Vector< agx::Vec2i > getForbiddenIndices() const;
125 
129  void clearForbiddenIndices();
130 
132 
133  protected:
134  virtual ~DeformableMineFace();
136 
137  void deformHeightFieldFromShape( agxCollide::Shape* shape,
138  bool recordDeformStats );
139 
140  bool isAllowedIndex( size_t x, size_t y ) const;
141 
142  protected:
151  };
152 
154 
155  // Implementations
157  {
158  }
159 
160 
162  {
163  return m_deformedVolume;
164  }
165 
166 
168  {
169  m_deformedVolume = 0;
170  }
171 
172 
174  {
175  return m_deepestDepthReached;
176  }
177 
178 
180  {
183  }
184 
185 
187  {
189  }
190 
191 
193  {
195  }
196 
197 
199  {
200  return m_minDeformableIndices;
201  }
202 
203 
205  {
206  return m_maxDeformableIndices;
207  }
208 
210  {
211  return m_volumeDifferences;
212  }
213 
219  {
220  public:
230 
232  virtual void preCollide(const agx::TimeStamp&) override;
233 
237  agx::Real getTotalCreatedVolume() const;
238 
242  agx::Real getSummedUpDeformedVolume() const;
243 
249  void setSwellFactor(agx::Real swellFactor);
250 
255  agx::Real getSwellFactor() const;
256 
258  protected:
259  virtual ~DeformableParticleCreator();
260 
261  private:
264 
266  // Variables
268  protected:
276  };
277 }
278 
279 #endif
agxModel::DeformableMineFace::setMaxDeformableIndices
void setMaxDeformableIndices(size_t x, size_t y)
Sets the maximum indices which should be deformed (default: HeightField::getResolutionX - 1,...
Definition: DeformableMineFace.h:192
agxModel::DeformableMineFace
DeformableMineFace contains a agxCollide::HeightField.
Definition: DeformableMineFace.h:43
agxModel::DeformableMineFace::getDeepestDepthReached
agx::Real getDeepestDepthReached() const
Definition: DeformableMineFace.h:173
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
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
agx::Vector< agx::Vec2i >
agxModel::DeformableMineFace::m_volumeDifferences
agx::RealVector m_volumeDifferences
Definition: DeformableMineFace.h:149
export.h
agxModel::DeformableParticleCreator::m_summedUpDeformedVolume
agx::Real m_summedUpDeformedVolume
Definition: DeformableMineFace.h:273
agx::Emitter::DistributionTable
friend class DistributionTable
Definition: Emitter.h:388
agxModel::DeformableMineFace::m_minDeformableIndices
agx::Vec2i m_minDeformableIndices
Definition: DeformableMineFace.h:147
agxModel::DeformableMineFace::~DeformableMineFace
virtual ~DeformableMineFace()
Definition: DeformableMineFace.h:156
agxModel::DeformableParticleCreator::m_system
agx::Physics::GranularBodySystemRef m_system
Definition: DeformableMineFace.h:270
agxCollide::HeightField
A HeightField is a collision shape that can be created from a grid structure, like an image.
Definition: agxCollide/HeightField.h:51
agxModel::DeformableMineFaceRef
agx::ref_ptr< DeformableMineFace > DeformableMineFaceRef
Definition: DeformableMineFace.h:34
agxModel::DeformableMineFace::m_forbiddenIndices
agx::SetVector< agx::Vec2i > m_forbiddenIndices
Definition: DeformableMineFace.h:150
agxModel::DeformableMineFace::getMinDeformableIndices
agx::Vec2i getMinDeformableIndices() const
Returns the minimum indices which should be deformed (default: 0, 0).
Definition: DeformableMineFace.h:198
agxModel::DeformableParticleCreator
DeformableParticleCreator is a class used to generate granular material given the deformed volume in ...
Definition: DeformableMineFace.h:218
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
agx::VectorPOD< Real >
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGX_DECLARE_VECTOR_TYPES
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34
agx::ref_ptr< Shape >
agxModel::DeformableMineFace::m_deepestDepthReached
agx::Real m_deepestDepthReached
Definition: DeformableMineFace.h:145
agxCollide::Shape
Base class for a shape.
Definition: Shape.h:53
agx::SetVector< agx::Vec2i >
agxModel::DeformableMineFace::resetDeepestDepthReached
void resetDeepestDepthReached()
Sets the deepest depth reached to zero.
Definition: DeformableMineFace.h:179
agxModel::DeformableMineFace::getMaxDeformableIndices
agx::Vec2i getMaxDeformableIndices() const
Returns the maximum indices which should be deformed (default: HeightField::getResolutionX - 1,...
Definition: DeformableMineFace.h:204
agxModel::DeformableParticleCreator::m_deformableMineFace
agxModel::DeformableMineFaceRef m_deformableMineFace
Definition: DeformableMineFace.h:269
HeightFieldDeformer.h
agxModel::DeformableParticleCreator::m_swellFactor
agx::Real m_swellFactor
Definition: DeformableMineFace.h:272
Buffer.h
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
agx::Vec2T
Definition: Vec2Template.h:30
agxModel::DeformableParticleCreator::m_totalCreatedVolume
agx::Real m_totalCreatedVolume
Definition: DeformableMineFace.h:274
agx::Physics::GranularBodySystem
Definition: GranularBodySystem.h:32
agxModel::DeformableMineFace::m_deformedVolume
agx::Real m_deformedVolume
Definition: DeformableMineFace.h:144
agxModel::DeformableMineFace::m_deepestDepthReachedOffset
agx::Real m_deepestDepthReachedOffset
Definition: DeformableMineFace.h:146
agxModel::DeformableParticleCreator::m_numberOfBodiesCreated
agx::UInt m_numberOfBodiesCreated
Definition: DeformableMineFace.h:275
agx::Vec2i
Vec2T< Int > Vec2i
Definition: Vec2.h:40
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agx::UInt
uint32_t UInt
Definition: Integer.h:34
agxModel::DeformableParticleCreator::m_table
agx::ParticleEmitter::DistributionTableRef m_table
Definition: DeformableMineFace.h:271
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxModel::DeformableMineFace::m_maxDeformableIndices
agx::Vec2i m_maxDeformableIndices
Definition: DeformableMineFace.h:148
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxModel::DeformableMineFace::getDeformedVolume
agx::Real getDeformedVolume() const
Definition: DeformableMineFace.h:161
agxModel::DeformableMineFace::m_deformerShape
agxCollide::ShapeRef m_deformerShape
Definition: DeformableMineFace.h:143
agxModel::DeformableMineFace::setMinDeformableIndices
void setMinDeformableIndices(size_t x, size_t y)
Sets the minimum indices which should be deformed (default: 0, 0).
Definition: DeformableMineFace.h:186
agxModel::DeformableMineFace::getVolumeDifferences
const agx::RealVector & getVolumeDifferences() const
Definition: DeformableMineFace.h:209
agxModel::DeformableMineFace::resetDeformedVolume
void resetDeformedVolume()
Sets the deformed volume to zero.
Definition: DeformableMineFace.h:167
GranularBodySystem.h
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
agxModel::HeightFieldDeformer
HeightFieldDeformer contains a agxCollide::HeightField.
Definition: HeightFieldDeformer.h:36