AGXDynamics  2.31.1.0
TerrainToolCollection.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 #pragma once
18 
19 #include <agxTerrain/Shovel.h>
23 
24 #include <agxStream/Serializable.h>
25 
26 namespace agxTerrain
27 {
30 
36  {
37  public:
43  TerrainToolCollection( Terrain* terrain, Shovel* shovel );
44 
48  Terrain* getTerrain() const;
49 
53  Shovel* getShovel() const;
54 
58  PrimaryActiveZone* getActiveZone() const;
59 
64  void setActiveZone( PrimaryActiveZone* activeZone );
65 
69  SoilParticleAggregate* getSoilParticleAggregate() const;
70 
75  void setSoilParticleAggregate( SoilParticleAggregate* soilParticleAggregate );
76 
80  AggregateContactGenerator* getAggregateContactGenerator() const;
81 
86  void setAggregateContactGenerator(AggregateContactGenerator* aggregateContactGenerator);
87 
91  DeformController* getDeformController() const;
92 
97  void setDeformController(DeformController* deformController);
98 
102  SoilPenetrationResistance* getPenetrationResistance() const;
103 
108  void setPenetrationResistance(SoilPenetrationResistance* penetrationResistance);
109 
113  const agxCollide::GeometryRefVector& getVoxelCollisionGeometries() const;
114 
119  void setVoxelCollisionGeometries( const agxCollide::GeometryRefVector& geometries );
120 
125  ShovelAggregateContactMaterialContainer* getShovelTerrainContactMaterialContainer();
126 
127 
131  agx::Frame* getParentFrame() const;
132 
136  agx::Bool initialized() const;
137 
141  agx::Bool shouldUpdate();
142 
147  void setEnableShovelTerrainGeometryContacts(bool enable);
148 
149  public:
157  virtual agx::Bool initialize( agxSDK::Simulation* simulation );
158 
166  virtual void uninitialize( agxSDK::Simulation* simulation );
167 
171  virtual void onPreCollide();
172 
176  virtual void onPre();
177 
181  virtual void onPost();
182 
186  bool collisionGeometriesAreInsideTerrain() const;
187 
191  void handleEnableChange();
192 
196  void enable(bool enabled);
197 
201  bool getEnable();
202 
206  bool shovelEnableHasChanged() const;
207 
211  void clearActiveZoneWedges() const;
212 
216  const agx::RigidBody* getWedgeAggregate(Shovel::ExcavationMode excavationMode) const;
217 
221  agx::Real getAggregateTerrainContactDepth(Shovel::ExcavationMode excavationMode) const;
222 
225 
226  virtual void onPostRestore( Terrain* terrain );
228 
229  protected:
234 
238  virtual ~TerrainToolCollection();
239 
240  private:
241  Terrain* m_terrain;
242  ShovelRef m_shovel;
243  PrimaryActiveZoneRef m_activeZone;
244  SoilParticleAggregateRef m_soilParticleAggregate;
245  AggregateContactGeneratorRef m_aggregateContactGenerator;
246  DeformControllerRef m_deformController;
247  ShovelAggregateContactMaterialContainerRef m_shovelAggregateCMContainer;
248  SoilPenetrationResistanceRef m_penetrationResistance;
249  bool m_shovelEnabled;
250  bool m_enabled;
251 
252  agx::FrameRef m_parentFrame;
253  agxCollide::GeometryRefVector m_voxelCollisionGeometries;
254  };
255 }
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
bool Bool
Definition: Integer.h:48
Copyright 2007 - 2018.
Definition: Geometry.h:56
Collection of terrain tool (currently Shovel) related objects which are terrain instance specific...
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
ExcavationMode
Enum for describing the different excavation modes of a shovel: PRIMARY - The primary mode of excavat...
Definition: Shovel.h:86
Base class providing referencing counted objects.
Definition: Referenced.h:113
#define AGXTERRAIN_EXPORT
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:52
The object defining a frame of reference and providing transformations operations.
Definition: Frame.h:67
#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
Simple container class for storing and handling explicit contact material for shovel-aggregate contac...
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:121
AGX_DECLARE_VECTOR_TYPES(ActiveZone)
double Real
Definition: Real.h:42
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:102
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:101