MAGE  v0.171.0
Matthias Advanced Game Engine
mage::rendering::loader::MDLWriter< VertexT, IndexT > Class Template Reference

#include <mdl_writer.hpp>

Inheritance diagram for mage::rendering::loader::MDLWriter< VertexT, IndexT >:
mage::Writer

Public Member Functions

 MDLWriter (const ModelOutput< VertexT, IndexT > &model_output)
 
 MDLWriter (const MDLWriter &writer)=delete
 
 MDLWriter (MDLWriter &&writer) noexcept
 
 ~MDLWriter ()
 
MDLWriteroperator= (const MDLWriter &writer)=delete
 
MDLWriteroperator= (MDLWriter &&writer)=delete
 
void WriteToFile (std::filesystem::path path)
 

Private Member Functions

virtual void Write () override
 
void ExportMesh ()
 
void WriteMaterials ()
 
void WriteModelParts ()
 
- Private Member Functions inherited from mage::Writer
Writeroperator= (const Writer &writer)=delete
 
Writeroperator= (Writer &&writer) noexcept
 
void WriteToFile (std::filesystem::path path)
 
 Writer ()
 
 Writer (const Writer &writer)=delete
 
 Writer (Writer &&writer) noexcept
 
 ~Writer ()
 
const std::filesystem::path & GetPath () const noexcept
 
void WriteCharacter (char c)
 
void WriteString (NotNull< const_zstring > str)
 
void WriteStringLine (NotNull< const_zstring > str)
 

Private Attributes

const ModelOutput< VertexT, IndexT > & m_model_output
 

Detailed Description

template<typename VertexT, typename IndexT>
class mage::rendering::loader::MDLWriter< VertexT, IndexT >

A class of MDL file writers for writing models.

Template Parameters
VertexTThe vertex type.
IndexTThe index type.

Constructor & Destructor Documentation

◆ MDLWriter() [1/3]

template<typename VertexT , typename IndexT >
mage::rendering::loader::MDLWriter< VertexT, IndexT >::MDLWriter ( const ModelOutput< VertexT, IndexT > &  model_output)
explicit

Constructs a MDL writer.

Parameters
[in,out]model_outputA reference to the model output containing the model data.

◆ MDLWriter() [2/3]

template<typename VertexT , typename IndexT >
mage::rendering::loader::MDLWriter< VertexT, IndexT >::MDLWriter ( const MDLWriter< VertexT, IndexT > &  writer)
delete

Constructs a MDL writer from the given MDL writer.

Parameters
[in]writerA reference to the MDL writer to copy.

◆ MDLWriter() [3/3]

template<typename VertexT , typename IndexT >
mage::rendering::loader::MDLWriter< VertexT, IndexT >::MDLWriter ( MDLWriter< VertexT, IndexT > &&  writer)
noexcept

Constructs a MDL writer by moving the given MDL writer.

Parameters
[in]writerA reference to the MDL writer to move.

◆ ~MDLWriter()

template<typename VertexT , typename IndexT >
mage::rendering::loader::MDLWriter< VertexT, IndexT >::~MDLWriter ( )

Destructs this MDL writer.

Member Function Documentation

◆ ExportMesh()

template<typename VertexT , typename IndexT >
void mage::rendering::loader::MDLWriter< VertexT, IndexT >::ExportMesh ( )
private

Writes and exports the mesh corresponding to the model.

Exceptions
ExceptionFailed to write.
ExceptionFailed to export the mesh corresponding to the model to file.

◆ operator=() [1/2]

template<typename VertexT , typename IndexT >
MDLWriter& mage::rendering::loader::MDLWriter< VertexT, IndexT >::operator= ( const MDLWriter< VertexT, IndexT > &  writer)
delete

Copies the given MDL writer to this MDL writer.

Parameters
[in]writerA reference to a MDL writer to copy.
Returns
A reference to the copy of the given MDL writer (i.e. this MDL writer).

◆ operator=() [2/2]

template<typename VertexT , typename IndexT >
MDLWriter& mage::rendering::loader::MDLWriter< VertexT, IndexT >::operator= ( MDLWriter< VertexT, IndexT > &&  writer)
delete

Moves the given MDL writer to this MDL writer.

Parameters
[in]writerA reference to a MDL writer to move.
Returns
A reference to the moved MDL writer (i.e. this MDL writer).

◆ Write()

template<typename VertexT , typename IndexT >
virtual void mage::rendering::loader::MDLWriter< VertexT, IndexT >::Write ( )
overrideprivatevirtual

Starts writing.

Exceptions
ExceptionFailed to write.

Implements mage::Writer.

◆ WriteMaterials()

template<typename VertexT , typename IndexT >
void mage::rendering::loader::MDLWriter< VertexT, IndexT >::WriteMaterials ( )
private

Writes the materials corresponding to the model.

Exceptions
ExceptionFailed to write.

◆ WriteModelParts()

template<typename VertexT , typename IndexT >
void mage::rendering::loader::MDLWriter< VertexT, IndexT >::WriteModelParts ( )
private

Writes the model parts corresponding to the model.

Exceptions
ExceptionFailed to write.

◆ WriteToFile()

template<typename VertexT , typename IndexT >
void mage::Writer::WriteToFile

Writes to the file associated with the given path.

Parameters
[in]pathThe path.
Exceptions
ExceptionFailed to write to the file.

Member Data Documentation

◆ m_model_output

template<typename VertexT , typename IndexT >
const ModelOutput< VertexT, IndexT >& mage::rendering::loader::MDLWriter< VertexT, IndexT >::m_model_output
private

A reference to the model output containing the model data of this MDL writer.