MeshLib C++ Docs
Loading...
Searching...
No Matches
MRSceneSettings.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
4#include <array>
5
6namespace MR
7{
8
11class SceneSettings
12{
13public:
14 // Reset all scene settings to default values
15 MRMESH_API static void reset();
16
17 enum class BoolType
18 {
20 UseDefaultScenePropertiesOnDeserialization,
22 Count
23 };
24
25 enum class FloatType
26 {
27 FeaturePointsAlpha,
28 FeatureLinesAlpha,
29 FeatureMeshAlpha,
30 FeatureSubPointsAlpha,
31 FeatureSubLinesAlpha,
32 FeatureSubMeshAlpha,
33 // Line width of line features (line, circle, ...).
34 FeatureLineWidth,
35 // Line width of line subfeatures (axes, base circles, ...).
36 FeatureSubLineWidth,
37 // Size of the point feature.
38 FeaturePointSize,
39 // Size of point subfeatures (various centers).
40 FeatureSubPointSize,
41 // Ambient multiplication coefficient for ambientStrength for selected objects
42 AmbientCoefSelectedObj,
43
44 Count,
45 };
46
47 MRMESH_API static bool get( BoolType type );
48 MRMESH_API static float get( FloatType type );
49 MRMESH_API static void set( BoolType type, bool value );
50 MRMESH_API static void set( FloatType type, float value );
51
53 enum class ShadingMode
54 {
55 AutoDetect,
56 Smooth,
57 Flat
58 };
59
63 MRMESH_API static ShadingMode getDefaultShadingMode();
64 MRMESH_API static void setDefaultShadingMode( ShadingMode mode );
65
66 MRMESH_API static const CNCMachineSettings& getCNCMachineSettings();
67 MRMESH_API static void setCNCMachineSettings( const CNCMachineSettings& settings );
68
69private:
70 MRMESH_API SceneSettings();
71 ~SceneSettings() = default;
72 SceneSettings& operator=( const SceneSettings& other ) = default;
73
74 static SceneSettings& instance_();
75
76 std::array<bool, size_t( BoolType::Count ) > boolSettings_;
77 std::array<float, size_t( FloatType::Count ) > floatSettings_;
78
79 ShadingMode defaultShadingMode_ = ShadingMode::AutoDetect;
80 CNCMachineSettings cncMachineSettings_;
81};
82
83}
#define MRMESH_API
Definition MRMeshFwd.h:80
Smooth
Definition MRObjectLinesHolder.h:11
Definition MRCameraOrientationPlugin.h:8