The Base_Settings class defines a container of global CAD Exchanger parameters. More...
#include <cadex/Base_Settings.hxx>
Public Types | |
enum | Id { ConcurrentMode , Common_ConcurrentMode = ConcurrentMode , UseExceptions , SubprocessMode , EvaluationAnalytics , UserDefined = 10000 } |
Describes values used to identify CAD Exchanger settings. More... | |
Public Member Functions | |
void | SetValue (const Id theId, int theVal) |
Sets integer parameter value. | |
void | SetValue (const Id theId, double theVal) |
Sets double parameter value. | |
void | SetValue (const Id theId, bool theVal) |
Sets boolean parameter value. | |
void | SetValue (const Id theId, const UTF16 *theVal) |
Sets string parameter value. | |
int | IntValue (const Id theId, int theDefaultVal) const |
Returns integer parameter value. | |
double | DoubleValue (const Id theId, double theDefaultVal) const |
Returns double parameter value. | |
bool | BoolValue (const Id theId, bool theDefaultVal) const |
Returns boolean parameter value. | |
const UTF16 * | StringValue (const Id theId, const UTF16 *theDefaultVal) const |
Returns string parameter value. | |
const std::shared_ptr< internal::Base_SettingsImpl > & | SharedImpl () |
Static Public Member Functions | |
static const std::shared_ptr< Base_Settings > & | Default () |
Returns global settings object. | |
Protected Member Functions | |
Base_Settings () | |
Constructor. | |
The Base_Settings class defines a container of global CAD Exchanger parameters.
The settings class is a singleton, there is only one object which is returned by Default().
Parameters can be set with SetValue () and retrieved with respective Value() methods.
Setting support several types of parameters:
Each parameter is given an id specified by the Base_Settings::Id enumeration. To extend with your own id's make sure you use UserDefined value and greater.
Describes values used to identify CAD Exchanger settings.
Enumerator | |
---|---|
Common_ConcurrentMode | (bool) If True then algorithms which can be run in parallel (e.g. some conversion or meshing) will be executed in parallel on multi-core computers. By default is true. |
UseExceptions | (bool) If True then functions of the SDK can throw exceptions. By default is false.
|
SubprocessMode | (bool) If True then SDK ModelData_ModelReader imports models in a separate process. By default is true.
|
EvaluationAnalytics | (bool) If True then the SDK will collect usage statistics during evaluation period. By default is true. |
|
protected |
Constructor.
Initializes with parameters with default values.
bool cadex::Base_Settings::BoolValue | ( | const Id | theId, |
bool | theDefaultValue | ||
) | const |
Returns boolean parameter value.
Returns a value for the parameter with theId which has already been registered with SetValue (). If such id has not been registered yet, returns theDefaultValue.
|
static |
Returns global settings object.
In multi-threaded applications, when you call this method for the first time ensure that there are no race conditions.
double cadex::Base_Settings::DoubleValue | ( | const Id | theId, |
double | theDefaultValue | ||
) | const |
Returns double parameter value.
Returns a value for the parameter with theId which has already been registered with SetValue (). If such id has not been registered yet, returns theDefaultValue.
int cadex::Base_Settings::IntValue | ( | const Id | theId, |
int | theDefaultValue | ||
) | const |
Returns integer parameter value.
Returns a value for the parameter with theId which has already been registered with SetValue (). If such id has not been registered yet, returns theDefaultValue.
void cadex::Base_Settings::SetValue | ( | const Id | theId, |
bool | theValue | ||
) |
Sets boolean parameter value.
If the bool parameter with the same id has already been registered, it will be overwritten.
Sets string parameter value.
If the parameter with the same id has already been registered, it will be overwritten.
void cadex::Base_Settings::SetValue | ( | const Id | theId, |
double | theValue | ||
) |
Sets double parameter value.
If the double parameter with the same id has already been registered, it will be overwritten.
void cadex::Base_Settings::SetValue | ( | const Id | theId, |
int | theValue | ||
) |
Sets integer parameter value.
If the integer parameter with the same id has already been registered, it will be overwritten.