![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <mdl_reader.hpp>
Public Member Functions | |
MDLReader (ResourceManager &resource_manager, ModelOutput< VertexT, IndexT > &model_output) | |
MDLReader (const MDLReader &reader)=delete | |
MDLReader (MDLReader &&reader) noexcept | |
~MDLReader () | |
MDLReader & | operator= (const MDLReader &reader)=delete |
MDLReader & | operator= (MDLReader &&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 | Preprocess () override |
virtual void | ReadLine () override |
virtual void | Postprocess () override |
void | ReadMDLSubModel () |
void | ReadMDLMaterialLibrary () |
![]() | |
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 |
ModelOutput< VertexT, IndexT > & | m_model_output |
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 MDL file readers for reading models.
VertexT | The vertex type. |
IndexT | The index type. |
|
explicit |
Constructs a MDL reader.
[in,out] | resource_manager | A reference to the resource manager. |
[in,out] | model_output | A reference to the model output for storing the model data from file. |
|
delete |
Constructs a MDL reader from the given MDL reader.
[in] | reader | A reference to the MDL reader to copy. |
|
noexcept |
Constructs a MDL reader by moving the given MDL reader.
[in] | reader | A reference to the MDL reader to move. |
mage::rendering::loader::MDLReader< VertexT, IndexT >::~MDLReader | ( | ) |
Destructs this MDL reader.
|
delete |
Copies the given MDL reader to this MDL reader.
[in] | reader | A reference to a MDL reader to copy. |
|
delete |
Moves the given MDL reader to this MDL reader.
[in] | reader | A reference to a MDL reader to move. |
|
overrideprivatevirtual |
Post-processes after reading the current file of this MDL reader.
Exception | Failed to finish post-processing successfully. |
Reimplemented from mage::LineReader.
|
overrideprivatevirtual |
Pre-processes before reading the current file of this MDL reader.
Exception | Failed to finish the pre-processing successfully. |
Reimplemented from mage::LineReader.
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 MDL reader.
Exception | Failed to the current line of this MDL reader. |
Implements mage::LineReader.
|
private |
|
private |
Reads a Submodel definition.
Exception | Failed to read a Submodel definition. |
|
private |
A reference to the model output containing the model data of this MDL reader.
|
private |
A reference to the resource manager of this MDL reader.