AGX Dynamics  2.37.2.0
agxOSG/HeightField.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 
20 #include <agxOSG/Node.h>
21 
22 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
23 #include <osg/Drawable>
24 #include <osgViewer/Viewer>
25 #include <osgSim/ColorRange>
26 #include <osgSim/ScalarsToColors>
27 #include <osg/Version>
28 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
29 #include <agxCollide/HeightField.h>
30 
31 namespace agxOSG
32 {
34 
39  class AGXOSG_EXPORT HeightField : public osg::Geode
40  {
41 
42  public:
48  HeightField( const agxCollide::HeightField* heightField);
49 
53  const agxCollide::HeightField* getHeightField() const;
54 
55 
56  osg::Geometry *getGeometry();
57  const osg::Geometry *getGeometry() const ;
58 
59 
60  protected:
61  bool createVisual(const agxCollide::HeightField *heightField);
62  virtual void traverse(osg::NodeVisitor& nv);
63 
64  virtual ~HeightField();
65 
66  protected:
68  osg::ref_ptr<osg::Geometry> m_geometry;
69  osg::StateSet* m_stateSet;
71  };
72 }
73 
osg::StateSet * m_stateSet
#define AGXOSG_EXPORT
osg::ref_ptr< osg::Geometry > m_geometry
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Rendering class for the agxCollide::HeightField The visual representation will be updated if the Heig...
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
AGXOSG_EXPORT agxOSG::GeometryNode * createVisual(const agxCollide::Geometry *geometry, osg::Group *root, float detailRatio=1.0f, bool createAxes=false, bool evenIfSensor=true)
Given a geometry, this function create visual representation of the shape.
agxCollide::HeightFieldConstObserver m_heightField
A HeightField is a collision shape that can be created from a grid structure, like an image...
uint32_t UInt32
Definition: Integer.h:40