19 #include <agx/config/AGX_USE_AGXTERRAIN.h>
20 #if defined(SWIG) || AGX_USE_AGXTERRAIN()
27 #include <osg/Drawable>
28 #include <osgViewer/Viewer>
29 #include <osgSim/ColorRange>
30 #include <osgSim/ScalarsToColors>
31 #include <osg/Version>
34 #include <agx/config/AGX_USE_AGXTERRAIN.h>
85 void setRenderVoxelSolidMass(
bool enable);
90 bool getRenderVoxelSolidMass()
const;
96 void setRenderVoxelFluidMass(
bool enable);
101 bool getRenderVoxelFluidMass()
const;
107 void setRenderVoxelBoundingBox(
bool enable);
112 bool getRenderVoxelBoundingBox()
const;
118 void setRenderHeightField(
bool enable);
123 bool getRenderHeightField()
const;
129 void setRenderVoxelCompaction(
bool enable);
134 bool getRenderVoxelCompaction()
const;
140 void setRenderVelocityField(
bool enable);
145 bool getRenderVelocityField()
const;
151 void setRenderSoilParticles(
bool enable);
156 bool getRenderSoilParticles()
const;
162 void setRenderSoilParticlesMesh(
bool enable);
167 bool getRenderSoilParticlesMesh()
const;
174 void setSoilParticleMeshData(
const agx::String& modelFilename,
const agx::String& textureFilename =
"" );
179 const agx::String& getSoilParticleMeshModelFilename()
const;
184 const agx::String& getSoilParticleMeshTextureFilename()
const;
199 bool getRenderHeights()
const;
211 bool getRenderCompaction()
const;
228 void setVelocityFieldLineColor(
const agx::Vec4& lineColor);
234 void setMaxVoxelValueColor(
const agx::Vec4f& maxVoxelColor);
245 osg::ref_ptr<agxOSG::GeometryNode> node;
246 osg::observer_ptr<osg::Group> parent;
247 osg::ref_ptr<osg::Geometry> geometry;
248 osg::ref_ptr<osg::Geode> geode;
249 osg::StateSet* stateSet;
251 osg::ref_ptr<osgSim::ColorRange> colorRange;
252 osg::ref_ptr<osg::Vec4Array> colorArray;
255 struct SoilParticleMeshData
257 osg::ref_ptr<osg::Node> node;
258 osg::ref_ptr<osg::Group> group;
264 virtual void addNotification()
override;
265 virtual void removeNotification()
override;
270 virtual ~TerrainVoxelRenderer();
274 ContextData m_surfaceContextData;
275 ContextData m_heightsContextData;
277 osg::ref_ptr<TerrainVoxelDrawable> m_voxelDrawable;
278 osg::ref_ptr<SoilParticleSystemDrawable> m_soilParticleDrawable;
279 SoilParticleMeshData m_soilParticleMeshData;