Antkeeper
0.0.1
|
Material variable. More...
#include <material-variable.hpp>
Public Types | |
using | element_type = T |
Material variable element type. More... | |
Public Member Functions | |
material_variable (std::size_t size, const element_type &value=element_type()) | |
Constructs a material variable. More... | |
material_variable () | |
Constructs a material variable with a single element. More... | |
material_variable (std::initializer_list< element_type > list) | |
Constructs a material variable from a list of element values. More... | |
virtual constexpr material_variable_type | type () const noexcept override |
Returns the material variable data type. More... | |
std::size_t | size () const noexcept override |
Returns the number of elements in an array variable, or 1 if the variable is not an array. More... | |
std::unique_ptr< material_variable_base > | clone () const override |
Creates a copy of this material property. More... | |
void | set (const element_type &value) |
Sets the value of the the variable, or the value of the first element if the variable is an array. More... | |
void | set (std::size_t index, const element_type &value) |
Sets the value of a single element in an array variable. More... | |
const element_type & | get () const |
Returns a reference to the first element in the array. More... | |
const element_type & | get (std::size_t index) const |
Returns a reference to the element at a given index. More... | |
const element_type * | data () const noexcept |
Returns a pointer to the element array. More... | |
![]() | |
virtual | ~material_variable_base ()=default |
Destructs a material variable base. More... | |
Material variable.
T | Material variable value type. |
Definition at line 65 of file material-variable.hpp.
using render::material_variable< T >::element_type = T |
Material variable element type.
Definition at line 69 of file material-variable.hpp.
|
inlineexplicit |
Constructs a material variable.
size | Number of elements in the array, or 1 if the variable is not an array. |
value | Value with which to initialize the elements. |
Definition at line 77 of file material-variable.hpp.
|
inline |
Constructs a material variable with a single element.
Definition at line 84 of file material-variable.hpp.
|
inlineexplicit |
Constructs a material variable from a list of element values.
list | List of element values. |
Definition at line 93 of file material-variable.hpp.
|
inlineoverridevirtual |
Creates a copy of this material property.
Implements render::material_variable_base.
Definition at line 104 of file material-variable.hpp.
|
inlinenoexcept |
Returns a pointer to the element array.
Definition at line 153 of file material-variable.hpp.
|
inline |
Returns a reference to the first element in the array.
Definition at line 133 of file material-variable.hpp.
|
inline |
Returns a reference to the element at a given index.
index | Index of an element. |
index
. Definition at line 145 of file material-variable.hpp.
|
inline |
Sets the value of the the variable, or the value of the first element if the variable is an array.
value | Value to set. |
Definition at line 114 of file material-variable.hpp.
|
inline |
Sets the value of a single element in an array variable.
index | Index of an element. |
value | Value to set. |
Definition at line 125 of file material-variable.hpp.
|
inlineoverridevirtualnoexcept |
Returns the number of elements in an array variable, or 1
if the variable is not an array.
Implements render::material_variable_base.
Definition at line 99 of file material-variable.hpp.
|
inlineconstexproverridevirtualnoexcept |
Returns the material variable data type.
Implements render::material_variable_base.
Definition at line 232 of file material-variable.hpp.