NDEVR
API Documentation
DesignSettings

Stores generic settings that impact the behavior of the NDEVR API. More...

Inheritance diagram for DesignSettings:
[legend]
Collaboration diagram for DesignSettings:
[legend]

Public Member Functions

 DesignSettings ()
 Constructs a DesignSettings instance with default values.
void getINI (INIFactory &factory) override
 Serializes or deserializes settings using the given INI factory.
bool getModel (const StringView &resource, Model &root) const
 Retrieves a Model associated with the given resource name.
void setGraphicsSettingsToDefaults ()
 Resets all graphics-related settings to their default values.
bool setModel (const StringView &resource, const Model &model) const
 Stores a Model under the given resource name.
void setModelGetter (const std::function< bool(const StringView &, Model &root)> &resource_getter)
 Sets the callback used to retrieve a Model by 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.
void setStationSettingsToDefaults ()
 Resets all station-related settings to their default values.
void setUserSettingsToDefaults ()
 Resets all user-specific settings to their default values.
Public Member Functions inherited from INIInterface
 INIInterface ()
 Constructs an INIInterface with no default INI file.
 INIInterface (const File &default_ini)
 Constructs an INIInterface with the specified default INI file.
virtual ~INIInterface ()
 Virtual destructor for safe polymorphic cleanup.
virtual void finishReadingINI (INIFactory &)
 Called after reading an INI file.
virtual void prepareForINI (INIFactory &)
 Called before reading or writing an INI file.
virtual bool readINIOptions ()
 Reads INI options from the default INI file.
virtual bool readINIOptions (File &ini_file)
 Reads INI options from the specified INI file.
virtual bool saveINIOptions (bool multithead=false)
 Saves INI options to the default INI file.
virtual bool saveINIOptions (File &ini_file, bool multithead=false)
 Saves INI options to the specified INI file.
void setDefaultINIFile (const File &file)
 Sets the default INI file path used for reading and writing options.
virtual void writeToLog (const StringView &title, LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log with a title.
virtual void writeToLog (LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log.

Static Public Member Functions

static DesignSettingsdefaultSettings ()
 Returns the singleton default DesignSettings instance.

Public Attributes

Resource< Stringactivation_email
 The email address to contact for obtaining an activation code.
Resource< TranslatedStringcalibration_back_point_label
 The label displayed for the back calibration point.
Resource< TranslatedStringcalibration_front_point_label
 The label displayed for the front calibration point.
Resource< Stringcompany_name
 The name of the software company.
Resource< bool > debug_mode
 Whether the application is running in debug mode.
Buffer< SnapLocationdefault_camera_locations
 The set of predefined camera snap locations.
Resource< bool > maintenance_mode
 Whether the application is running in maintenance mode.
Resource< Stringndevr_website
 The URL of the NDEVR website.
Resource< TranslatedStringpattern_hole_name_format
 The format string used for naming pattern holes.
Resource< TranslatedStringrow_auto_name_format
 The format string used for automatically naming rows.
Resource< TranslatedStringuser_title
 The display title for the current user.

Protected Attributes

std::function< bool(const StringView &, Model &root)> m_model_getter
 Callback for retrieving a Model by resource name.
std::function< bool(const StringView &, const Model &model)> m_model_setter
 Callback for storing a Model by resource name.
Protected Attributes inherited from INIInterface
File m_default_ini
 The default file path used for reading and writing INI options.

Detailed Description

Stores generic settings that impact the behavior of the NDEVR API.


See also
ApplicationOptions, DesignObjectLookup

Definition at line 51 of file DesignSettings.h.

Constructor & Destructor Documentation

◆ DesignSettings()

DesignSettings::DesignSettings ( )

Constructs a DesignSettings instance with default values.


Referenced by defaultSettings().

Member Function Documentation

◆ defaultSettings()

DesignSettings & DesignSettings::defaultSettings ( )
static

Returns the singleton default DesignSettings instance.


Returns
A reference to the shared default DesignSettings.

References DesignSettings().

◆ getINI()

void DesignSettings::getINI ( INIFactory & factory)
overridevirtual

Serializes or deserializes settings using the given INI factory.


Parameters
[in]factoryThe INIFactory used for reading or writing settings.

Implements INIInterface.

◆ getModel()

bool DesignSettings::getModel ( const StringView & resource,
Model & root ) const

Retrieves a Model associated with the given resource name.


Parameters
[in]resourceThe resource identifier to look up.
[in]rootThe Model to populate with the retrieved data.
Returns
True if the model was successfully retrieved, false otherwise.

◆ setGraphicsSettingsToDefaults()

void DesignSettings::setGraphicsSettingsToDefaults ( )

Resets all graphics-related settings to their default values.


◆ setModel()

bool DesignSettings::setModel ( const StringView & resource,
const Model & model ) const

Stores a Model under the given resource name.


Parameters
[in]resourceThe resource identifier to associate with the model.
[in]modelThe Model to store.
Returns
True if the model was successfully stored, false otherwise.

◆ setModelGetter()

void DesignSettings::setModelGetter ( const std::function< bool(const StringView &, Model &root)> & resource_getter)

Sets the callback used to retrieve a Model by resource name.


Parameters
[in]resource_getterA function that populates a Model given a resource name and returns true on success.

◆ setModelSetter()

void DesignSettings::setModelSetter ( const std::function< bool(const StringView &, const Model &model)> & resource_setter)

Sets the callback used to store a Model by resource name.


Parameters
[in]resource_setterA function that persists a Model given a resource name and returns true on success.

◆ setStationSettingsToDefaults()

void DesignSettings::setStationSettingsToDefaults ( )

Resets all station-related settings to their default values.


◆ setUserSettingsToDefaults()

void DesignSettings::setUserSettingsToDefaults ( )

Resets all user-specific settings to their default values.



The documentation for this class was generated from the following file: