Blue Brain BioExplorer
LoadModelFunctor.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2024, EPFL/Blue Brain Project
3  * All rights reserved. Do not distribute without permission.
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 
28 
29 namespace core
30 {
36 {
37 public:
38  LoadModelFunctor(Engine& engine, const ModelParams& params);
42 
43 private:
44  ModelDescriptorPtr _performLoad(const std::function<ModelDescriptorPtr()>& loadData);
45 
46  ModelDescriptorPtr _loadData(Blob&& blob, const ModelParams& params);
47  ModelDescriptorPtr _loadData(const std::string& path, const ModelParams& params);
48 
49  void _updateProgress(const std::string& message, const size_t increment);
50 
51  std::function<void(std::string, float)> _getProgressFunc();
52 
53  Engine& _engine;
54  ModelParams _params;
55  size_t _currentProgress{0};
56  size_t _nextTic{0};
57 };
58 } // namespace core
Provides an abstract implementation of a ray-tracing engine.
Definition: Engine.h:59
ModelDescriptorPtr operator()()
LoadModelFunctor(LoadModelFunctor &&)=default
LoadModelFunctor(Engine &engine, const ModelParams &params)
The ModelParams class represents the parameters needed for initializing a model instance.
Definition: Model.h:178
std::shared_ptr< ModelDescriptor > ModelDescriptorPtr
Definition: Types.h:112