Public Member Functions | List of all members
sdf::v10::Material Class Reference

This class contains visual material properties. More...

#include <Material.hh>

Public Member Functions

 Material ()
 Default constructor. More...
 
 Material (const Material &_material)
 Copy constructor. More...
 
 Material (Material &&_material) noexcept
 Move constructor. More...
 
 ~Material ()
 Destructor. More...
 
ignition::math::Color Ambient () const
 Get the ambient color. More...
 
ignition::math::Color Diffuse () const
 Get the diffuse color. More...
 
bool DoubleSided () const
 Get whether double sided material is enabled. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
ignition::math::Color Emissive () const
 Get the emissive color. More...
 
const std::string & FilePath () const
 The path to the file where this element was loaded from. More...
 
bool Lighting () const
 Get whether dynamic lighting is enabled. More...
 
Errors Load (ElementPtr _sdf)
 Load the material based on a element pointer. More...
 
std::string NormalMap () const
 Get the normal map filename. More...
 
Materialoperator= (const Material &_material)
 Assignment operator. More...
 
Materialoperator= (Material &&_material)
 Move assignment operator. More...
 
PbrPbrMaterial () const
 Get the Physically Based Rendering (PBR) material. More...
 
float RenderOrder () const
 Get render order. More...
 
std::string ScriptName () const
 Get the name of the material script, or empty if one has not been specified. More...
 
std::string ScriptUri () const
 Get the URI of the material script, if one has been set. More...
 
void SetAmbient (const ignition::math::Color &_color) const
 Set the ambient color. More...
 
void SetDiffuse (const ignition::math::Color &_color) const
 Set the diffuse color. More...
 
void SetDoubleSided (bool _doubleSided)
 Set whether double sided material is enabled. More...
 
void SetEmissive (const ignition::math::Color &_color) const
 Set the emissive color. More...
 
void SetFilePath (const std::string &_filePath)
 Set the path to the file where this element was loaded from. More...
 
void SetLighting (const bool _lighting)
 Set whether dynamic lighting is enabled. More...
 
void SetNormalMap (const std::string &_map)
 Set the normal map filename. More...
 
void SetPbrMaterial (const Pbr &_pbr)
 Set the Physically Based Rendering (PBR) material. More...
 
void SetRenderOrder (const float _renderOrder)
 Set render order. More...
 
void SetScriptName (const std::string &_name)
 Set the name of the material script. More...
 
void SetScriptUri (const std::string &_uri)
 Set the URI of the material script. More...
 
void SetShader (const ShaderType &_type)
 Set the type of shader. More...
 
void SetSpecular (const ignition::math::Color &_color) const
 Set the specular color. More...
 
ShaderType Shader () const
 Get the type of shader. More...
 
ignition::math::Color Specular () const
 Get the specular color. More...
 

Detailed Description

This class contains visual material properties.

Constructor & Destructor Documentation

◆ Material() [1/3]

sdf::v10::Material::Material ( )

Default constructor.

◆ Material() [2/3]

sdf::v10::Material::Material ( const Material _material)

Copy constructor.

Parameters
[in]_materialMaterial to copy.

◆ Material() [3/3]

sdf::v10::Material::Material ( Material &&  _material)
noexcept

Move constructor.

Parameters
[in]_materialMaterial to move.

◆ ~Material()

sdf::v10::Material::~Material ( )

Destructor.

Member Function Documentation

◆ Ambient()

ignition::math::Color sdf::v10::Material::Ambient ( ) const

Get the ambient color.

The ambient color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].

Returns
Ambient color.

◆ Diffuse()

ignition::math::Color sdf::v10::Material::Diffuse ( ) const

Get the diffuse color.

The diffuse color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].

Returns
Diffuse color.

◆ DoubleSided()

bool sdf::v10::Material::DoubleSided ( ) const

Get whether double sided material is enabled.

The default value is false.

Returns
False if double sided material should be disabled.

◆ Element()

sdf::ElementPtr sdf::v10::Material::Element ( ) const

Get a pointer to the SDF element that was used during load.

Returns
SDF element pointer. The value will be nullptr if Load has not been called.

◆ Emissive()

ignition::math::Color sdf::v10::Material::Emissive ( ) const

Get the emissive color.

The emissive color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].

Returns
Emissive color.

◆ FilePath()

const std::string& sdf::v10::Material::FilePath ( ) const

The path to the file where this element was loaded from.

Returns
Full path to the file on disk.

◆ Lighting()

bool sdf::v10::Material::Lighting ( ) const

Get whether dynamic lighting is enabled.

The default value is true.

Returns
False if dynamic lighting should be disabled.

◆ Load()

Errors sdf::v10::Material::Load ( ElementPtr  _sdf)

Load the material based on a element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ NormalMap()

std::string sdf::v10::Material::NormalMap ( ) const

Get the normal map filename.

This will be an empty string if a normal map has not been set.

Returns
Filename of the normal map, or empty string if a normal map has not been specified.

◆ operator=() [1/2]

Material& sdf::v10::Material::operator= ( const Material _material)

Assignment operator.

Parameters
[in]_materialThe material to set values from.
Returns
*this

◆ operator=() [2/2]

Material& sdf::v10::Material::operator= ( Material &&  _material)

Move assignment operator.

Parameters
[in]_materialThe material to move from.
Returns
*this

◆ PbrMaterial()

Pbr* sdf::v10::Material::PbrMaterial ( ) const

Get the Physically Based Rendering (PBR) material.

Returns
Pointer to the PBR material. Null if it does not exist.

◆ RenderOrder()

float sdf::v10::Material::RenderOrder ( ) const

Get render order.

Returns
Render order

◆ ScriptName()

std::string sdf::v10::Material::ScriptName ( ) const

Get the name of the material script, or empty if one has not been specified.

The name should match an script element in the script located at the ScriptUri().

Returns
The name of the material script, or empty string if one has not been set.

◆ ScriptUri()

std::string sdf::v10::Material::ScriptUri ( ) const

Get the URI of the material script, if one has been set.

Returns
The URI of the material script, or empty string if one has not been set.

◆ SetAmbient()

void sdf::v10::Material::SetAmbient ( const ignition::math::Color &  _color) const

Set the ambient color.

The ambient color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].

Parameters
[in]_colorAmbient color.

◆ SetDiffuse()

void sdf::v10::Material::SetDiffuse ( const ignition::math::Color &  _color) const

Set the diffuse color.

The diffuse color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].

Parameters
[in]_colorDiffuse color.

◆ SetDoubleSided()

void sdf::v10::Material::SetDoubleSided ( bool  _doubleSided)

Set whether double sided material is enabled.

Parameters
[in]_lightingFalse disables double sided material.

◆ SetEmissive()

void sdf::v10::Material::SetEmissive ( const ignition::math::Color &  _color) const

Set the emissive color.

The emissive color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].

Parameters
[in]_colorEmissive color.

◆ SetFilePath()

void sdf::v10::Material::SetFilePath ( const std::string &  _filePath)

Set the path to the file where this element was loaded from.

[in] _filePath Full path to the file on disk.

◆ SetLighting()

void sdf::v10::Material::SetLighting ( const bool  _lighting)

Set whether dynamic lighting is enabled.

Parameters
[in]_lightingFalse disables dynamic lighting.

◆ SetNormalMap()

void sdf::v10::Material::SetNormalMap ( const std::string &  _map)

Set the normal map filename.

Parameters
[in]_mapFilename of the normal map.

◆ SetPbrMaterial()

void sdf::v10::Material::SetPbrMaterial ( const Pbr _pbr)

Set the Physically Based Rendering (PBR) material.

Returns
The PBR material to set to.

◆ SetRenderOrder()

void sdf::v10::Material::SetRenderOrder ( const float  _renderOrder)

Set render order.

Parameters
[in]_renderOrderrender order

◆ SetScriptName()

void sdf::v10::Material::SetScriptName ( const std::string &  _name)

Set the name of the material script.

The name should match an script element in the script located at the ScriptUri().

Parameters
[in]_nameThe name of the material script.

◆ SetScriptUri()

void sdf::v10::Material::SetScriptUri ( const std::string &  _uri)

Set the URI of the material script.

Parameters
[in]_uriThe URI of the material script.

◆ SetShader()

void sdf::v10::Material::SetShader ( const ShaderType _type)

Set the type of shader.

Parameters
[in]_typeShader type.

◆ SetSpecular()

void sdf::v10::Material::SetSpecular ( const ignition::math::Color &  _color) const

Set the specular color.

The specular color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].

Parameters
[in]_colorSpecular color.

◆ Shader()

ShaderType sdf::v10::Material::Shader ( ) const

Get the type of shader.

Returns
Shader type.

◆ Specular()

ignition::math::Color sdf::v10::Material::Specular ( ) const

Get the specular color.

The specular color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].

Returns
Specular color.

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