Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
castor3d::MeshImporter Class Referenceabstract

#include <Importer.hpp>

Inheritance diagram for castor3d::MeshImporter:
Inheritance graph
[legend]
Collaboration diagram for castor3d::MeshImporter:
Collaboration graph
[legend]

Public Member Functions

virtual ~MeshImporter ()=default
 
C3D_API MeshImporter (Engine &engine)
 Constructor. More...
 
C3D_API bool import (Mesh &mesh, castor::Path const &pathFile, Parameters const &parameters, bool initialise)
 Mesh import Function. More...
 
C3D_API bool import (Scene &scene, castor::Path const &pathFile, Parameters const &parameters, std::map< TextureFlag, TextureConfiguration > const &textureRemaps, bool initialise)
 Scene import Function. More...
 
C3D_API castor::ImageSPtr loadImage (castor::String const &name, castor::ImageCreateParams const &params) const
 Loads an image. More...
 
C3D_API castor::ImageSPtr loadImage (castor::Path const &path) const
 Loads an image from a file. More...
 
C3D_API castor::ImageSPtr loadImage (castor::String name, castor::String type, castor::ByteArray data) const
 Loads a texture. More...
 
C3D_API TextureSourceInfo loadTexture (castor3d::SamplerRes sampler, castor::Path const &path, TextureConfiguration const &config) const
 Loads a texture. More...
 
C3D_API TextureSourceInfo loadTexture (castor3d::SamplerRes sampler, castor::String name, castor::String type, castor::ByteArray data, TextureConfiguration const &config) const
 Loads a texture. More...
 
C3D_API bool convertToNormalMap (castor::Path &path, castor3d::TextureConfiguration &config) const
 Converts given height image file to a normal+height image. More...
 

Protected Member Functions

virtual C3D_API bool doImportMesh (Mesh &mesh)=0
 Mesh import Function. More...
 
virtual C3D_API bool doImportScene (Scene &scene)=0
 Scene import Function. More...
 

Protected Attributes

castor::Path m_fileName
 The file name. More...
 
castor::Path m_filePath
 The file full path. More...
 
SceneNodePtrArray m_nodes
 The loaded scene nodes. More...
 
GeometryPtrStrMap m_geometries
 The loaded geometries. More...
 
MeshPtrStrMap m_meshes
 The loaded meshes. More...
 
Parameters m_parameters
 Import configuration parameters. More...
 
std::map< TextureFlag, TextureConfigurationm_textureRemaps
 Import texture remapping parameters. More...
 

Constructor & Destructor Documentation

◆ ~MeshImporter()

virtual castor3d::MeshImporter::~MeshImporter ( )
virtualdefault

◆ MeshImporter()

C3D_API castor3d::MeshImporter::MeshImporter ( Engine engine)
explicit

Constructor.

Parameters
[in]engineThe engine.

Member Function Documentation

◆ convertToNormalMap()

C3D_API bool castor3d::MeshImporter::convertToNormalMap ( castor::Path &  path,
castor3d::TextureConfiguration config 
) const

Converts given height image file to a normal+height image.

Parameters
[in,out]pathThe image file path (can be relative or absolute), receives the resulting normal+height image file path.
[in,out]configThe texture unit configuration.
Returns
false if any error occured.

◆ doImportMesh()

virtual C3D_API bool castor3d::MeshImporter::doImportMesh ( Mesh mesh)
protectedpure virtual

Mesh import Function.

Parameters
[out]meshReceives the imported data.
Returns
false if any problem occured.

Implemented in castor3d::CmshImporter.

◆ doImportScene()

virtual C3D_API bool castor3d::MeshImporter::doImportScene ( Scene scene)
protectedpure virtual

Scene import Function.

Parameters
[out]sceneReceives the imported data.
Returns
false if any problem occured.

Implemented in castor3d::CmshImporter.

◆ import() [1/2]

C3D_API bool castor3d::MeshImporter::import ( Mesh mesh,
castor::Path const &  pathFile,
Parameters const &  parameters,
bool  initialise 
)

Mesh import Function.

Parameters
[out]meshReceives the imported data.
[in]pathFileThe location of the file to import.
[in]parametersImport configuration parameters.
[in]initialiseTells if the imported mesh must be initialised.
Returns
false if any problem occured.

◆ import() [2/2]

C3D_API bool castor3d::MeshImporter::import ( Scene scene,
castor::Path const &  pathFile,
Parameters const &  parameters,
std::map< TextureFlag, TextureConfiguration > const &  textureRemaps,
bool  initialise 
)

Scene import Function.

Parameters
[out]sceneReceives the imported data.
[in]pathFileThe location of the file to import.
[in]parametersImport configuration parameters.
[in]textureRemapsThe imported textures remapping parameters.
[in]initialiseTells if the imported meshes must be initialised.
Returns
false if any problem occured.

◆ loadImage() [1/3]

C3D_API castor::ImageSPtr castor3d::MeshImporter::loadImage ( castor::Path const &  path) const

Loads an image from a file.

Parameters
[in]pathThe image file path (can be relative or absolute).
Returns
The image.

◆ loadImage() [2/3]

C3D_API castor::ImageSPtr castor3d::MeshImporter::loadImage ( castor::String const &  name,
castor::ImageCreateParams const &  params 
) const

Loads an image.

Parameters
[in]nameThe image name.
[in]paramsThe image creation parameters.
Returns
The image.

◆ loadImage() [3/3]

C3D_API castor::ImageSPtr castor3d::MeshImporter::loadImage ( castor::String  name,
castor::String  type,
castor::ByteArray  data 
) const

Loads a texture.

Parameters
[in]nameThe image name.
[in]typeThe image data type.
[in]dataThe image data.
Returns
The texture unit.

◆ loadTexture() [1/2]

C3D_API TextureSourceInfo castor3d::MeshImporter::loadTexture ( castor3d::SamplerRes  sampler,
castor::Path const &  path,
TextureConfiguration const &  config 
) const

Loads a texture.

Parameters
[in]samplerThe sampler used by the texture.
[in]pathThe image file path (can be relative or absolute).
[in]configThe texture unit configuration.
Returns
The texture unit.

◆ loadTexture() [2/2]

C3D_API TextureSourceInfo castor3d::MeshImporter::loadTexture ( castor3d::SamplerRes  sampler,
castor::String  name,
castor::String  type,
castor::ByteArray  data,
TextureConfiguration const &  config 
) const

Loads a texture.

Parameters
[in]samplerThe sampler used by the texture.
[in]nameThe image name.
[in]typeThe image data type.
[in]dataThe image data.
[in]configThe texture unit configuration.
Returns
The texture unit.

Member Data Documentation

◆ m_fileName

castor::Path castor3d::MeshImporter::m_fileName
protected

The file name.

◆ m_filePath

castor::Path castor3d::MeshImporter::m_filePath
protected

The file full path.

◆ m_geometries

GeometryPtrStrMap castor3d::MeshImporter::m_geometries
protected

The loaded geometries.

◆ m_meshes

MeshPtrStrMap castor3d::MeshImporter::m_meshes
protected

The loaded meshes.

◆ m_nodes

SceneNodePtrArray castor3d::MeshImporter::m_nodes
protected

The loaded scene nodes.

◆ m_parameters

Parameters castor3d::MeshImporter::m_parameters
protected

Import configuration parameters.

◆ m_textureRemaps

std::map< TextureFlag, TextureConfiguration > castor3d::MeshImporter::m_textureRemaps
protected

Import texture remapping parameters.


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