AGX Dynamics  2.37.3.2
DeformableHeightFieldRenderer.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 
18 #ifndef AGXOSG_DEFORMABLE_HEIGHTFIELD_RENDERER_H
19 #define AGXOSG_DEFORMABLE_HEIGHTFIELD_RENDERER_H
20 
21 #include <agxOSG/GeometryNode.h>
23 #include <agxCollide/HeightField.h>
25 #include <agxOSG/utils.h>
26 
28 
29 
30 namespace agxOSG
31 {
32  class Group;
33  class Node;
34  class GeometryNode;
35 }
36 
37 namespace osg
38 {
39  class HeightField;
40  class Geometry;
41 }
43 
44 namespace agxOSG
45 {
48  {
49  public:
50 
56  DeformableHeightFieldRenderer( agxModel::HeightFieldDeformer* heightFieldDeformer, osg::Group* root );
57 
59  virtual void last(const agx::TimeStamp& );
60 
62  agxOSG::GeometryNode* getHeightFieldNode();
63 
65  bool forceWireFrameRendering();
66 
68  void setAsDirty();
69 
71  bool isValid() const;
72 
73  protected:
75 
76  private:
77  osg::observer_ptr<osg::Group> m_root;
78  agxModel::HeightFieldDeformerRef m_heightFieldDeformer;
79  osg::observer_ptr<agxOSG::GeometryNode> m_heightFieldNode;
80  osg::observer_ptr<osg::HeightField> m_renderHeightField;
81  bool m_valid;
82  };
83 
84 
85 
86  // Implementations
87 
88  AGX_FORCE_INLINE DeformableHeightFieldRenderer::~DeformableHeightFieldRenderer( )
89  {
90  }
91 
92 
93  AGX_FORCE_INLINE agxOSG::GeometryNode* DeformableHeightFieldRenderer::getHeightFieldNode()
94  {
95  return m_heightFieldNode.get();
96  }
97 
98 
99  AGX_FORCE_INLINE bool DeformableHeightFieldRenderer::isValid() const
100  {
101  return m_valid;
102  }
103 
104 }
105 
106 #endif
HeightFieldDeformer contains a agxCollide::HeightField.
#define AGXOSG_EXPORT
Derive from this class to implement a listener for simulation step events.
#define AGX_FORCE_INLINE
Definition: Object.h:59
agx::Real TimeStamp
Definition: TimeStamp.h:26
An osg-renderer for a deformable height field.
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
A node that can be associated with a collision geometry so that the transformation of this node is up...
Definition: GeometryNode.h:41
AGXCORE_EXPORT Component * root()
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97