AGX Dynamics  2.37.2.0
agxTerrain::TerrainMaterialReaderWriter Class Reference

Utility class for reading and writing TerrainMaterial objects to JSON format. More...

#include <TerrainMaterialReaderWriter.h>

Static Public Member Functions

static bool readJson (TerrainMaterial *terrainMaterial, const agx::String &filename)
 Read TerrainMateiral configuration from a file in JSON format into a TerrainMaterial object. More...
 
static bool readJsonString (TerrainMaterial *terrainMaterial, const agx::String &jsonString)
 Read a TerrainMaterial configuration from a string in JSON format. More...
 
static bool writeJson (const TerrainMaterial *terrainMaterial, const agx::String &filename)
 Write a TerrainMaterial configuration to a file in JSON format. More...
 
static bool writeJsonString (const TerrainMaterial *terrainMaterial, agx::String &jsonString)
 Write a TerrainMaterial configuration to a string in JSON format. More...
 

Detailed Description

Utility class for reading and writing TerrainMaterial objects to JSON format.

The data can be written to both files and strings.

Definition at line 33 of file TerrainMaterialReaderWriter.h.

Member Function Documentation

◆ readJson()

static bool agxTerrain::TerrainMaterialReaderWriter::readJson ( TerrainMaterial *  terrainMaterial,
const agx::String &  filename 
)
static

Read TerrainMateiral configuration from a file in JSON format into a TerrainMaterial object.

Parameters
filename- the filename of the file containing the terrain material configuration in JSON format.
terrainMaterial- the TerrainMaterial object that will be initialized with the data from the JSON file.
Returns
true if the file was successfully read, false otherwise.

◆ readJsonString()

static bool agxTerrain::TerrainMaterialReaderWriter::readJsonString ( TerrainMaterial *  terrainMaterial,
const agx::String &  jsonString 
)
static

Read a TerrainMaterial configuration from a string in JSON format.

Parameters
jsonString- the string where the JSON data will be read from.
terrainMaterial- the TerrainMaterial object that will be written to from the JSON string.
Returns
true if the data was successfully read to the JSON string, false otherwise.

◆ writeJson()

static bool agxTerrain::TerrainMaterialReaderWriter::writeJson ( const TerrainMaterial *  terrainMaterial,
const agx::String &  filename 
)
static

Write a TerrainMaterial configuration to a file in JSON format.

Parameters
terrainMaterial- the TerrainMaterial object that will be written to the JSON file.
filename- the filename of the file where the the terrain material configuration will be written in JSON format.
Returns
true if the file was successfully written, false otherwise.

◆ writeJsonString()

static bool agxTerrain::TerrainMaterialReaderWriter::writeJsonString ( const TerrainMaterial *  terrainMaterial,
agx::String &  jsonString 
)
static

Write a TerrainMaterial configuration to a string in JSON format.

Parameters
terrainMaterial- the TerrainMaterial object that will be written to the JSON string.
jsonString- the string where the JSON data will be written.
Returns
true if the data was successfully written to the JSON string, false otherwise.

The documentation for this class was generated from the following file: