FlowEngine 7.517
Photogrammetry Software Development Kit
Loading...
Searching...
No Matches
FlowEngine::SettingsManager Class Referencefinal

Utility class to work with settings. More...

#include <SettingsManager.h>

Static Public Member Functions

static FLE_DLL Index getValidCategoriesCount (ConstStringBuffer phase)
 
static FLE_DLL Size getValidCategorySize (ConstStringBuffer phase, Index categoryIndex)
 
static FLE_DLL Result getValidCategory (ConstStringBuffer phase, Index categoryIndex, StringBuffer outCategory)
 
static FLE_DLL Index getValidPresetsCount (ConstStringBuffer phase, ConstStringBuffer category)
 
static FLE_DLL Size getValidPresetSize (ConstStringBuffer phase, ConstStringBuffer category, Index presetIndex)
 
static FLE_DLL Result getValidPreset (ConstStringBuffer phase, ConstStringBuffer category, Index presetIndex, StringBuffer outPreset)
 
static FLE_DLL Index getValidKeyCount ()
 Get the number of Settings valid keys.
 
static FLE_DLL Size getValidKeySize (Index idx)
 
static FLE_DLL Result getValidKey (Index idx, StringBuffer outKey)
 
static FLE_DLL bool isValidKey (ConstStringBuffer key)
 
static FLE_DLL Result getKeyMinMax (ConstStringBuffer key, double &outMin, double &outMax)
 
static FLE_DLL Result getKeyDefaultValue (ConstStringBuffer key, StringBuffer outDefaultValue)
 
static FLE_DLL Size getKeyDefaultValueLength (ConstStringBuffer key)
 
static FLE_DLL Result getKeyMinMaxValue (ConstStringBuffer key, StringBuffer outMinValue, StringBuffer outMaxValue)
 
static FLE_DLL void getKeyMinMaxValueLength (ConstStringBuffer key, Size &outMinLength, Size &outMaxLength)
 
static FLE_DLL Size joinCategoryNameSize (ConstStringBuffer category, ConstStringBuffer name)
 
static FLE_DLL Result joinCategoryName (ConstStringBuffer category, ConstStringBuffer name, StringBuffer outKey)
 
static FLE_DLL Size splitKeyCategorySize (ConstStringBuffer key)
 
static FLE_DLL Size splitKeyNameSize (ConstStringBuffer key)
 
static FLE_DLL Result splitKey (ConstStringBuffer key, StringBuffer outCategory, StringBuffer outName)
 

Detailed Description

Utility class to work with settings.

This class offers utilities to query for valid settings cateogries and values and manipulate strings in the context of settings (i.e. join and split key/category).

Member Function Documentation

◆ getKeyDefaultValue()

FLE_DLL Result FlowEngine::SettingsManager::getKeyDefaultValue ( ConstStringBuffer  key,
StringBuffer  outDefaultValue 
)
static

Get a key default value in string form.

Parameters
[in]keythe settings key (category and name combined) to query.
See also
joinCategoryName().
Parameters
[out]outDefaultValuethe settings default value in string form.
Returns
one of the following result codes:
  • Result::Success – if outDefaultValue was filled with the key default value.
  • Result::InvalidArgument
    • if key is not a valid string buffer or is not a valid key.
    • if outDefaultValue is not a valid string buffer.
  • Result::BufferTooSmall – if outDefaultValue is not big enough to store the default value.
See also
getKeyDefaultValueLength().
Precondition
isValidKey( key ) must be true.

◆ getKeyDefaultValueLength()

FLE_DLL Size FlowEngine::SettingsManager::getKeyDefaultValueLength ( ConstStringBuffer  key)
static
Returns
the length of the key default value in string form or 0 if the key is not valid (i.e. isValidKey(key) returns false).
Parameters
[in]keythe settings key (category and name combined) to query.
See also
joinCategoryName().

◆ getKeyMinMax()

FLE_DLL Result FlowEngine::SettingsManager::getKeyMinMax ( ConstStringBuffer  key,
double &  outMin,
double &  outMax 
)
static

Get a key valid range (i.e. the minimum and maximum possible value, inclusive)

Note
This function might fail on some keys which are not convertible to double. Prefer getKeyMinMaxValue().
Parameters
[in]keythe settings key (category and name combined) to query.
See also
joinCategoryName().
Parameters
[out]outMinthe settings key minimum allowed value.
[out]outMaxthe settings key maximum allowed value.
Returns
one of the following result codes:
Precondition
isValidKey( key ) must be true.

◆ getKeyMinMaxValue()

FLE_DLL Result FlowEngine::SettingsManager::getKeyMinMaxValue ( ConstStringBuffer  key,
StringBuffer  outMinValue,
StringBuffer  outMaxValue 
)
static

Query a key minimum and maximum possible values in string form.

Note
Not all keys support this function.
This function superseeds getKeyMinMax().
Parameters
[in]keythe settings key (category and name combined) to query.
See also
joinCategoryName().
Parameters
[out]outMinValuethe settings key minimum allowed value in string form.
[out]outMaxValuethe settings key maximum allowed value in string form.
Returns
one of the following result codes:
  • Result::Success – if outDefaultValue was filled with the key default value.
  • Result::InvalidArgument
    • if key is not a valid string buffer or is not a valid key.
    • if outMinValue is not a valid string buffer.
    • if outMaxValue is not a valid string buffer.
  • Result::BufferTooSmall
    • if outMinValue is not big enough to store the default value.
    • if outMaxValue is not big enough to store the default value.
See also
getKeyMinMaxValueLength().
Precondition
isValidKey( key ) must be true.

◆ getKeyMinMaxValueLength()

FLE_DLL void FlowEngine::SettingsManager::getKeyMinMaxValueLength ( ConstStringBuffer  key,
Size outMinLength,
Size outMaxLength 
)
static

Returns the length of the key minimum and maximum possible values in string form or 0 if the key is not valid (i.e. isValidKey(key) returns false).

Parameters
[in]keythe settings key (category and name combined) to query.
See also
joinCategoryName().
Parameters
[out]outMinLengththe length of the settings key minimum allowed value in string form.
[out]outMaxLengththe length of the settings key maximum allowed value in string form.

◆ getValidCategoriesCount()

FLE_DLL Index FlowEngine::SettingsManager::getValidCategoriesCount ( ConstStringBuffer  phase)
static
Returns
The number of categories for the specified phase.
Parameters
[in]phasea constant string buffer containing a phase name. Must be one of the following:
  • "Samantha" – sparse point cloud generation with structure and motion.
  • "Stereo" – dense point cloud generation with multiview stereo.
  • "Surface" – mesh generation.
  • "Texture" – texture generation.

◆ getValidCategory()

FLE_DLL Result FlowEngine::SettingsManager::getValidCategory ( ConstStringBuffer  phase,
Index  categoryIndex,
StringBuffer  outCategory 
)
static

Get the name of a category for a specific phase at the specified index.

Parameters
[in]phasea constant string buffer containing a phase name. Must be one of the following:
  • "Samantha" – sparse point cloud generation with structure and motion.
  • "Stereo" – dense point cloud generation with multiview stereo.
  • "Surface" – mesh generation.
  • "Texture" – texture generation.
[in]categoryIndexThe index of the category to query for the name. Must be between 0 and getValidCategoriesCount().
[out]outCategorya string buffer that receives the category name. The buffer must be big at least getValidCategorySize().
Returns
one of the following result codes:

◆ getValidCategorySize()

FLE_DLL Size FlowEngine::SettingsManager::getValidCategorySize ( ConstStringBuffer  phase,
Index  categoryIndex 
)
static
Returns
The size of the category at the specified index
Parameters
[in]phasea constant string buffer containing a phase name. Must be one of the following:
  • "Samantha" – sparse point cloud generation with structure and motion.
  • "Stereo" – dense point cloud generation with multiview stereo.
  • "Surface" – mesh generation.
  • "Texture" – texture generation.
[in]categoryIndexThe index of the category to query for the name. Must be between 0 and getValidCategoriesCount().

◆ getValidKey()

FLE_DLL Result FlowEngine::SettingsManager::getValidKey ( Index  idx,
StringBuffer  outKey 
)
static

Get the Settings valid key for Settings at the specified index.

Parameters
[in]idxthe index of the key to query for size. Must be between [0, getValidKeysCount()]
[in,out]outKeymutable string buffer that receives the joined key. Must be at least getValidKeySize() long.
Returns
one of the following result codes:

◆ getValidKeyCount()

FLE_DLL Index FlowEngine::SettingsManager::getValidKeyCount ( )
static

Get the number of Settings valid keys.

◆ getValidKeySize()

FLE_DLL Size FlowEngine::SettingsManager::getValidKeySize ( Index  idx)
static
Returns
The Settings valid key size at the specified index.
Parameters
[in]idxthe index of the key to query for size. Must be between [0, getValidKeysCount()]

◆ getValidPreset()

FLE_DLL Result FlowEngine::SettingsManager::getValidPreset ( ConstStringBuffer  phase,
ConstStringBuffer  category,
Index  presetIndex,
StringBuffer  outPreset 
)
static

Get the preset name for the specified phase and category.

Parameters
[in]phasethe phase
[in]categorythe category
[in]presetIndexthe index of the preset to query. Must be between [0, getValidPresetsCount())
[out]outPresetstring buffer that receives the preset name. The buffer must be big at least getValidPresetSize().
Returns
one of the following result codes:

◆ getValidPresetsCount()

FLE_DLL Index FlowEngine::SettingsManager::getValidPresetsCount ( ConstStringBuffer  phase,
ConstStringBuffer  category 
)
static
Returns
The number of presets for the specified phase and category.
Parameters
[in]phasethe phase
[in]categorythe category

◆ getValidPresetSize()

FLE_DLL Size FlowEngine::SettingsManager::getValidPresetSize ( ConstStringBuffer  phase,
ConstStringBuffer  category,
Index  presetIndex 
)
static
Returns
The size of the preset name for the specified phase and category.
Parameters
[in]phasethe phase
[in]categorythe category
[in]presetIndexthe index of the preset to query. Must be between [0, getValidPresetsCount())

◆ isValidKey()

FLE_DLL bool FlowEngine::SettingsManager::isValidKey ( ConstStringBuffer  key)
static
Returns
true if key is a well-formed key and is a valid Settings key, false otherwise
Parameters
[in]keythe settings key (category and name combined) to query.
See also
joinCategoryName().

◆ joinCategoryName()

FLE_DLL Result FlowEngine::SettingsManager::joinCategoryName ( ConstStringBuffer  category,
ConstStringBuffer  name,
StringBuffer  outKey 
)
static

Joins a Settings category and name to form a key entry.

Parameters
[in]categorystring buffer containing the category.
[in]namestring buffer containing the name.
[in,out]outKeymutable string buffer that receives the joined key. Must be at least joinCategoryNameSize() long.
Returns
one of the following result codes:

◆ joinCategoryNameSize()

FLE_DLL Size FlowEngine::SettingsManager::joinCategoryNameSize ( ConstStringBuffer  category,
ConstStringBuffer  name 
)
static
Returns
the size required to hold the the joined category/name.
Parameters
[in]categorystring buffer containing the category.
[in]namestring buffer containing the name.

◆ splitKey()

FLE_DLL Result FlowEngine::SettingsManager::splitKey ( ConstStringBuffer  key,
StringBuffer  outCategory,
StringBuffer  outName 
)
static

Splits a key into category and name.

Parameters
[in]keystring buffer containing the key.
[out]outCategorymutable string buffer that will receive the category portion of the key.
[out]outNamemutable string buffer that will receive the name portion of the key.
Returns
one of the following result codes:
  • Result::Success – if outCategory and outName are filled with the relative parts of the key.
  • Result::InvalidArgument
    • if key, outCategory or outName is not a valid string buffer.
    • if key is not a valid slash separated combination of category and name.
  • Result::BufferTooSmall – if outCategory or outName is not big enough to receive all the data.

◆ splitKeyCategorySize()

FLE_DLL Size FlowEngine::SettingsManager::splitKeyCategorySize ( ConstStringBuffer  key)
static
Returns
the size needed to hold the category of a joined key after splitting.
Parameters
[in]keystring buffer containing the key.

◆ splitKeyNameSize()

FLE_DLL Size FlowEngine::SettingsManager::splitKeyNameSize ( ConstStringBuffer  key)
static
Returns
the size needed to hold the name of a joined key after splitting.
Parameters
[in]keystring buffer containing the key.