Open3D (C++ API)
0.19.0
Loading...
Searching...
No Matches
cpp
open3d
visualization
visualizer
GuiSettingsModel.h
Go to the documentation of this file.
1
// ----------------------------------------------------------------------------
2
// - Open3D: www.open3d.org -
3
// ----------------------------------------------------------------------------
4
// Copyright (c) 2018-2024 www.open3d.org
5
// SPDX-License-Identifier: MIT
6
// ----------------------------------------------------------------------------
7
8
#pragma once
9
10
#include <map>
11
12
#include "
open3d/visualization/rendering/Scene.h
"
13
14
namespace
open3d
{
15
namespace
visualization
{
16
17
class
GuiSettingsModel
{
18
public
:
19
static
constexpr
const
char
*
DEFAULT_IBL
=
"default"
;
20
static
constexpr
const
char
*
CUSTOM_IBL
=
"Custom KTX file..."
;
21
static
constexpr
const
char
*
DEFAULT_MATERIAL_NAME
=
"Polished ceramic"
;
22
static
constexpr
const
char
*
MATERIAL_FROM_FILE_NAME
=
23
"Material from file [default]"
;
24
static
constexpr
const
char
*
POINT_CLOUD_PROFILE_NAME
=
25
"Cloudy day (no direct sun)"
;
26
27
struct
LightingProfile
{
28
std::string
name
;
29
double
ibl_intensity
;
30
double
sun_intensity
;
31
Eigen::Vector3f
sun_dir
;
32
Eigen::Vector3f
sun_color
= {1.0f, 1.0f, 1.0f};
33
rendering::Scene::Transform
ibl_rotation
=
34
rendering::Scene::Transform::Identity();
35
bool
ibl_enabled
=
true
;
36
bool
use_default_ibl
=
false
;
37
bool
sun_enabled
=
true
;
38
};
39
40
enum
MaterialType
{
41
LIT
= 0,
42
UNLIT
,
43
NORMAL_MAP
,
44
DEPTH
,
45
};
46
47
struct
LitMaterial
{
48
Eigen::Vector3f
base_color
= {0.9f, 0.9f, 0.9f};
49
float
metallic
= 0.f;
50
float
roughness
= 0.7f;
51
float
reflectance
= 0.5f;
52
float
clear_coat
= 0.2f;
53
float
clear_coat_roughness
= 0.2f;
54
float
anisotropy
= 0.f;
55
};
56
57
struct
UnlitMaterial
{
58
// The base color should NOT be {1, 1, 1}, because then the
59
// model will be invisible against the default white background.
60
Eigen::Vector3f
base_color
= {0.9f, 0.9f, 0.9f};
61
};
62
63
struct
Materials
{
64
LitMaterial
lit
;
65
UnlitMaterial
unlit
;
66
float
point_size
= 3.0f;
67
// 'name' is only used to keep the UI in sync. It is set by
68
// Set...Material[s]() and should not be set manually.
69
std::string
lit_name
;
70
};
71
72
static
const
std::vector<LightingProfile>
lighting_profiles_
;
73
static
const
std::map<std::string, const LitMaterial>
prefab_materials_
;
74
static
const
LightingProfile
&
GetDefaultLightingProfile
();
75
static
const
LightingProfile
&
GetDefaultPointCloudLightingProfile
();
76
static
const
LitMaterial
&