Blue Brain BioExplorer
core::LoaderRegistry Class Reference

#include <LoaderRegistry.h>

Public Member Functions

void registerLoader (std::unique_ptr< Loader > loader)
 
const std::vector< LoaderInfo > & getLoaderInfos () const
 
bool isSupportedFile (const std::string &filename) const
 
bool isSupportedType (const std::string &type) const
 
const LoadergetSuitableLoader (const std::string &filename, const std::string &filetype, const std::string &loaderName) const
 
void load (const std::string &path, Scene &scene, const Matrix4f &transformation, const size_t materialID, LoaderProgress cb)
 
void clear ()
 
void registerArchiveLoader (std::unique_ptr< Loader > loader)
 

Detailed Description

Holds information about registered loaders and helps invoking the appropriate loader for a given blob or file.

Definition at line 42 of file LoaderRegistry.h.

Member Function Documentation

◆ clear()

void core::LoaderRegistry::clear ( )

Definition at line 94 of file LoaderRegistry.cpp.

◆ getLoaderInfos()

const std::vector< LoaderInfo > & core::LoaderRegistry::getLoaderInfos ( ) const

Get a list of loaders and their supported file extensions and properties

Definition at line 35 of file LoaderRegistry.cpp.

◆ getSuitableLoader()

const Loader & core::LoaderRegistry::getSuitableLoader ( const std::string &  filename,
const std::string &  filetype,
const std::string &  loaderName 
) const

Get a loader that matches the provided name, filetype or loader name.

Exceptions
std::runtime_errorif no loader found.

Definition at line 64 of file LoaderRegistry.cpp.

◆ isSupportedFile()

bool core::LoaderRegistry::isSupportedFile ( const std::string &  filename) const
Returns
true if any of the registered loaders can handle the given file

Definition at line 40 of file LoaderRegistry.cpp.

◆ isSupportedType()

bool core::LoaderRegistry::isSupportedType ( const std::string &  type) const
Returns
true if any of the registered loaders can handle the given type

Definition at line 54 of file LoaderRegistry.cpp.

◆ load()

void core::LoaderRegistry::load ( const std::string &  path,
Scene scene,
const Matrix4f transformation,
const size_t  materialID,
LoaderProgress  cb 
)

Load the given file or folder into the given scene by choosing the first matching loader based on the filename or filetype.

Parameters
paththe file or folder containing the data to import
scenethe scene where to add the loaded model to
transformationthe transformation to apply for the added model
materialIDthe default material ot use
cbthe callback for progress updates from the loader

◆ registerArchiveLoader()

void core::LoaderRegistry::registerArchiveLoader ( std::unique_ptr< Loader loader)

Definition at line 101 of file LoaderRegistry.cpp.

◆ registerLoader()

void core::LoaderRegistry::registerLoader ( std::unique_ptr< Loader loader)

Register the given loader.

Definition at line 29 of file LoaderRegistry.cpp.


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