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

#include <msh_writer.hpp>

Inheritance diagram for mage::rendering::loader::MSHWriter< VertexT, IndexT >:
mage::BigEndianBinaryWriter

Public Member Functions

 MSHWriter (const std::vector< VertexT > &vertices, const std::vector< IndexT > &indices)
 
 MSHWriter (const MSHWriter &writer)=delete
 
 MSHWriter (MSHWriter &&writer) noexcept
 
 ~MSHWriter ()
 
MSHWriteroperator= (const MSHWriter &writer)=delete
 
MSHWriteroperator= (MSHWriter &&writer)=delete
 
void WriteToFile (std::filesystem::path path)
 

Private Member Functions

virtual void WriteData () override
 
- Private Member Functions inherited from mage::BigEndianBinaryWriter
BigEndianBinaryWriteroperator= (const BigEndianBinaryWriter &writer)=delete
 
BigEndianBinaryWriteroperator= (BigEndianBinaryWriter &&writer) noexcept
 
void WriteToFile (std::filesystem::path path)
 
 BigEndianBinaryWriter ()
 
 BigEndianBinaryWriter (const BigEndianBinaryWriter &writer)=delete
 
 BigEndianBinaryWriter (BigEndianBinaryWriter &&writer) noexcept
 
 ~BigEndianBinaryWriter ()
 
const std::filesystem::path & GetPath () const noexcept
 
template<typename T >
void Write (const T &data)
 
template<typename T >
void WriteArray (gsl::span< const T > data)
 
void WriteCharacter (char c)
 
void WriteString (NotNull< const_zstring > str)
 

Private Attributes

const std::vector< VertexT > & m_vertices
 
const std::vector< IndexT > & m_indices
 

Detailed Description

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

A class of MSH file writers for writing meshes.

Template Parameters
VertexTThe vertex type.
IndexTThe index type.

Constructor & Destructor Documentation

◆ MSHWriter() [1/3]

template<typename VertexT , typename IndexT >
mage::rendering::loader::MSHWriter< VertexT, IndexT >::MSHWriter ( const std::vector< VertexT > &  vertices,
const std::vector< IndexT > &  indices 
)
explicit

Constructs a MSH writer.

Parameters
[in]verticesA reference to a vector containing the vertices.
[in]indicesA reference to a vector containing the indices.

◆ MSHWriter() [2/3]

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

Constructs a MSH writer from the given MSH writer.

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

◆ MSHWriter() [3/3]

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

Constructs a MSH writer by moving the given MSH writer.

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

◆ ~MSHWriter()

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

Destructs this MSH writer.

Member Function Documentation

◆ operator=() [1/2]

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

Copies the given MSH writer to this MSH writer.

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

◆ operator=() [2/2]

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

Moves the given MSH writer to this MSH writer.

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

◆ WriteData()

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

Starts writing.

Exceptions
ExceptionFailed to write.

Implements mage::BigEndianBinaryWriter.

◆ WriteToFile()

template<typename VertexT , typename IndexT >
void mage::BigEndianBinaryWriter::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_indices

template<typename VertexT , typename IndexT >
const std::vector< IndexT >& mage::rendering::loader::MSHWriter< VertexT, IndexT >::m_indices
private

A reference to a vector containing the indices to write by this VS writer.

◆ m_vertices

template<typename VertexT , typename IndexT >
const std::vector< VertexT >& mage::rendering::loader::MSHWriter< VertexT, IndexT >::m_vertices
private

A reference to a vector containing the vertices to write by this VS writer.