NDEVR
API Documentation
DesignSettings.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Design
28File: DesignSettings
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/SnapLocation.h>
35#include <NDEVR/INIInterface.h>
36#include <NDEVR/Resource.h>
37#include <NDEVR/RGBColor.h>
38#include <NDEVR/TranslatedString.h>
39#include <NDEVR/Model.h>
40#include <functional>
41
42namespace NDEVR
43{
44 class Model;
45 class INIFactory;
52 {
53 public:
57 NDEVR_DESIGN_API DesignSettings();
62 NDEVR_DESIGN_API static DesignSettings& defaultSettings();
63
65
69
72
75
77
80
81 public:
86 NDEVR_DESIGN_API void getINI(INIFactory& factory) override;
92 NDEVR_DESIGN_API void setModelGetter(const std::function<bool(const StringView&, Model& root)>& resource_getter);
98 NDEVR_DESIGN_API void setModelSetter(const std::function<bool(const StringView&, const Model& model)>& resource_setter);
105 NDEVR_DESIGN_API bool getModel(const StringView& resource, Model& root) const;
112 NDEVR_DESIGN_API bool setModel(const StringView& resource, const Model& model) const;
116 NDEVR_DESIGN_API void setUserSettingsToDefaults();
120 NDEVR_DESIGN_API void setGraphicsSettingsToDefaults();
124 NDEVR_DESIGN_API void setStationSettingsToDefaults();
125 protected:
126 std::function<bool(const StringView&, Model& root)> m_model_getter;
127 std::function<bool(const StringView&, const Model& model)> m_model_setter;
128 };
129}
130
131
132
133
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
bool setModel(const StringView &resource, const Model &model) const
Stores a Model under the given resource name.
void setModelSetter(const std::function< bool(const StringView &, const Model &model)> &resource_setter)
Sets the callback used to store a Model by resource name.
Resource< bool > debug_mode
Whether the application is running in debug mode.
void setUserSettingsToDefaults()
Resets all user-specific settings to their default values.
Resource< TranslatedString > user_title
The display title for the current user.
DesignSettings()
Constructs a DesignSettings instance with default values.
void setGraphicsSettingsToDefaults()
Resets all graphics-related settings to their default values.
Resource< TranslatedString > calibration_back_point_label
The label displayed for the back calibration point.
static DesignSettings & defaultSettings()
Returns the singleton default DesignSettings instance.
Resource< String > ndevr_website
The URL of the NDEVR website.
void setModelGetter(const std::function< bool(const StringView &, Model &root)> &resource_getter)
Sets the callback used to retrieve a Model by resource name.
Resource< String > company_name
The name of the software company.
Resource< TranslatedString > row_auto_name_format
The format string used for automatically naming rows.
void getINI(INIFactory &factory) override
Serializes or deserializes settings using the given INI factory.
Resource< TranslatedString > calibration_front_point_label
The label displayed for the front calibration point.
std::function< bool(const StringView &, const Model &model)> m_model_setter
Callback for storing a Model by resource name.
bool getModel(const StringView &resource, Model &root) const
Retrieves a Model associated with the given resource name.
Resource< String > activation_email
The email address to contact for obtaining an activation code.
Buffer< SnapLocation > default_camera_locations
The set of predefined camera snap locations.
Resource< bool > maintenance_mode
Whether the application is running in maintenance mode.
Resource< TranslatedString > pattern_hole_name_format
The format string used for naming pattern holes.
void setStationSettingsToDefaults()
Resets all station-related settings to their default values.
std::function< bool(const StringView &, Model &root)> m_model_getter
Callback for retrieving a Model by resource name.
Contains methods for easily reading and writing to an INI file including efficient casting,...
Definition INIReader.h:107
INIInterface()
Constructs an INIInterface with no default INI file.
A core class that represents a node on model hierarchy.
Definition Model.h:292
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
Definition Resource.h:42
The core String View class for the NDEVR API.
Definition StringView.h:58
The primary namespace for the NDEVR SDK.