Open3D (C++ API)  0.17.0
FilamentEngine.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.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 open3d {
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 open3d
static void DestroyInstance()
Definition: FilamentEngine.cpp:75
static void SelectBackend(RenderingType type)
Definition: FilamentEngine.cpp:39
static void SetResourcePath(const std::string &resource_path)
Definition: FilamentEngine.cpp:43
static FilamentResourceManager & GetResourceManager()
Definition: FilamentEngine.cpp:55
static const std::string & GetResourcePath()
Definition: FilamentEngine.cpp:51
static filament::Engine & GetInstance()
Definition: FilamentEngine.cpp:53
RenderingType
Definition: FilamentEngine.h:24
~EngineInstance()
Definition: FilamentEngine.cpp:59
static void EnableHeadless()
Definition: FilamentEngine.cpp:41
Definition: FilamentResourceManager.h:50
char type
Definition: FilePCD.cpp:41
Definition: FilamentEngine.h:12
Definition: PinholeCameraIntrinsic.cpp:16