AGXDynamics  2.35.0.3
DeformableHeightFieldRenderer.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 
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
HeightField.h
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
agxOSG::DeformableHeightFieldRenderer
An osg-renderer for a deformable height field.
Definition: DeformableHeightFieldRenderer.h:47
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
StepEventListener.h
agxSDK::StepEventListener::last
virtual void last(const agx::TimeStamp &time)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
Definition: StepEventListener.h:108
utils.h
agx::ref_ptr< HeightFieldDeformer >
HeightFieldDeformer.h
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
GeometryNode.h
agx::root
AGXCORE_EXPORT Component * root()
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxOSG::GeometryNode
A node that can be associated with a collision geometry so that the transformation of this node is up...
Definition: GeometryNode.h:41
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
agxModel::HeightFieldDeformer
HeightFieldDeformer contains a agxCollide::HeightField.
Definition: HeightFieldDeformer.h:36
AGXOSG_EXPORT
#define AGXOSG_EXPORT