AGX Dynamics  2.37.2.0
agx::MaterialReaderWriter Class Reference

Utility class for reading and writing Materials. More...

#include <MaterialReaderWriter.h>

Static Public Member Functions

static bool readJson (agx::Material *material, const agx::String &filename)
 Read parameters from a file with json data and assign values to a Material. More...
 
static bool readJson (agx::ContactMaterial *contactMaterial, const agx::String &filename)
 Read parameters from a file with json data and assign values to a ContactMaterial. More...
 
static bool readJsonString (agx::Material *material, const agx::String &jsonContents)
 Read parameters from a string with json data and assign values to a Material. More...
 
static bool readJsonString (agx::ContactMaterial *contactMaterial, const agx::String &jsonContents)
 Read parameters from a string with json data and assign values to a ContactMaterial. More...
 
static bool writeJson (const agx::Material *material, const agx::String &filename)
 Read parameters from a Material and write result to a Material definition file. More...
 
static bool writeJson (const agx::ContactMaterial *contactMaterial, const agx::String &filename)
 Read parameters from a ContactMaterial and write result to a ContactMaterial definition file. More...
 
static bool writeJsonString (const agx::Material *material, agx::String &jsonOutput)
 Read parameters from a Material and write result to a String. More...
 
static bool writeJsonString (const agx::ContactMaterial *contactMaterial, agx::String &jsonOutput)
 Read parameters from a ContactMaterial and write result to a String. More...
 

Detailed Description

Utility class for reading and writing Materials.

Definition at line 30 of file MaterialReaderWriter.h.

Member Function Documentation

◆ readJson() [1/2]

static bool agx::MaterialReaderWriter::readJson ( agx::Material *  material,
const agx::String &  filename 
)
static

Read parameters from a file with json data and assign values to a Material.

Parameters
materialThe Material to modify
filenameName of input file
Returns
True if json data could be read and assigned to the Material

◆ readJson() [2/2]

static bool agx::MaterialReaderWriter::readJson ( agx::ContactMaterial *  contactMaterial,
const agx::String &  filename 
)
static

Read parameters from a file with json data and assign values to a ContactMaterial.

Parameters
contactMaterialThe ContactMaterial to modify
filenameName of input file
Returns
True if json data could be read and assigned to the ContactMaterial

◆ readJsonString() [1/2]

static bool agx::MaterialReaderWriter::readJsonString ( agx::Material *  material,
const agx::String &  jsonContents 
)
static

Read parameters from a string with json data and assign values to a Material.

Parameters
materialThe Material to modify
jsonContentsjson data
Returns
True if json data could be read and assigned to the Material

◆ readJsonString() [2/2]

static bool agx::MaterialReaderWriter::readJsonString ( agx::ContactMaterial *  contactMaterial,
const agx::String &  jsonContents 
)
static

Read parameters from a string with json data and assign values to a ContactMaterial.

Parameters
contactMaterialThe ContactMaterial to modify
jsonContentsjson data
Returns
True if json data could be read and assigned to the ContactMaterial

◆ writeJson() [1/2]

static bool agx::MaterialReaderWriter::writeJson ( const agx::Material *  material,
const agx::String &  filename 
)
static

Read parameters from a Material and write result to a Material definition file.

Parameters
materialThe Material whose values should be read
filenameName of file where data should be written
Returns
True if file could successfully be written

◆ writeJson() [2/2]

static bool agx::MaterialReaderWriter::writeJson ( const agx::ContactMaterial *  contactMaterial,
const agx::String &  filename 
)
static

Read parameters from a ContactMaterial and write result to a ContactMaterial definition file.

Parameters
contactMaterialThe ContactMaterial whose values should be read
filenameName of file where data should be written
Returns
True if file could successfully be written

◆ writeJsonString() [1/2]

static bool agx::MaterialReaderWriter::writeJsonString ( const agx::Material *  material,
agx::String &  jsonOutput 
)
static

Read parameters from a Material and write result to a String.

Parameters
materialThe Material whose values should be read
jsonOutputString that will contain the output
Returns
True if json output could be assigned to the string

◆ writeJsonString() [2/2]

static bool agx::MaterialReaderWriter::writeJsonString ( const agx::ContactMaterial *  contactMaterial,
agx::String &  jsonOutput 
)
static

Read parameters from a ContactMaterial and write result to a String.

Parameters
contactMaterialThe ContactMaterial whose values should be read
jsonOutputString that will contain the output
Returns
True if json output could be assigned to the string

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