![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <mtl_reader.hpp>
Public Member Functions | |
MTLReader (ResourceManager &resource_manager, std::vector< Material > &material_buffer) | |
MTLReader (const MTLReader &reader)=delete | |
MTLReader (MTLReader &&reader) noexcept | |
~MTLReader () | |
MTLReader & | operator= (const MTLReader &reader)=delete |
MTLReader & | operator= (MTLReader &&reader)=delete |
void | ReadFromFile (std::filesystem::path path, std::regex regex=s_default_regex, SelectionFunction selection_function=s_default_selection_function) |
void | ReadFromMemory (const std::string &input, std::regex regex=s_default_regex, SelectionFunction selection_function=s_default_selection_function) |
Private Member Functions | |
virtual void | ReadLine () override |
void | ReadMTLMaterialName () |
void | ReadMTLBaseColor () |
void | ReadMTLRoughness () |
void | ReadMTLMetalness () |
void | ReadMTLRadiance () |
void | ReadMTLBaseColorTexture () |
void | ReadMTLMaterialTexture () |
void | ReadMTLNormalTexture () |
const SRGB | ReadMTLSRGB () |
const SRGBA | ReadMTLSRGBA () |
TexturePtr | ReadMTLTexture () |
![]() | |
LineReader & | operator= (const LineReader &reader)=delete |
LineReader & | operator= (LineReader &&reader) noexcept |
void | ReadFromFile (std::filesystem::path path, std::regex regex=s_default_regex, SelectionFunction selection_function=s_default_selection_function) |
void | ReadFromMemory (const std::string &input, std::regex regex=s_default_regex, SelectionFunction selection_function=s_default_selection_function) |
LineReader () | |
LineReader (const LineReader &reader)=delete | |
LineReader (LineReader &&reader) noexcept | |
~LineReader () | |
const std::filesystem::path & | GetPath () const noexcept |
U32 | GetCurrentLineNumber () const noexcept |
template<typename T > | |
const T | Read () |
template<typename T , std::size_t N, size_t A = alignof(T)> | |
const Array< T, N, A > | Read () |
void | ReadRemainingTokens () |
template<typename T > | |
bool | Contains () const noexcept |
bool | ContainsTokens () const noexcept |
Private Attributes | |
ResourceManager & | m_resource_manager |
std::vector< Material > & | m_material_buffer |
Additional Inherited Members | |
![]() | |
using | SelectionFunction = std::function< const std::ssub_match(const std::smatch &) > |
![]() | |
static const std::regex | s_default_regex = std::regex(R"((\"([^\"]*)\")|(\S+))") |
static const SelectionFunction | s_default_selection_function |
A class of MTL file readers for reading materials.
|
explicit |
Constructs a MTL reader.
[in,out] | resource_manager | A reference to the resource manager. |
[in,out] | material_buffer | A reference to a vector for storing the read materials from file. |
|
delete |
Constructs a MTL reader from the given MTL reader.
[in] | reader | A reference to the MTL reader to copy. |
|
defaultnoexcept |
Constructs a MTL reader by moving the given MTL reader.
[in] | reader | A reference to the MTL reader to move. |
|
default |
Destructs this MTL reader.
Copies the given MTL reader to this MTL reader.
[in] | reader | A reference to a MTL reader to copy. |
Moves the given MTL reader to this MTL reader.
[in] | reader | A reference to a MTL reader to move. |
void mage::LineReader::ReadFromFile |
Reads from the file associated with the given path.
[in] | path | The path. |
[in] | regex | The (line) regex. |
[in] | selection_function | The selection function. |
Exception | Failed to read from the file. |
void mage::LineReader::ReadFromMemory |
Reads from the given input string.
[in] | input | A reference to the input string. |
[in] | regex | The (line) regex. |
[in] | selection_function | The selection function. |
Exception | Failed to read from the given input string. |
|
overrideprivatevirtual |
Reads the current line of this MTL reader.
Exception | Failed to the current line of this MTL reader. |
Implements mage::LineReader.
|
private |
Reads a Base Color definition.
Exception | Failed to read a Base Color definition. |
|
private |
|
private |
|
private |
|
private |
Reads a Metalness definition.
Exception | Failed to read a Metalness definition. |
|
private |
|
private |
Reads a Radiance definition.
Exception | Failed to read a Radiance definition. |
|
private |
Reads a Roughness definition.
Exception | Failed to read a Roughness definition. |
|
private |
Reads an sRGB spectrum.
Exception | Failed to read a sRGB spectrum. |
|
private |
Reads an sRGBA spectrum.
Exception | Failed to read a sRGBA spectrum. |
|
private |
Reads a texture.
Exception | Failed to read a texture. |
|
private |
A reference to a vector containing the read materials of this MTL reader.
|
private |
A reference to resource manager of this MTL reader.