Nameless Engine
Loading...
Searching...
No Matches
ne::MeshData Class Reference

#include <MeshNode.h>

Inheritance diagram for ne::MeshData:
ne::Serializable

Public Types

using meshindex_t = unsigned int
 

Public Member Functions

 MeshData (const MeshData &)=default
 
MeshDataoperator= (const MeshData &)=default
 
 MeshData (MeshData &&) noexcept=default
 
MeshDataoperator= (MeshData &&) noexcept=default
 
std::vector< MeshVertex > * getVertices ()
 
std::vector< std::vector< meshindex_t > > * getIndices ()
 
- Public Member Functions inherited from ne::Serializable
std::optional< Errorserialize (std::filesystem::path pathToFile, bool bEnableBackup, const std::unordered_map< std::string, std::string > &customAttributes={})
 
std::variant< std::string, Errorserialize (toml::value &tomlData, const std::string &sEntityId="", const std::unordered_map< std::string, std::string > &customAttributes={}, const std::optional< std::filesystem::path > &optionalPathToFile={}, bool bEnableBackup=false)
 
std::variant< std::string, Errorserialize (toml::value &tomlData, Serializable *pOriginalObject, std::string sEntityId="", const std::unordered_map< std::string, std::string > &customAttributes={}, const std::optional< std::filesystem::path > &optionalPathToFile={}, bool bEnableBackup=false)
 
std::optional< std::pair< std::string, std::string > > getPathDeserializedFromRelativeToRes () const
 

Private Attributes

std::vector< MeshVertexvVertices
 
std::vector< std::vector< meshindex_t > > vIndices
 

Additional Inherited Members

- Static Public Member Functions inherited from ne::Serializable
static std::optional< ErrorserializeMultiple (std::filesystem::path pathToFile, std::vector< SerializableObjectInformation > vObjects, bool bEnableBackup)
 
static std::variant< std::set< std::string >, ErrorgetIdsFromFile (std::filesystem::path pathToFile)
 
template<typename SmartPointer , typename InnerType = typename SmartPointer::element_type>
requires std::derived_from<InnerType, Serializable> && (std::same_as<SmartPointer, sgc::GcPtr<InnerType>> || std::same_as<SmartPointer, std::unique_ptr<InnerType>>)
static std::variant< SmartPointer, Errordeserialize (const std::filesystem::path &pathToFile)
 
template<typename SmartPointer , typename InnerType = typename SmartPointer::element_type>
requires std::derived_from<InnerType, Serializable> && (std::same_as<SmartPointer, sgc::GcPtr<InnerType>> || std::same_as<SmartPointer, std::unique_ptr<InnerType>>)
static std::variant< SmartPointer, Errordeserialize (const std::filesystem::path &pathToFile, std::unordered_map< std::string, std::string > &customAttributes)
 
template<typename SmartPointer , typename InnerType = typename SmartPointer::element_type>
requires std::derived_from<InnerType, Serializable> && (std::same_as<SmartPointer, sgc::GcPtr<InnerType>> || std::same_as<SmartPointer, std::unique_ptr<InnerType>>)
static std::variant< SmartPointer, Errordeserialize (std::filesystem::path pathToFile, std::unordered_map< std::string, std::string > &customAttributes, const std::string &sEntityId)
 
template<typename SmartPointer , typename InnerType = typename SmartPointer::element_type>
requires std::derived_from<InnerType, Serializable> && (std::same_as<SmartPointer, sgc::GcPtr<InnerType>> || std::same_as<SmartPointer, std::unique_ptr<InnerType>>)
static std::variant< SmartPointer, Errordeserialize (const std::filesystem::path &pathToFile, const std::string &sEntityId)
 
template<typename SmartPointer , typename InnerType = typename SmartPointer::element_type>
requires std::same_as<SmartPointer, sgc::GcPtr<Serializable>> || std::same_as<SmartPointer, std::unique_ptr<Serializable>>
static std::variant< std::vector< DeserializedObjectInformation< SmartPointer > >, ErrordeserializeMultiple (std::filesystem::path pathToFile, const std::set< std::string > &ids)
 
template<typename SmartPointer , typename InnerType = typename SmartPointer::element_type>
requires std::derived_from<InnerType, Serializable> && (std::same_as<SmartPointer, sgc::GcPtr<InnerType>> || std::same_as<SmartPointer, std::unique_ptr<InnerType>>)
static std::variant< SmartPointer, Errordeserialize (const toml::value &tomlData, std::unordered_map< std::string, std::string > &customAttributes, std::string sEntityId="", std::optional< std::filesystem::path > optionalPathToFile={})
 
- Protected Member Functions inherited from ne::Serializable
virtual void onAfterDeserialized ()
 

Detailed Description

Stores mesh geometry (vertices and indices).

Member Typedef Documentation

◆ meshindex_t

using ne::MeshData::meshindex_t = unsigned int

Type of mesh index.

Constructor & Destructor Documentation

◆ MeshData() [1/2]

ne::MeshData::MeshData ( const MeshData )
default

Copy constructor.

◆ MeshData() [2/2]

ne::MeshData::MeshData ( MeshData &&  )
defaultnoexcept

Move constructor.

Member Function Documentation

◆ getIndices()

std::vector< std::vector< MeshData::meshindex_t > > * ne::MeshData::getIndices ( )

Returns array of mesh indices per material slot so first element in the array stores indices of the mesh that use material slot 0, then indices that use material slot 1 and so on.

Returns
Mesh indices.

◆ getVertices()

std::vector< MeshVertex > * ne::MeshData::getVertices ( )

Returns mesh vertices.

Returns
Mesh vertices.

◆ operator=() [1/2]

MeshData & ne::MeshData::operator= ( const MeshData )
default

Copy assignment.

Returns
This.

◆ operator=() [2/2]

MeshData & ne::MeshData::operator= ( MeshData &&  )
defaultnoexcept

Move assignment.

Returns
This.

Member Data Documentation

◆ vIndices

std::vector<std::vector<meshindex_t> > ne::MeshData::vIndices
private

Stores array of mesh indices per material slot so first element in the array stores indices of the mesh that use material slot 0, then indices that use material slot 1 and so on.

Remarks
This array defines how much material slots will be available.

◆ vVertices

std::vector<MeshVertex> ne::MeshData::vVertices
private

Mesh vertices.


The documentation for this class was generated from the following files: