Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoPreferences.h
Go to the documentation of this file.
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
44
1914 public:
1915 // Retrieving values
1916
1944 SoNONUNICODE static const char* getValue (const char* name);
1945
1971 static const SbString* getStringValue( const SbString& name );
1972
1990 SoNONUNICODE static SbBool getBool( const char* name, SbBool defaultValue );
1991
2000 static SbBool getBool( const SbString& name, SbBool defaultValue );
2001
2013 SoNONUNICODE static int getInt( const char* name, int defaultValue );
2014
2024 static int getInt( const SbString& name, int defaultValue);
2025
2037 SoNONUNICODE static long getLong( const char* name, long defaultValue );
2038
2048 static long getLong( const SbString& name, long defaultValue );
2049
2061 SoNONUNICODE static float getFloat( const char* name, float defaultValue );
2062
2072 static float getFloat( const SbString& name, float defaultValue );
2073
2085 SoNONUNICODE static double getDouble( const char* name, double defaultValue );
2086
2096 static double getDouble( const SbString& name, double defaultValue );
2097
2110 SoNONUNICODE static const SbString& getString (const char* name, const SbString& defaultValue);
2111
2122 static const SbString& getString( const SbString& name, const SbString& defaultValue );
2123
2138 SoNONUNICODE static const SbVec3f& getVec3f( const char* name, const SbVec3f& defaultValue );
2139
2152 static const SbVec3f& getVec3f( const SbString& name, const SbVec3f& defaultValue );
2153
2168 SoNONUNICODE static const SbVec2s& getVec2s( const char* name, const SbVec2s& defaultValue );
2169
2182 static const SbVec2s& getVec2s( const SbString& name, const SbVec2s& defaultValue );
2183
2198 SoNONUNICODE static const SbColor& getColor( const char* name, const SbColor& defaultValue );
2199
2212 static const SbColor& getColor( const SbString& name, const SbColor& defaultValue );
2213
2214
2215 // Setting values
2216
2230 SoNONUNICODE static void setValue( const char* name, const char* value = NULL );
2231
2243 static void setValue( const SbString& name, const SbString* value = NULL );
2244
2251 SoNONUNICODE static void setBool( const char* name, SbBool value );
2252
2257 static void setBool( const SbString& name, SbBool value );
2258
2265 SoNONUNICODE static void setInt( const char* name, int value );
2266
2271 static void setInt( const SbString& name, int value );
2272
2279 SoNONUNICODE static void setLong( const char* name, long value );
2280
2285 static void setLong( const SbString& name, long value );
2286
2293 SoNONUNICODE static void setFloat( const char* name, float value );
2294
2299 static void setFloat( const SbString& name, float value );
2300
2307 SoNONUNICODE static void setDouble( const char* name, double value );
2308
2313 static void setDouble( const SbString& name, double value );
2314
2327 SoNONUNICODE static void setString (const char* name, const SbString& value);
2328
2338 static void setString( const SbString& name, const SbString& value );
2339
2346 SoNONUNICODE static void setVec3f( const char* name, const SbVec3f& value );
2347
2352 static void setVec3f( const SbString& name, const SbVec3f& value );
2353
2360 SoNONUNICODE static void setVec2s( const char* name, const SbVec2s& value );
2361
2366 static void setVec2s( const SbString& name, const SbVec2s& value );
2367
2374 SoNONUNICODE static void setColor( const char* name, const SbColor& value );
2375
2376
2381 static void setColor( const SbString& name, const SbColor& value );
2382
2390 SoNONUNICODE static void readFile (const char* filename);
2391
2397 static void readFile (const SbString& filename);
2398
2399 private:
2400 static SbDict* s_dictionary;
2401 static SbThreadMutex s_mutex;
2402 static void initialize ();
2403 static SbString s_unspecifiedValue;
2404 static bool s_verbose_env;
2405
2406private:
2407 static void clean();
2408
2409 class SoPreferencesImpl;
2410 friend class SoPreferencesImpl; //VC6 doesn't allow inner classes to access private members
2411
2412};
2413#endif // _SB_ENVIRONMENT_VARS_H
2414
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