Hide menu
Loading...
Searching...
No Matches

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 UTF16StringValue (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.
 

Detailed Description

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:

  • integer;
  • boolean;
  • double.

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.

Warning
Do not rely on preservation of id's from between CAD Exchanger versions (except UserDefined value). As new ids appear they may be inserted between existing ones.
const auto& aSettings = Base_Settings::Default();
const int aUserMaxPrecisionId = Base_Settings::UserDefined + 2;
aSettings->SetValue (aUserMaxPrecisionId, 0.1);
bool anIsConcurrent = aSettings->BoolValue (Base_Settings::Common_ConcurrentMode, true);
static const std::shared_ptr< Base_Settings > & Default()
Returns global settings object.
Definition: Base_Settings.cxx:541
@ Common_ConcurrentMode
Definition: Base_Settings.hxx:39
Examples
Eyeshot/conversion/MainForm.cs, MTKConverter/Program.cs, conversion/cdxwebconverter/Program.cs, conversion/export/Program.cs, conversion/transfer/Program.cs, and conversion/transferparams/Program.cs.

Member Enumeration Documentation

◆ Id

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.

See also
Error handling
SubprocessMode 

(bool) If True then SDK ModelData_ModelReader imports models in a separate process. By default is true.

See also
Subprocess Mode
EvaluationAnalytics 

(bool) If True then the SDK will collect usage statistics during evaluation period. By default is true.

Examples
Eyeshot/conversion/MainForm.cs, MTKConverter/Program.cs, conversion/cdxwebconverter/Program.cs, conversion/export/Program.cs, conversion/transfer/Program.cs, and conversion/transferparams/Program.cs.

Constructor & Destructor Documentation

◆ Base_Settings()

cadex::Base_Settings::Base_Settings ( )
protected

Constructor.

Initializes with parameters with default values.

Member Function Documentation

◆ BoolValue()

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.

◆ Default()

const std::shared_ptr< Base_Settings > & cadex::Base_Settings::Default ( )
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.

Examples
Eyeshot/conversion/MainForm.cs, MTKConverter/Program.cs, conversion/cdxwebconverter/Program.cs, conversion/export/Program.cs, conversion/transfer/Program.cs, and conversion/transferparams/Program.cs.

◆ DoubleValue()

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.

◆ IntValue()

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.

◆ SetValue() [1/4]

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.

See also
Value().

◆ SetValue() [2/4]

void cadex::Base_Settings::SetValue ( const Id  theId,
const UTF16 theValue 
)

Sets string parameter value.

If the parameter with the same id has already been registered, it will be overwritten.

See also
StringValue().

◆ SetValue() [3/4]

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.

See also
Value().

◆ SetValue() [4/4]

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.

See also
Value().