AGX Dynamics  2.37.2.0
CableDamage.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 <agxCable/export.h>
20 
21 #include <agxCable/Cable.h>
22 #include <agxCable/Direction.h>
25 #include <agxCable/SegmentDamage.h>
26 
28 
29 
30 namespace agxCable
31 {
33 
34 
58  {
59  public:
64  CableDamage();
65 
74  void setWeight(agxCable::DamageTypes::DamageType type, agx::Real weight);
75 
83  agx::Real getWeight(agxCable::DamageTypes::DamageType type) const;
84 
93  void setStretchRateWeight(agx::Real weight);
94 
103  void setBendRateWeight(agx::Real weight);
104 
113  void setTwistRateWeight(agx::Real weight);
114 
120  void setStretchTensionWeight(agx::Real weight);
121 
127  void setBendTensionWeight(agx::Real weight);
128 
134  void setTwistTensionWeight(agx::Real weight);
135 
141  void setBendDeformationWeight(agx::Real weight);
142 
148  void setTwistDeformationWeight(agx::Real weight);
149 
155  void setStretchDeformationWeight(agx::Real weight);
156 
157 
158 
164  void setNormalForceWeight(agx::Real weight);
165 
171  void setFrictionForceWeight(agx::Real weight);
172 
173 
189  void setThreshold(agxCable::Direction direction, agx::Real threshold);
190 
191 
200  void setStretchThreshold(agx::Real threshold);
201 
210  void setBendThreshold(agx::Real threshold);
211 
212 
221  void setTwistThreshold(agx::Real threshold);
222 
223 
224 
229  agx::Real getBendDeformationWeight() const;
230 
235  agx::Real getTwistDeformationWeight() const;
236 
241  agx::Real getStretchDeformationWeight() const;
242 
247  agx::Real getStretchRateWeight();
248 
253  agx::Real getBendRateWeight();
254 
259  agx::Real getTwistRateWeight();
260 
261 
267  agx::Real getThreshold(agxCable::Direction direction) const;
268 
273  agx::Real getStretchThreshold();
274 
279  agx::Real getBendThreshold();
280 
285  agx::Real getTwistThreshold();
286 
291  agx::Real getStretchTensionWeight();
292 
297  agx::Real getBendTensionWeight();
298 
303  agx::Real getTwistTensionWeight();
304 
305 
310  agx::Real getNormalForceWeight();
311 
316  agx::Real getFrictionForceWeight();
317 
318 
325 #ifndef SWIG
326  const agxCable::SegmentDamageVector& getCurrentDamages() const;
327 #endif
328  agxCable::SegmentDamagePtrVector getCurrentDamagePtrs() const;
329 
336 #ifndef SWIG
337  const agxCable::SegmentDamageVector& getAccumulatedDamages() const;
338 #endif
339  agxCable::SegmentDamagePtrVector getAccumulatedDamagePtrs() const;
340 
347  size_t getNumDamages() const;
348 
357  const agxCable::SegmentDamage& getCurrentDamageAt(size_t index) const;
358 
367  const agxCable::SegmentDamage& getAccumulatedDamageAt(size_t index) const;
368 
375  agxCable::Cable* getCable();
376 
383  const agxCable::Cable* getCable() const;
384 
391  static agxCable::CableDamage* getCableDamage(agxCable::Cable* cable);
392 
394 
395  protected:
396  virtual ~CableDamage();
397 
398  virtual void onAddNotification(agxSDK::LinkedStructure* linkedStructure) override;
399  virtual void onAddNotification(agxSDK::Simulation* simulation) override;
400  virtual void onPreStep() override;
401  virtual void onPostStep() override;
402 
403  private:
404  CableDamage(const CableDamage&) = delete;
405  void operator=(const CableDamage&) = delete;
406 
407  void recomputeCurrentDamages();
408 
409  private:
410  agxCable::CableObserver m_cable;
411  agxCable::CableDamageStateRef m_cableState;
412 
414  agx::Real m_thresholds[agxCable::NUM_DIRECTIONS];
415 
416  agxCable::SegmentDamageVector m_currentDamages;
417  agxCable::SegmentDamageVector m_accumulatedDamages;
418  };
419 }
Basic implementation of any structure where bodies are linked/constrained together in a well defined ...
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
DamageType
Listing of all the cable damage sources that is used by the cable damage estimation model...
A model of a cable using a lumped elements model.
Definition: Cable.h:43
A SegmentDamage instance records damages estimates computed for a single cable segment.
Definition: SegmentDamage.h:40
Direction
The different directions in which a cable can be deformed.
Definition: Direction.h:31
Contain classes for 6 DOF lumped element cables/wires/ropes.
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
#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
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
double Real
Definition: Real.h:42
The CableDamage class is used to estimate damage caused to a cable during a simulation.
Definition: CableDamage.h:57
Base implementation of a component (e.g., specific functionality) in linked structures.
#define AGXCABLE_EXPORT