Blue Brain BioExplorer
LoaderRegistry.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2024, EPFL/Blue Brain Project
3  *
4  * Responsible Author: Daniel.Nachbaur@epfl.ch
5  *
6  * This file is part of Blue Brain BioExplorer <https://github.com/BlueBrain/BioExplorer>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License version 3.0 as published
10  * by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #pragma once
23 
26 
27 #include <set>
28 
29 namespace core
30 {
31 struct LoaderInfo
32 {
33  std::string name;
34  std::vector<std::string> extensions;
36 };
37 
43 {
44 public:
46  void registerLoader(std::unique_ptr<Loader> loader);
47 
51  const std::vector<LoaderInfo>& getLoaderInfos() const;
52 
56  bool isSupportedFile(const std::string& filename) const;
57 
61  bool isSupportedType(const std::string& type) const;
62 
67  const Loader& getSuitableLoader(const std::string& filename, const std::string& filetype,
68  const std::string& loaderName) const;
69 
80  void load(const std::string& path, Scene& scene, const Matrix4f& transformation, const size_t materialID,
81  LoaderProgress cb);
82 
84  void clear();
85 
87  void registerArchiveLoader(std::unique_ptr<Loader> loader);
88 
89 private:
90  bool _archiveSupported(const std::string& filename, const std::string& filetype) const;
91 
92  std::vector<std::unique_ptr<Loader>> _loaders;
93  std::unique_ptr<Loader> _archiveLoader;
94  std::vector<LoaderInfo> _loaderInfos;
95 };
96 } // namespace core
bool isSupportedType(const std::string &type) const
const std::vector< LoaderInfo > & getLoaderInfos() const
void load(const std::string &path, Scene &scene, const Matrix4f &transformation, const size_t materialID, LoaderProgress cb)
void registerLoader(std::unique_ptr< Loader > loader)
bool isSupportedFile(const std::string &filename) const
const Loader & getSuitableLoader(const std::string &filename, const std::string &filetype, const std::string &loaderName) const
void registerArchiveLoader(std::unique_ptr< Loader > loader)
Scene object This object contains collections of geometries, materials and light sources that are use...
Definition: Scene.h:43
glm::mat4 Matrix4f
Definition: MathTypes.h:125
std::vector< std::string > extensions
std::string name
PropertyMap properties