Easy3D 2.5.3
setting.h
1/********************************************************************
2 * Copyright (C) 2015 Liangliang Nan <liangliang.nan@gmail.com>
3 * https://3d.bk.tudelft.nl/liangliang/
4 *
5 * This file is part of Easy3D. If it is useful in your research/work,
6 * I would be grateful if you show your appreciation by citing it:
7 * ------------------------------------------------------------------
8 * Liangliang Nan.
9 * Easy3D: a lightweight, easy-to-use, and efficient C++ library
10 * for processing and rendering 3D data.
11 * Journal of Open Source Software, 6(64), 3255, 2021.
12 * ------------------------------------------------------------------
13 *
14 * Easy3D is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License Version 3
16 * as published by the Free Software Foundation.
17 *
18 * Easy3D is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 ********************************************************************/
26
27#ifndef EASY3D_UTIL_SETTING_H
28#define EASY3D_UTIL_SETTING_H
29
30#include <easy3d/core/types.h>
31#include <easy3d/util/export.h>
32
33
34namespace easy3d {
35
40 namespace setting {
41
54 void initialize(const std::string &setting_file = "default");
55
57 bool save(const std::string &filename);
58
60 bool load(const std::string &filename);
61
63 extern EASY3D_UTIL_EXPORT vec4 background_color;
65 extern EASY3D_UTIL_EXPORT vec4 highlight_color;
67 extern EASY3D_UTIL_EXPORT vec4 light_position; // light position defined in camera coordinate system
69 extern EASY3D_UTIL_EXPORT vec4 material_ambient;
70 extern EASY3D_UTIL_EXPORT vec4 material_specular;
71 extern EASY3D_UTIL_EXPORT float material_shininess; // specular power
72
74 extern EASY3D_UTIL_EXPORT float effect_ssao_radius;
75 extern EASY3D_UTIL_EXPORT float effect_ssao_intensity;
76 extern EASY3D_UTIL_EXPORT float effect_ssao_bias;
77 extern EASY3D_UTIL_EXPORT float effect_ssao_sharpness;
78 extern EASY3D_UTIL_EXPORT bool effect_edl_enabled;
79 extern EASY3D_UTIL_EXPORT bool effect_transparency_enabled;
80 extern EASY3D_UTIL_EXPORT bool effect_shadow_enabled;
81 extern EASY3D_UTIL_EXPORT float effect_shadow_light_distance;
82 extern EASY3D_UTIL_EXPORT float effect_shadow_softness;
83 extern EASY3D_UTIL_EXPORT float effect_shadow_darkness;
84
86 extern EASY3D_UTIL_EXPORT bool points_drawable_two_side_lighting;
87 extern EASY3D_UTIL_EXPORT bool points_drawable_distinct_backside_color;
88 extern EASY3D_UTIL_EXPORT vec4 points_drawable_backside_color;
89 // lines drawable
90 extern EASY3D_UTIL_EXPORT bool lines_drawable_two_side_lighting;
91 extern EASY3D_UTIL_EXPORT bool lines_drawable_distinct_backside_color;
92 extern EASY3D_UTIL_EXPORT vec4 lines_drawable_backside_color;
93 // triangles drawable
94 extern EASY3D_UTIL_EXPORT bool triangles_drawable_two_side_lighting;
95 extern EASY3D_UTIL_EXPORT bool triangles_drawable_distinct_backside_color;
96 extern EASY3D_UTIL_EXPORT vec4 triangles_drawable_backside_color;
97
99 extern EASY3D_UTIL_EXPORT bool point_cloud_vertices_visible;
100 extern EASY3D_UTIL_EXPORT vec4 point_cloud_vertices_color;
101 extern EASY3D_UTIL_EXPORT bool point_cloud_vertices_impostors;
102 extern EASY3D_UTIL_EXPORT float point_cloud_vertices_size;
103
105 extern EASY3D_UTIL_EXPORT bool surface_mesh_faces_phong_shading;
106 extern EASY3D_UTIL_EXPORT bool surface_mesh_faces_visible;
107 extern EASY3D_UTIL_EXPORT vec4 surface_mesh_faces_color;
108 extern EASY3D_UTIL_EXPORT float surface_mesh_faces_opacity;
110 extern EASY3D_UTIL_EXPORT bool surface_mesh_vertices_visible;
111 extern EASY3D_UTIL_EXPORT vec4 surface_mesh_vertices_color;
112 extern EASY3D_UTIL_EXPORT bool surface_mesh_vertices_imposters;
113 extern EASY3D_UTIL_EXPORT float surface_mesh_vertices_size;
115 extern EASY3D_UTIL_EXPORT bool surface_mesh_edges_visible;
116 extern EASY3D_UTIL_EXPORT vec4 surface_mesh_edges_color;
117 extern EASY3D_UTIL_EXPORT bool surface_mesh_edges_imposters;
118 extern EASY3D_UTIL_EXPORT float surface_mesh_edges_size;
120 extern EASY3D_UTIL_EXPORT bool surface_mesh_borders_visible;
121 extern EASY3D_UTIL_EXPORT vec4 surface_mesh_borders_color;
122 extern EASY3D_UTIL_EXPORT bool surface_mesh_borders_imposters;
123 extern EASY3D_UTIL_EXPORT float surface_mesh_borders_size;
124
126 extern EASY3D_UTIL_EXPORT bool graph_vertices_visible;
127 extern EASY3D_UTIL_EXPORT vec4 graph_vertices_color;
128 extern EASY3D_UTIL_EXPORT bool graph_vertices_imposters;
129 extern EASY3D_UTIL_EXPORT float graph_vertices_size;
131 extern EASY3D_UTIL_EXPORT bool graph_edges_visible;
132 extern EASY3D_UTIL_EXPORT vec4 graph_edges_color;
133 extern EASY3D_UTIL_EXPORT bool graph_edges_imposters;
134 extern EASY3D_UTIL_EXPORT float graph_edges_size;
135
137 extern EASY3D_UTIL_EXPORT bool poly_mesh_faces_visible;
138 extern EASY3D_UTIL_EXPORT vec4 poly_mesh_faces_color;
140 extern EASY3D_UTIL_EXPORT bool poly_mesh_vertices_visible;
141 extern EASY3D_UTIL_EXPORT vec4 poly_mesh_vertices_color;
142 extern EASY3D_UTIL_EXPORT bool poly_mesh_vertices_imposters;
143 extern EASY3D_UTIL_EXPORT float poly_mesh_vertices_size;
145 extern EASY3D_UTIL_EXPORT bool poly_mesh_edges_visible;
146 extern EASY3D_UTIL_EXPORT vec4 poly_mesh_edges_color;
147 extern EASY3D_UTIL_EXPORT bool poly_mesh_edges_imposters;
148 extern EASY3D_UTIL_EXPORT float poly_mesh_edges_size;
149
151 extern EASY3D_UTIL_EXPORT vec4 clipping_plane_color;
152
153 } // namespace setting
154
155} // namespace easy3d
156
157
158#endif // EASY3D_UTIL_SETTING_H
float effect_ssao_radius
effect
Definition: setting.cpp:48
vec4 highlight_color
highlight: color for highlighted/selected primitives
Definition: setting.cpp:38
void initialize(const std::string &setting_file)
Initializes the default setting for rendering.
Definition: setting.cpp:157
bool surface_mesh_vertices_visible
surface mesh - vertices
Definition: setting.cpp:84
bool poly_mesh_edges_visible
polyhedral mesh - edges
Definition: setting.cpp:119
bool save(const std::string &file_name)
Save the setting (i.e., rendering parameters) to a file.
Definition: setting.cpp:184
bool surface_mesh_edges_visible
surface mesh - edges
Definition: setting.cpp:89
vec4 clipping_plane_color
clipping plane
Definition: setting.cpp:125
bool poly_mesh_vertices_visible
polyhedral mesh - vertices
Definition: setting.cpp:114
bool surface_mesh_borders_visible
surface mesh - borders
Definition: setting.cpp:94
vec4 light_position
lighting
Definition: setting.cpp:40
bool poly_mesh_faces_visible
polyhedral mesh - surface
Definition: setting.cpp:111
vec4 background_color
background color of the viewer
Definition: setting.cpp:36
bool load(const std::string &file_name)
Load the setting (i.e., rendering parameters) from a file.
Definition: setting.cpp:300
vec4 material_ambient
material
Definition: setting.cpp:43
bool point_cloud_vertices_visible
point cloud
Definition: setting.cpp:73
bool graph_edges_visible
graph: edges
Definition: setting.cpp:105
bool points_drawable_two_side_lighting
points drawable
Definition: setting.cpp:60
bool graph_vertices_visible
graph: vertices
Definition: setting.cpp:100
bool surface_mesh_faces_phong_shading
surface mesh - surface
Definition: setting.cpp:79
Definition: collider.cpp:182
Vec< 4, float > vec4
A 4D point/vector of float type.
Definition: types.h:47