ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
FilamentEngine.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <string>
11 
12 namespace filament {
13 class Engine;
14 }
15 
16 namespace cloudViewer {
17 namespace visualization {
18 namespace rendering {
19 
20 class FilamentResourceManager;
21 
23 public:
25 
26  // Selects backend to use.
27  // Should be called before instance usage.
28  // If not called, platform available default backend will be used.
29  static void SelectBackend(RenderingType type);
30 
33  static void EnableHeadless();
34 
35  // Specifies path to load shaders and skyboxes from. Must be called before
36  // instance usage, or default path will be used.
37  static void SetResourcePath(const std::string& resource_path);
38  static const std::string& GetResourcePath();
39 
40  static filament::Engine& GetInstance();
42 
46  static void DestroyInstance();
47 
49 
50 private:
51  static EngineInstance& Get();
52 
54 
55  static RenderingType type_;
56  static bool is_headless_;
57  static std::string resource_path_;
58  filament::Engine* engine_;
59  FilamentResourceManager* resource_manager_;
60 };
61 
62 } // namespace rendering
63 } // namespace visualization
64 } // namespace cloudViewer
char type
static FilamentResourceManager & GetResourceManager()
static void SetResourcePath(const std::string &resource_path)
Generic file read and write utility for python interface.