MeshLib Documentation
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
12{
13public:
14 // Reset all scene settings to default values
15 MRMESH_API static void reset();
16
24
25 enum class FloatType
26 {
33 // Line width of line features (line, circle, ...).
35 // Line width of line subfeatures (axes, base circles, ...).
37 // Size of the point feature.
39 // Size of point subfeatures (various centers).
41 // Ambient multiplication coefficient for ambientStrength for selected objects
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 {
56 Smooth,
57 Flat
58 };
59
65
67 MRMESH_API static void setCNCMachineSettings( const CNCMachineSettings& settings );
68
69private:
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 MRMesh/MRMeshFwd.h:46
class with CNC machine emulation settings
Definition MRCNCMachineSettings.h:14
Definition MRSceneSettings.h:12
BoolType
Definition MRSceneSettings.h:18
@ UseDefaultScenePropertiesOnDeserialization
on deserialization replace object properties with default values from SceneSettings and SceneColors
static MRMESH_API bool get(BoolType type)
ShadingMode
Mesh faces shading mode.
Definition MRSceneSettings.h:54
static MRMESH_API void set(BoolType type, bool value)
static MRMESH_API void set(FloatType type, float value)
static MRMESH_API float get(FloatType type)
static MRMESH_API void setCNCMachineSettings(const CNCMachineSettings &settings)
static MRMESH_API void reset()
static MRMESH_API void setDefaultShadingMode(ShadingMode mode)
static MRMESH_API const CNCMachineSettings & getCNCMachineSettings()
FloatType
Definition MRSceneSettings.h:26
static MRMESH_API ShadingMode getDefaultShadingMode()
Definition MRCameraOrientationPlugin.h:8