Easy3D 2.6.1
Loading...
Searching...
No Matches
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
64 extern EASY3D_UTIL_EXPORT vec4 background_color;
67 extern EASY3D_UTIL_EXPORT vec4 highlight_color;
68
71 extern EASY3D_UTIL_EXPORT vec4 light_position;
72
73 // Material properties
76 extern EASY3D_UTIL_EXPORT vec4 material_ambient;
79 extern EASY3D_UTIL_EXPORT vec4 material_specular;
82 extern EASY3D_UTIL_EXPORT float material_shininess;
83
84 // Effects
87 extern EASY3D_UTIL_EXPORT float effect_ssao_radius;
90 extern EASY3D_UTIL_EXPORT float effect_ssao_intensity;
93 extern EASY3D_UTIL_EXPORT float effect_ssao_bias;
96 extern EASY3D_UTIL_EXPORT float effect_ssao_sharpness;
97
100 extern EASY3D_UTIL_EXPORT bool effect_edl_enabled;
103 extern EASY3D_UTIL_EXPORT bool effect_transparency_enabled;
106 extern EASY3D_UTIL_EXPORT bool effect_shadow_enabled;
107
110 extern EASY3D_UTIL_EXPORT float effect_shadow_light_distance;
113 extern EASY3D_UTIL_EXPORT float effect_shadow_softness;
116 extern EASY3D_UTIL_EXPORT float effect_shadow_darkness;
117
118 // Points drawable settings
121 extern EASY3D_UTIL_EXPORT bool points_drawable_two_side_lighting;
124 extern EASY3D_UTIL_EXPORT bool points_drawable_distinct_backside_color;
127 extern EASY3D_UTIL_EXPORT vec4 points_drawable_backside_color;
128
129 // Lines drawable settings
132 extern EASY3D_UTIL_EXPORT bool lines_drawable_two_side_lighting;
135 extern EASY3D_UTIL_EXPORT bool lines_drawable_distinct_backside_color;
138 extern EASY3D_UTIL_EXPORT vec4 lines_drawable_backside_color;
139
140 // Triangles drawable settings
143 extern EASY3D_UTIL_EXPORT bool triangles_drawable_two_side_lighting;
146 extern EASY3D_UTIL_EXPORT bool triangles_drawable_distinct_backside_color;
149 extern EASY3D_UTIL_EXPORT vec4 triangles_drawable_backside_color;
150
151 // Point cloud settings
154 extern EASY3D_UTIL_EXPORT bool point_cloud_vertices_visible;
157 extern EASY3D_UTIL_EXPORT vec4 point_cloud_vertices_color;
160 extern EASY3D_UTIL_EXPORT bool point_cloud_vertices_impostors;
163 extern EASY3D_UTIL_EXPORT float point_cloud_vertices_size;
164
165 // Surface mesh settings
168 extern EASY3D_UTIL_EXPORT bool surface_mesh_faces_phong_shading;
171 extern EASY3D_UTIL_EXPORT bool surface_mesh_faces_visible;
174 extern EASY3D_UTIL_EXPORT vec4 surface_mesh_faces_color;
177 extern EASY3D_UTIL_EXPORT float surface_mesh_faces_opacity;
180 extern EASY3D_UTIL_EXPORT bool surface_mesh_vertices_visible;
183 extern EASY3D_UTIL_EXPORT vec4 surface_mesh_vertices_color;
186 extern EASY3D_UTIL_EXPORT bool surface_mesh_vertices_imposters;
189 extern EASY3D_UTIL_EXPORT float surface_mesh_vertices_size;
192 extern EASY3D_UTIL_EXPORT bool surface_mesh_edges_visible;
195 extern EASY3D_UTIL_EXPORT vec4 surface_mesh_edges_color;
198 extern EASY3D_UTIL_EXPORT bool surface_mesh_edges_imposters;
201 extern EASY3D_UTIL_EXPORT float surface_mesh_edges_size;
204 extern EASY3D_UTIL_EXPORT bool surface_mesh_borders_visible;
207 extern EASY3D_UTIL_EXPORT vec4 surface_mesh_borders_color;
210 extern EASY3D_UTIL_EXPORT bool surface_mesh_borders_imposters;
213 extern EASY3D_UTIL_EXPORT float surface_mesh_borders_size;
214
215 // Graph settings
218 extern EASY3D_UTIL_EXPORT bool graph_vertices_visible;
221 extern EASY3D_UTIL_EXPORT vec4 graph_vertices_color;
224 extern EASY3D_UTIL_EXPORT bool graph_vertices_imposters;
227 extern EASY3D_UTIL_EXPORT float graph_vertices_size;
230 extern EASY3D_UTIL_EXPORT bool graph_edges_visible;
233 extern EASY3D_UTIL_EXPORT vec4 graph_edges_color;
236 extern EASY3D_UTIL_EXPORT bool graph_edges_imposters;
239 extern EASY3D_UTIL_EXPORT float graph_edges_size;
240
241 // Polyhedral mesh settings
244 extern EASY3D_UTIL_EXPORT bool poly_mesh_faces_visible;
247 extern EASY3D_UTIL_EXPORT vec4 poly_mesh_faces_color;
250 extern EASY3D_UTIL_EXPORT bool poly_mesh_vertices_visible;
253 extern EASY3D_UTIL_EXPORT vec4 poly_mesh_vertices_color;
256 extern EASY3D_UTIL_EXPORT bool poly_mesh_vertices_imposters;
259 extern EASY3D_UTIL_EXPORT float poly_mesh_vertices_size;
262 extern EASY3D_UTIL_EXPORT bool poly_mesh_edges_visible;
265 extern EASY3D_UTIL_EXPORT vec4 poly_mesh_edges_color;
268 extern EASY3D_UTIL_EXPORT bool poly_mesh_edges_imposters;
271 extern EASY3D_UTIL_EXPORT float poly_mesh_edges_size;
272
273 // Clipping plane settings
276 extern EASY3D_UTIL_EXPORT vec4 clipping_plane_color;
277
278 } // namespace setting
279
280} // namespace easy3d
281
282
283#endif // EASY3D_UTIL_SETTING_H
Default parameters used for initializing rendering and UI.
EASY3D_UTIL_EXPORT float effect_ssao_radius
Radius of the SSAO (Screen Space Ambient Occlusion) effect.
EASY3D_UTIL_EXPORT float effect_shadow_softness
Softness of the shadow effect.
EASY3D_UTIL_EXPORT bool points_drawable_distinct_backside_color
Whether a distinct backside color is used for points drawable.
EASY3D_UTIL_EXPORT bool effect_transparency_enabled
Whether transparency effect is enabled.
EASY3D_UTIL_EXPORT bool surface_mesh_edges_imposters
Whether surface mesh edges are rendered as impostors.
EASY3D_UTIL_EXPORT bool surface_mesh_faces_visible
Whether surface mesh faces are visible.
EASY3D_UTIL_EXPORT float effect_shadow_darkness
Darkness of the shadow effect.
EASY3D_UTIL_EXPORT vec4 highlight_color
Default highlight color for highlighted/selected primitives.
void initialize(const std::string &setting_file="default")
Initializes the default setting for rendering.
EASY3D_UTIL_EXPORT float point_cloud_vertices_size
Size of point cloud vertices.
EASY3D_UTIL_EXPORT float effect_ssao_intensity
Intensity of the SSAO (Screen Space Ambient Occlusion) effect.
EASY3D_UTIL_EXPORT bool triangles_drawable_distinct_backside_color
Whether a distinct backside color is used for triangles drawable.
EASY3D_UTIL_EXPORT bool surface_mesh_vertices_visible
Whether surface mesh vertices are visible.
EASY3D_UTIL_EXPORT float effect_shadow_light_distance
Distance of the light source to the scene (w.r.t. the scene radius).
EASY3D_UTIL_EXPORT bool poly_mesh_edges_visible
Whether polyhedral mesh edges are visible.
EASY3D_UTIL_EXPORT float graph_vertices_size
Size of graph vertices.
EASY3D_UTIL_EXPORT float material_shininess
Default shininess of the material.
EASY3D_UTIL_EXPORT vec4 triangles_drawable_backside_color
Backside color for triangles drawable.
EASY3D_UTIL_EXPORT bool surface_mesh_borders_imposters
Whether surface mesh borders are rendered as impostors.
EASY3D_UTIL_EXPORT vec4 material_specular
Default specular color of the material.
bool save(const std::string &filename)
Save the setting (i.e., rendering parameters) to a file.
EASY3D_UTIL_EXPORT vec4 poly_mesh_faces_color
Color of polyhedral mesh faces.
EASY3D_UTIL_EXPORT vec4 surface_mesh_borders_color
Color of surface mesh borders.
EASY3D_UTIL_EXPORT bool surface_mesh_edges_visible
Whether surface mesh edges are visible.
EASY3D_UTIL_EXPORT vec4 clipping_plane_color
Default color of the clipping plane.
EASY3D_UTIL_EXPORT bool poly_mesh_vertices_visible
Whether polyhedral mesh vertices are visible.
EASY3D_UTIL_EXPORT vec4 surface_mesh_faces_color
Color of surface mesh faces.
EASY3D_UTIL_EXPORT bool surface_mesh_borders_visible
Whether surface mesh borders are visible.
EASY3D_UTIL_EXPORT bool effect_edl_enabled
Whether EDL (Eye-Dome Lighting) effect is enabled.
EASY3D_UTIL_EXPORT vec4 lines_drawable_backside_color
Backside color for lines drawable.
EASY3D_UTIL_EXPORT bool point_cloud_vertices_impostors
Whether point cloud vertices are rendered as impostors.
EASY3D_UTIL_EXPORT bool graph_edges_imposters
Whether graph edges are rendered as impostors.
EASY3D_UTIL_EXPORT float surface_mesh_vertices_size
Size of surface mesh vertices.
EASY3D_UTIL_EXPORT vec4 poly_mesh_vertices_color
Color of polyhedral mesh vertices.
EASY3D_UTIL_EXPORT float effect_ssao_bias
Bias of the SSAO (Screen Space Ambient Occlusion) effect.
EASY3D_UTIL_EXPORT float poly_mesh_edges_size
Size of polyhedral mesh edges.
EASY3D_UTIL_EXPORT vec4 light_position
Default light position defined in the camera coordinate system.
EASY3D_UTIL_EXPORT vec4 poly_mesh_edges_color
Color of polyhedral mesh edges.
EASY3D_UTIL_EXPORT bool poly_mesh_faces_visible
Whether polyhedral mesh faces are visible.
EASY3D_UTIL_EXPORT vec4 background_color
Background color of the viewer.
EASY3D_UTIL_EXPORT bool poly_mesh_edges_imposters
Whether polyhedral mesh edges are rendered as impostors.
bool load(const std::string &filename)
Load the setting (i.e., rendering parameters) from a file.
EASY3D_UTIL_EXPORT vec4 material_ambient
Default ambient color of the material.
EASY3D_UTIL_EXPORT vec4 points_drawable_backside_color
Backside color for points drawable.
EASY3D_UTIL_EXPORT vec4 graph_vertices_color
Color of graph vertices.
EASY3D_UTIL_EXPORT vec4 surface_mesh_edges_color
Color of surface mesh edges.
EASY3D_UTIL_EXPORT float surface_mesh_edges_size
Size of surface mesh edges.
EASY3D_UTIL_EXPORT float graph_edges_size
Size of graph edges.
EASY3D_UTIL_EXPORT bool poly_mesh_vertices_imposters
Whether polyhedral mesh vertices are rendered as impostors.
EASY3D_UTIL_EXPORT vec4 graph_edges_color
Color of graph edges.
EASY3D_UTIL_EXPORT float surface_mesh_borders_size
Size of surface mesh borders.
EASY3D_UTIL_EXPORT bool point_cloud_vertices_visible
Whether point cloud vertices are visible.
EASY3D_UTIL_EXPORT bool lines_drawable_two_side_lighting
Whether two-side lighting is enabled for lines drawable.
EASY3D_UTIL_EXPORT bool graph_edges_visible
Whether graph edges are visible.
EASY3D_UTIL_EXPORT vec4 surface_mesh_vertices_color
Color of surface mesh vertices.
EASY3D_UTIL_EXPORT bool points_drawable_two_side_lighting
Whether two-side lighting is enabled for points drawable.
EASY3D_UTIL_EXPORT float surface_mesh_faces_opacity
Opacity of surface mesh faces.
EASY3D_UTIL_EXPORT float poly_mesh_vertices_size
Size of polyhedral mesh vertices.
EASY3D_UTIL_EXPORT vec4 point_cloud_vertices_color
Color of point cloud vertices.
EASY3D_UTIL_EXPORT bool lines_drawable_distinct_backside_color
Whether a distinct backside color is used for lines drawable.
EASY3D_UTIL_EXPORT float effect_ssao_sharpness
Sharpness of the SSAO (Screen Space Ambient Occlusion) effect.
EASY3D_UTIL_EXPORT bool surface_mesh_vertices_imposters
Whether surface mesh vertices are rendered as impostors.
EASY3D_UTIL_EXPORT bool effect_shadow_enabled
Whether shadow effect is enabled.
EASY3D_UTIL_EXPORT bool graph_vertices_visible
Whether graph vertices are visible.
EASY3D_UTIL_EXPORT bool surface_mesh_faces_phong_shading
Whether Phong shading is enabled for surface mesh faces.
EASY3D_UTIL_EXPORT bool triangles_drawable_two_side_lighting
Whether two-side lighting is enabled for triangles drawable.
EASY3D_UTIL_EXPORT bool graph_vertices_imposters
Whether graph vertices are rendered as impostors.
Definition collider.cpp:182
Vec< 4, float > vec4
A 4D point/vector of float type.
Definition types.h:46