VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Public Member Functions | List of all members
TerrainMaterials Class Reference

Class managing a collection of TerrainMaterialDefs. More...

Public Member Functions

 TerrainMaterials (const QString &jsonFilePath)
 Construct a TerrainMaterials object and load TerrainMaterialDefs from the named file. More...
 
QSharedPointer
< TerrainMaterialDef
getMaterial (const QString &name) const
 Returns a shared pointer to the TerrainMaterialDefs with the given name, or a null shared pointer if none is found. More...
 
void reload ()
 Reloads TerrainMaterialDefs from the originally specified file, merging the results into currently stored materials. More...
 

Detailed Description

Class managing a collection of TerrainMaterialDefs.

This class loads TerrainMaterialDefs from a JSON file, and allows them to be looked up by name.

Constructor & Destructor Documentation

TerrainMaterials::TerrainMaterials ( const QString jsonFilePath)

Construct a TerrainMaterials object and load TerrainMaterialDefs from the named file.

Parameters
jsonFilePathAbsolute path to file to load

Member Function Documentation

QSharedPointer<TerrainMaterialDef> TerrainMaterials::getMaterial ( const QString name) const

Returns a shared pointer to the TerrainMaterialDefs with the given name, or a null shared pointer if none is found.

Parameters
nameName of the material to look up
void TerrainMaterials::reload ( )

Reloads TerrainMaterialDefs from the originally specified file, merging the results into currently stored materials.

Existing materials will be updated in place (pointers remain unchanged). New materials will be added, and materials that have been removed from the file will be removed from our map.