AGXDynamics  2.31.1.0
agxTerrain/TerrainRenderer.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a 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 #pragma once
19 
20 #include <agx/Vec4.h>
21 #include <agx/AffineMatrix4x4.h>
22 #include <agx/Referenced.h>
24 
25 #include <agxTerrain/export.h>
26 
27 namespace osgSim
28 {
29  class ColorRange;
30 }
31 
32 namespace agxTerrain
33 {
34  class Grid;
35 
37 
39  {
40  public:
41  virtual void renderVoxels(
42  const Grid* solid,
43  const Grid* fluid,
44  const Grid* compaction,
45  const agx::AffineMatrix4x4& terrainTransform,
46  agx::Real elementSize,
47  bool enableRenderVoxelSolidMass,
48  bool enableRenderVoxelFluidMass,
49  bool enableRenderVoxelCompaction,
50  agxData::Buffer* verticesBuffer,
51  agxData::Buffer* colorBuffer,
52  agxData::Buffer* voxelSizeBuffer,
53  agxData::Buffer* enableRenderBuffer,
54  std::function<agx::Vec4f(float)> getColor) = 0;
55 
56  virtual void renderInternalNodes(
57  const Grid* solid,
58  const agx::AffineMatrix4x4& terrainTransform,
59  agxData::Buffer* nodesVertices,
60  agxData::Buffer* nodesColorBuffer,
61  agxData::Buffer* nodesFirstBuffer,
62  agxData::Buffer* nodesCountBuffer,
63  bool enableRenderNodes,
64  bool enableRenderVoxelBoundingBox) = 0;
65 
66  virtual void renderVelocityTableLines(
67  const Grid* solid,
68  const agx::AffineMatrix4x4& terrainTransform,
69  const agx::HashTable< agx::Vec3i, agx::Vec3f >& velocityTable,
70  agx::Real elementSize,
71  bool enableVelocityFieldRendering,
72  agxData::Buffer* linePositions,
73  agxData::Buffer* lineOffsets) = 0;
74 
75  virtual void renderMeshIsoSurface(
77  agx::Real elementSize,
78  agxData::Buffer* verticesBuffer,
79  agxData::Buffer* normalsBuffer,
80  agxData::Buffer* colorBuffer,
81  agx::Real radiusExtensionFraction) = 0;
82 
83  public:
85  static TerrainRendererRef createRenderer();
86  };
87 }
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
agx::ref_ptr< TerrainRenderer > TerrainRendererRef
Copyright 2007 - 2018.
Definition: Geometry.h:56
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
Pure virtual interface class for the data storage grid classes we have.
Definition: Grid.h:55
#define AGXTERRAIN_PLUGIN_EXPORT
Base class providing referencing counted objects.
Definition: Referenced.h:113
Abstract representation of a data buffer.
Definition: Buffer.h:55
double Real
Definition: Real.h:42
Inheritance with partial specialization due to bug with ref_ptr containers.