AGX Dynamics  2.35.0.1
CableDamageDataRenderer.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 #pragma once
18 
19 #include <agx/Real.h>
20 #include <agx/Vector.h>
21 
22 #include <agxOSG/export.h>
23 
25 
26 #include <functional>
27 
28 namespace osg
29 {
30  class Group;
31 }
32 
33 
34 namespace agxCable
35 {
36  class Cable;
37  class CableDamageState;
38  class SegmentDamageState;
39 }
40 
41 
42 
43 namespace agxOSG
44 {
45  class GeometryNode;
46  class Group;
47  class ExampleApplication;
48 }
49 
50 
51 
52 namespace agxOSG
53 {
55 
57  {
58  public:
60  agxOSG::ExampleApplication& application);
61 
62 
63  void setDamageGetter(std::string name, std::function<agx::Real(const agxCable::SegmentDamageState*)> f);
64 
65  virtual void post(const agx::Real& timeStamp) override;
66 
67  void updateColors();
68 
69  void updateText();
70 
71  protected:
73 
74  private:
76 
77  private:
79  agxOSG::ExampleApplication& m_application;
80  std::function<agx::Real(const agxCable::SegmentDamageState*)> m_getDamage;
81  std::string m_getDamageName;
83  };
84 }
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXOSG_EXPORT
Inspect a cable's current state and compute a SegmentDamageState for each segment.
A model of a cable using a lumped elements model.
Definition: Cable.h:44
A SegmenDamageState instance records a collection of states computed from a cable for later use by a ...
virtual void post(const agx::Real &timeStamp) override
Called after a step is taken in the simulation Implement this method in the derived class to get call...
void setDamageGetter(std::string name, std::function< agx::Real(const agxCable::SegmentDamageState *)> f)
CableDamageDataRenderer(agxCable::Cable *cable, agxCable::CableDamageState *damage, osg::Group *root, agxOSG::ExampleApplication &application)
Class that encapsulates rendering and simulation using OpenSceneGraph.
Derive from this class to implement a listener for simulation step events.
Contain classes for 6 DOF lumped element cables/wires/ropes.
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
AGXCORE_EXPORT Component * root()
double Real
Definition: Real.h:42