AGX Dynamics  2.35.0.1
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 
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 
102 
107 
112  void setForbiddenIndices( const agx::Vec2iVector& forbiddenIndices );
113 
119  void addForbiddenIndex( size_t x, size_t y );
120 
125 
130 
132 
133  protected:
134  virtual ~DeformableMineFace();
136 
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 
238 
243 
249  void setSwellFactor(agx::Real swellFactor);
250 
256 
258  protected:
260 
261  private:
264 
266  // Variables
268  protected:
276  };
277 }
278 
279 #endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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 AGXMODEL_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
The geometry representation used by the collision detection engine.
Definition: Geometry.h:93
A HeightField is a collision shape that can be created from a grid structure, like an image.
Base class for a shape.
Definition: Shape.h:54
DeformableMineFace contains a agxCollide::HeightField.
void resetDeformedVolume()
Sets the deformed volume to zero.
DeformableMineFace(agxCollide::HeightField *heightField, agxCollide::Shape *deformerShape)
Constructor.
void setForbiddenIndices(const agx::Vec2iVector &forbiddenIndices)
Set height field indices that should be forbidden from deformation.
agx::SetVector< agx::Vec2i > m_forbiddenIndices
void setMaxDeformableIndices(size_t x, size_t y)
Sets the maximum indices which should be deformed (default: HeightField::getResolutionX - 1,...
void deformHeightFieldFromShape(agxCollide::Shape *shape, bool recordDeformStats)
agx::Vec2i getMaxDeformableIndices() const
Returns the maximum indices which should be deformed (default: HeightField::getResolutionX - 1,...
void deformHeightFieldFromGeometry(agxCollide::Geometry *geometry, bool recordDeformStats=true)
Deforms the DeformableMineFace in the overlap with a specified geometry with the option to either reg...
agx::Real getDeepestDepthReached() const
virtual void preCollide(const agx::TimeStamp &t) override
Called each time step. Overriding inherited method from HeightFieldDeformer.
void clearForbiddenIndices()
Clears the current stored forbidden indices from the DeformableMineFace.
bool isAllowedIndex(size_t x, size_t y) const
void setMinDeformableIndices(size_t x, size_t y)
Sets the minimum indices which should be deformed (default: 0, 0).
const agx::RealVector & getVolumeDifferences() const
bool getConvexHullFromRemovedVolume(agx::Vec3Vector &convexHull) const
Get points encapsulating the created volume from the height differences in the last modified height f...
agx::Vector< agx::Vec2i > getForbiddenIndices() const
void addForbiddenIndex(size_t x, size_t y)
Add a height field index that should be forbidden from deformation.
void resetDeepestDepthReached()
Sets the deepest depth reached to zero.
agxCollide::Shape * getDeformerShape() const
agxCollide::ShapeRef m_deformerShape
agx::Vec2i getMinDeformableIndices() const
Returns the minimum indices which should be deformed (default: 0, 0).
DeformableParticleCreator is a class used to generate granular material given the deformed volume in ...
agx::Real getSummedUpDeformedVolume() const
Returns the registered summed deformed volume in the deformable mine face registered by the creator.
void setSwellFactor(agx::Real swellFactor)
Set the Swell Factor of the creator.
agx::Real getSwellFactor() const
Get the Swell Factor of the creator.
agx::Physics::GranularBodySystemRef m_system
DeformableParticleCreator(agxModel::DeformableMineFace *mineFace, agx::Physics::GranularBodySystem *system, agx::ParticleEmitter::DistributionTable *table)
Constructor of the DeformableParticleCreator.
agx::ParticleEmitter::DistributionTableRef m_table
virtual void preCollide(const agx::TimeStamp &) override
Called each time step.
agxModel::DeformableMineFaceRef m_deformableMineFace
agx::Real getTotalCreatedVolume() const
Returns the total volume of the created particles from the deformed volume.
HeightFieldDeformer contains a agxCollide::HeightField.
Derive from this class to implement a listener for simulation step events.
friend class DistributionTable
Definition: Emitter.h:324
Templated vector class.
Definition: agx/Vector.h:53
#define AGX_FORCE_INLINE
Definition: macros.h:58
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:37
agx::ref_ptr< DeformableMineFace > DeformableMineFaceRef
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Vec2T< Int > Vec2i
Definition: Vec2.h:40
uint32_t UInt
Definition: Integer.h:34
double Real
Definition: Real.h:42
agx::Real TimeStamp
Definition: TimeStamp.h:26