Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoPreferences.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2024 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23/*==============================================================================
24* Classes : SoPreferences
25* Author(s) : Fabien ARNAUD
26* Date : Jul, 18 2002
27* Feb, 20 2003
28*==============================================================================
29*
30* Description : Manage environment variables and configuration file
31*
32*============================================================================*/
33
34
35#ifndef _SB_ENVIRONMENT_VARS_H
36#define _SB_ENVIRONMENT_VARS_H
37
38#include <Inventor/SbBase.h>
39#include <Inventor/SbDict.h>
40#include <Inventor/SbColor.h>
41#include <Inventor/SbVec.h>
42
43#include <Inventor/threads/SbThreadMutex.h>
44
1881 public:
1882 // Retrieving values
1883
1911 SoNONUNICODE static const char* getValue (const char* name);
1912
1938 static const SbString* getStringValue( const SbString& name );
1939
1957 SoNONUNICODE static SbBool getBool( const char* name, SbBool defaultValue );
1958
1967 static SbBool getBool( const SbString& name, SbBool defaultValue );
1968
1980 SoNONUNICODE static int getInt( const char* name, int defaultValue );
1981
1991 static int getInt( const SbString& name, int defaultValue);
1992
2004 SoNONUNICODE static long getLong( const char* name, long defaultValue );
2005
2015 static long getLong( const SbString& name, long defaultValue );
2016
2028 SoNONUNICODE static float getFloat( const char* name, float defaultValue );
2029
2039 static float getFloat( const SbString& name, float defaultValue );
2040
2052 SoNONUNICODE static double getDouble( const char* name, double defaultValue );
2053
2063 static double getDouble( const SbString& name, double defaultValue );
2064
2077 SoNONUNICODE static const SbString& getString (const char* name, const SbString& defaultValue);
2078
2089 static const SbString& getString( const SbString& name, const SbString& defaultValue );
2090
2105 SoNONUNICODE static const SbVec3f& getVec3f( const char* name, const SbVec3f& defaultValue );
2106
2119 static const SbVec3f& getVec3f( const SbString& name, const SbVec3f& defaultValue );
2120
2135 SoNONUNICODE static const SbVec2s& getVec2s( const char* name, const SbVec2s& defaultValue );
2136
2149 static const SbVec2s& getVec2s( const SbString& name, const SbVec2s& defaultValue );
2150
2165 SoNONUNICODE static const SbColor& getColor( const char* name, const SbColor& defaultValue );
2166
2179 static const SbColor& getColor( const SbString& name, const SbColor& defaultValue );
2180
2181
2182 // Setting values
2183
2197 SoNONUNICODE static void setValue( const char* name, const char* value = NULL );
2198
2210 static void setValue( const SbString& name, const SbString* value = NULL );
2211
2218 SoNONUNICODE static void setBool( const char* name, SbBool value );
2219
2224 static void setBool( const SbString& name, SbBool value );
2225
2232 SoNONUNICODE static void setInt( const char* name, int value );
2233
2238 static void setInt( const SbString& name, int value );
2239
2246 SoNONUNICODE static void setLong( const char* name, long value );
2247
2252 static void setLong( const SbString& name, long value );
2253
2260 SoNONUNICODE static void setFloat( const char* name, float value );
2261
2266 static void setFloat( const SbString& name, float value );
2267
2274 SoNONUNICODE static void setDouble( const char* name, double value );
2275
2280 static void setDouble( const SbString& name, double value );
2281
2294 SoNONUNICODE static void setString (const char* name, const SbString& value);
2295
2305 static void setString( const SbString& name, const SbString& value );
2306
2313 SoNONUNICODE static void setVec3f( const char* name, const SbVec3f& value );
2314
2319 static void setVec3f( const SbString& name, const SbVec3f& value );
2320
2327 SoNONUNICODE static void setVec2s( const char* name, const SbVec2s& value );
2328
2333 static void setVec2s( const SbString& name, const SbVec2s& value );
2334
2341 SoNONUNICODE static void setColor( const char* name, const SbColor& value );
2342
2343
2348 static void setColor( const SbString& name, const SbColor& value );
2349
2357 SoNONUNICODE static void readFile (const char* filename);
2358
2364 static void readFile (const SbString& filename);
2365
2366 private:
2367 static SbDict* s_dictionary;
2368 static SbThreadMutex s_mutex;
2369 static void initialize ();
2370 static SbString s_unspecifiedValue;
2371 static bool s_verbose_env;
2372
2373private:
2374 static void clean();
2375
2376 class SoPreferencesImpl;
2377 friend class SoPreferencesImpl; //VC6 doesn't allow inner classes to access private members
2378
2379};
2380#endif // _SB_ENVIRONMENT_VARS_H
2381
Color vector class.
Definition SbColor.h:82
Class for smart character strings.
Definition SbString.h:202
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
2D vector class.
Definition SbVec.h:700
3D vector class.
Definition SbVec.h:932
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Manages Open Inv...
static const SbString & getString(const SbString &name, const SbString &defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment.
static long getLong(const SbString &name, long defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static const SbVec2s & getVec2s(const SbString &name, const SbVec2s &defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static void setVec3f(const SbString &name, const SbVec3f &value)
Sets a variable that has an SbVec3f value in the Open Inventor environment.
static const SbString * getStringValue(const SbString &name)
Returns the value of the specified environment variable in the Open Inventor environment.
static SoNONUNICODE int getInt(const char *name, int defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static void setInt(const SbString &name, int value)
Sets a variable that has an int value in the Open Inventor environment.
static void readFile(const SbString &filename)
Reads environment name-value pairs from the specified configuration file and adds them to the current...
static const SbColor & getColor(const SbString &name, const SbColor &defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static SoNONUNICODE const char * getValue(const char *name)
Returns the value of the specified environment variable in the Open Inventor environment.
static SoNONUNICODE void setFloat(const char *name, float value)
Sets a variable that has a float value in the Open Inventor environment.
static SoNONUNICODE long getLong(const char *name, long defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static void setVec2s(const SbString &name, const SbVec2s &value)
Sets a variable that has an SbVec2s value in the Open Inventor environment.
static SoNONUNICODE const SbVec2s & getVec2s(const char *name, const SbVec2s &defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static void setColor(const SbString &name, const SbColor &value)
Sets a variable that has an SbColor value in the Open Inventor environment.
static void setFloat(const SbString &name, float value)
Sets a variable that has a float value in the Open Inventor environment.
static void setLong(const SbString &name, long value)
Sets a variable that has a long value in the Open Inventor environment.
static double getDouble(const SbString &name, double defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static SoNONUNICODE void setLong(const char *name, long value)
Sets a variable that has a long value in the Open Inventor environment.
static SoNONUNICODE void readFile(const char *filename)
Reads environment name-value pairs from the specified configuration file and adds them to the current...
static SoNONUNICODE void setInt(const char *name, int value)
Sets a variable that has an int value in the Open Inventor environment.
static SoNONUNICODE const SbString & getString(const char *name, const SbString &defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment.
static int getInt(const SbString &name, int defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static SoNONUNICODE float getFloat(const char *name, float defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static SbBool getBool(const SbString &name, SbBool defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static SoNONUNICODE const SbVec3f & getVec3f(const char *name, const SbVec3f &defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static SoNONUNICODE void setVec2s(const char *name, const SbVec2s &value)
Sets a variable that has an SbVec2s value in the Open Inventor environment.
static void setValue(const SbString &name, const SbString *value=NULL)
Sets a variable in the Open Inventor environment.
friend class SoPreferencesImpl
static SoNONUNICODE void setValue(const char *name, const char *value=NULL)
Sets a variable in the Open Inventor environment.
static float getFloat(const SbString &name, float defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static SoNONUNICODE void setVec3f(const char *name, const SbVec3f &value)
Sets a variable that has an SbVec3f value in the Open Inventor environment.
static SoNONUNICODE void setColor(const char *name, const SbColor &value)
Sets a variable that has an SbColor value in the Open Inventor environment.
static const SbVec3f & getVec3f(const SbString &name, const SbVec3f &defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static void setDouble(const SbString &name, double value)
Sets a variable that has a double value in the Open Inventor environment.
static SoNONUNICODE void setBool(const char *name, SbBool value)
Sets a variable that has a boolean value in the Open Inventor environment.
static void setString(const SbString &name, const SbString &value)
Sets a variable that has an SbString value in the Open Inventor environment.
static SoNONUNICODE void setString(const char *name, const SbString &value)
Sets a variable that has an SbString value in the Open Inventor environment.
static SoNONUNICODE void setDouble(const char *name, double value)
Sets a variable that has a double value in the Open Inventor environment.
static void setBool(const SbString &name, SbBool value)
Sets a variable that has a boolean value in the Open Inventor environment.
static SoNONUNICODE const SbColor & getColor(const char *name, const SbColor &defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static SoNONUNICODE SbBool getBool(const char *name, SbBool defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
static SoNONUNICODE double getDouble(const char *name, double defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
int SbBool
Boolean type.
Definition SbBase.h:87