AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DeformableMineFace.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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
HeightFieldDeformer contains a agxCollide::HeightField.
void resetDeepestDepthReached()
Sets the deepest depth reached to zero.
void setMaxDeformableIndices(size_t x, size_t y)
Sets the maximum indices which should be deformed (default: HeightField::getResolutionX - 1...
agx::Physics::GranularBodySystemRef m_system
agx::Vec2i getMinDeformableIndices() const
Returns the minimum indices which should be deformed (default: 0, 0).
Derive from this class to implement a listener for simulation Step events.
Base class for a shape.
Definition: Shape.h:53
DeformableMineFace contains a agxCollide::HeightField.
friend class DistributionTable
Definition: Emitter.h:278
const agx::RealVector & getVolumeDifferences() const
Vec2T< Int > Vec2i
Definition: Vec2.h:40
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGX_FORCE_INLINE
Definition: Object.h:62
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxCollide::ShapeRef m_deformerShape
agx::Real getDeepestDepthReached() const
The geometry representation used by the collision detection engine.
Definition: Geometry.h:88
agxModel::DeformableMineFaceRef m_deformableMineFace
AGX_DECLARE_VECTOR_TYPES(Deformable1DComponent)
uint32_t UInt
Definition: Integer.h:34
agx::ref_ptr< DistributionTable > DistributionTableRef
Definition: Emitter.h:49
agx::SetVector< agx::Vec2i > m_forbiddenIndices
agx::Real getDeformedVolume() const
agx::ref_ptr< DeformableMineFace > DeformableMineFaceRef
#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:206
#define AGXMODEL_EXPORT
void resetDeformedVolume()
Sets the deformed volume to zero.
agx::Vec2i getMaxDeformableIndices() const
Returns the maximum indices which should be deformed (default: HeightField::getResolutionX - 1...
agx::ParticleEmitter::DistributionTableRef m_table
double Real
Definition: Real.h:42
DeformableParticleCreator is a class used to generate granular material given the deformed volume in ...
void setMinDeformableIndices(size_t x, size_t y)
Sets the minimum indices which should be deformed (default: 0, 0).
A HeightField is a collision shape that can be created from a grid structure, like an image...