FlightGear next
|
Bucket for subsystem pointers representing the sim's state. More...
#include <globals.hxx>
Public Member Functions | |
FGGlobals () | |
virtual | ~FGGlobals () |
virtual FGRenderer * | get_renderer () const |
void | set_renderer (FGRenderer *render) |
SGSubsystemMgr * | get_subsystem_mgr () const |
template<class T> | |
T * | get_subsystem () const |
SGEventMgr * | get_event_mgr () const |
double | get_sim_time_sec () const |
void | inc_sim_time_sec (double dt) |
void | set_sim_time_sec (double t) |
const SGPath & | get_fg_root () const |
void | set_fg_root (const SGPath &root) |
void | set_texture_cache_dir (const SGPath &textureCache) |
PathList | get_data_paths () const |
Get list of data locations. | |
PathList | get_data_paths (const std::string &suffix) const |
Get data locations which contain the file path suffix. | |
void | append_data_path (const SGPath &path, bool afterFGRoot=false) |
SGPath | findDataPath (const std::string &pathSuffix) const |
Given a path suffix (eg 'Textures' or 'AI/Traffic'), find the first data directory which defines it. | |
const SGPath & | get_fg_home () const |
void | set_fg_home (const SGPath &home) |
const SGPath & | get_download_dir () const |
void | set_download_dir (const SGPath &path) |
const SGPath & | get_texture_cache_dir () const |
const SGPath & | get_terrasync_dir () const |
void | set_terrasync_dir (const SGPath &path) |
const PathList & | get_fg_scenery () const |
const PathList & | get_extra_read_allowed_paths () const |
void | append_fg_scenery (const SGPath &scenery) |
Add a scenery directory. | |
void | append_fg_scenery (const PathList &scenery) |
void | clear_fg_scenery () |
void | append_read_allowed_paths (const SGPath &path) |
Allow Nasal to read a path. | |
void | set_catalog_aircraft_path (const SGPath &path) |
specify a path we'll prepend to the aircraft paths list if non-empty. | |
PathList | get_aircraft_paths () const |
void | append_aircraft_path (const SGPath &path) |
Add an aircraft directory. | |
void | append_aircraft_paths (const PathList &path) |
SGPath | resolve_aircraft_path (const std::string &branch) const |
Given a path to an aircraft-related resource file, resolve it against the appropriate root. | |
SGPath | resolve_maybe_aircraft_path (const std::string &branch) const |
Same as above, but test for non 'Aircraft/' branch paths, and always resolve them against fg_root. | |
SGPath | resolve_resource_path (const std::string &branch) const |
Search in the following directories: | |
const std::string & | get_browser () const |
void | set_browser (const std::string &b) |
long int | get_warp () const |
void | set_warp (long int w) |
long int | get_warp_delta () const |
void | set_warp_delta (long int d) |
SGTime * | get_time_params () const |
void | set_time_params (SGTime *t) |
SGMaterialLib * | get_matlib () const |
void | set_matlib (SGMaterialLib *m) |
SGPropertyNode * | get_props () |
void | resetPropertyRoot () |
reset the property tree to new, empty tree. | |
FGLocale * | get_locale () |
SGCommandMgr * | get_commands () |
SGGeod | get_aircraft_position () const |
SGVec3d | get_aircraft_position_cart () const |
void | get_aircraft_orientation (double &heading, double &pitch, double &roll) |
SGGeod | get_view_position () const |
SGVec3d | get_view_position_cart () const |
SGVec3d | get_ownship_reference_position_cart () const |
string_list * | get_channel_options_list () |
void | set_channel_options_list (string_list *l) |
string_list * | get_initial_waypoints () |
void | set_initial_waypoints (string_list *list) |
FGViewMgr * | get_viewmgr () const |
flightgear::View * | get_current_view () const |
FGControls * | get_controls () const |
FGScenery * | get_scenery () const |
FGTACANList * | get_channellist () const |
void | set_channellist (FGTACANList *c) |
SGPath | autosaveFilePath (SGPath userDataPath=SGPath()) const |
Return an SGPath instance for the autosave file under 'userDataPath', which defaults to $FG_HOME. | |
void | loadUserSettings (SGPath userDatapath=SGPath()) |
Load user settings from the autosave file under 'userDataPath', which defaults to $FG_HOME. | |
void | saveUserSettings (SGPath userDatapath=SGPath()) |
Save user settings to the autosave file under 'userDataPath', which defaults to $FG_HOME. | |
void | addListenerToCleanup (SGPropertyChangeListener *l) |
simgear::pkg::Root * | packageRoot () |
void | setPackageRoot (const SGSharedPtr< simgear::pkg::Root > &p) |
bool | is_headless () |
A runtime headless mode for running without a GUI. | |
void | set_headless (bool mode) |
Bucket for subsystem pointers representing the sim's state.
Definition at line 78 of file globals.hxx.
FGGlobals::FGGlobals | ( | ) |
Definition at line 146 of file globals.cxx.
|
virtual |
Definition at line 194 of file globals.cxx.
void FGGlobals::addListenerToCleanup | ( | SGPropertyChangeListener * | l | ) |
Definition at line 976 of file globals.cxx.
void FGGlobals::append_aircraft_path | ( | const SGPath & | path | ) |
Add an aircraft directory.
This also makes the path Nasal-readable: to avoid can-read-any-file security holes, do NOT call this on paths obtained from the property tree or other Nasal-writable places
Definition at line 524 of file globals.cxx.
void FGGlobals::append_aircraft_paths | ( | const PathList & | path | ) |
Definition at line 548 of file globals.cxx.
void FGGlobals::append_data_path | ( | const SGPath & | path, |
bool | afterFGRoot = false ) |
Definition at line 329 of file globals.cxx.
void FGGlobals::append_fg_scenery | ( | const PathList & | scenery | ) |
Definition at line 373 of file globals.cxx.
void FGGlobals::append_fg_scenery | ( | const SGPath & | scenery | ) |
Add a scenery directory.
This also makes the path Nasal-readable: to avoid can-read-any-file security holes, do NOT call this on paths obtained from the property tree or other Nasal-writable places
Definition at line 380 of file globals.cxx.
void FGGlobals::append_read_allowed_paths | ( | const SGPath & | path | ) |
Allow Nasal to read a path.
To avoid can-read-any-file security holes, do NOT call this on paths obtained from the property tree or other Nasal-writable places
Only works during initial load (before fgInitAllowedPaths)
Definition at line 448 of file globals.cxx.
SGPath FGGlobals::autosaveFilePath | ( | SGPath | userDataPath = SGPath() | ) | const |
Return an SGPath instance for the autosave file under 'userDataPath', which defaults to $FG_HOME.
Definition at line 739 of file globals.cxx.
void FGGlobals::clear_fg_scenery | ( | ) |
Definition at line 458 of file globals.cxx.
SGPath FGGlobals::findDataPath | ( | const std::string & | pathSuffix | ) | const |
Given a path suffix (eg 'Textures' or 'AI/Traffic'), find the first data directory which defines it.
Definition at line 348 of file globals.cxx.
void FGGlobals::get_aircraft_orientation | ( | double & | heading, |
double & | pitch, | ||
double & | roll ) |
Definition at line 624 of file globals.cxx.
PathList FGGlobals::get_aircraft_paths | ( | ) | const |
Definition at line 513 of file globals.cxx.
SGGeod FGGlobals::get_aircraft_position | ( | ) | const |
Definition at line 611 of file globals.cxx.
SGVec3d FGGlobals::get_aircraft_position_cart | ( | ) | const |
Definition at line 619 of file globals.cxx.
|
inline |
Definition at line 302 of file globals.hxx.
|
inline |
Definition at line 344 of file globals.hxx.
|
inline |
Definition at line 366 of file globals.hxx.
|
inline |
Definition at line 330 of file globals.hxx.
FGControls * FGGlobals::get_controls | ( | ) | const |
Definition at line 971 of file globals.cxx.
flightgear::View * FGGlobals::get_current_view | ( | ) | const |
Definition at line 960 of file globals.cxx.
PathList FGGlobals::get_data_paths | ( | ) | const |
Get list of data locations.
fg_root is always the final item in the result.
Definition at line 308 of file globals.cxx.
PathList FGGlobals::get_data_paths | ( | const std::string & | suffix | ) | const |
Get data locations which contain the file path suffix.
Eg pass ing 'AI/Traffic' to get all data paths which define <path>/AI/Traffic subdir
Definition at line 316 of file globals.cxx.
|
inline |
Definition at line 216 of file globals.hxx.
SGEventMgr * FGGlobals::get_event_mgr | ( | ) | const |
Definition at line 605 of file globals.cxx.
|
inline |
Definition at line 235 of file globals.hxx.
|
inline |
Definition at line 213 of file globals.hxx.
|
inline |
Definition at line 189 of file globals.hxx.
|
inline |
Definition at line 234 of file globals.hxx.
|
inline |
Definition at line 351 of file globals.hxx.
|
inline |
Definition at line 328 of file globals.hxx.
|
inline |
Definition at line 314 of file globals.hxx.
SGVec3d FGGlobals::get_ownship_reference_position_cart | ( | ) | const |
Definition at line 644 of file globals.cxx.
|
inline |
Definition at line 320 of file globals.hxx.
|
virtual |
Definition at line 572 of file globals.cxx.
FGScenery * FGGlobals::get_scenery | ( | ) | const |
Definition at line 950 of file globals.cxx.
|
inline |
Definition at line 185 of file globals.hxx.
|
inline |
Definition at line 177 of file globals.hxx.
SGSubsystemMgr * FGGlobals::get_subsystem_mgr | ( | ) | const |
Definition at line 589 of file globals.cxx.
|
inline |
Definition at line 226 of file globals.hxx.
|
inline |
Definition at line 224 of file globals.hxx.
|
inline |
Definition at line 311 of file globals.hxx.
SGGeod FGGlobals::get_view_position | ( | ) | const |
Definition at line 632 of file globals.cxx.
SGVec3d FGGlobals::get_view_position_cart | ( | ) | const |
Definition at line 640 of file globals.cxx.
FGViewMgr * FGGlobals::get_viewmgr | ( | ) | const |
Definition at line 955 of file globals.cxx.
long int FGGlobals::get_warp | ( | ) | const |
Definition at line 930 of file globals.cxx.
long int FGGlobals::get_warp_delta | ( | ) | const |
Definition at line 940 of file globals.cxx.
|
inline |
Definition at line 186 of file globals.hxx.
bool FGGlobals::is_headless | ( | ) |
A runtime headless mode for running without a GUI.
Definition at line 1002 of file globals.cxx.
void FGGlobals::loadUserSettings | ( | SGPath | userDatapath = SGPath() | ) |
Load user settings from the autosave file under 'userDataPath', which defaults to $FG_HOME.
Definition at line 860 of file globals.cxx.
simgear::pkg::Root * FGGlobals::packageRoot | ( | ) |
Definition at line 992 of file globals.cxx.
void FGGlobals::resetPropertyRoot | ( | ) |
reset the property tree to new, empty tree.
Ensure all subsystems are shutdown and unbound before call this.
Definition at line 685 of file globals.cxx.
SGPath FGGlobals::resolve_aircraft_path | ( | const std::string & | branch | ) | const |
Given a path to an aircraft-related resource file, resolve it against the appropriate root.
This means looking at the location defined by /sim/aircraft-dir, and then aircraft_path in turn, finishing with fg_root/Aircraft.
if the path could not be resolved, an empty path is returned.
Definition at line 555 of file globals.cxx.
SGPath FGGlobals::resolve_maybe_aircraft_path | ( | const std::string & | branch | ) | const |
Same as above, but test for non 'Aircraft/' branch paths, and always resolve them against fg_root.
Definition at line 560 of file globals.cxx.
SGPath FGGlobals::resolve_resource_path | ( | const std::string & | branch | ) | const |
Search in the following directories:
Definition at line 565 of file globals.cxx.
void FGGlobals::saveUserSettings | ( | SGPath | userDatapath = SGPath() | ) |
Save user settings to the autosave file under 'userDataPath', which defaults to $FG_HOME.
When calling this method, make sure the value of 'userDataPath' is trustworthy. In particular, make sure it can't be influenced by Nasal code, not even indirectly via a Nasal-writable place such as the property tree.
Note: the default value is safe—if not, it would be a bug.
Definition at line 902 of file globals.cxx.
|
inline |
Definition at line 303 of file globals.hxx.
void FGGlobals::set_catalog_aircraft_path | ( | const SGPath & | path | ) |
specify a path we'll prepend to the aircraft paths list if non-empty.
This is used with packaged aircraft, to ensure their catalog (and hence, dependency packages) are found correctly.
Definition at line 508 of file globals.cxx.
|
inline |
Definition at line 347 of file globals.hxx.
|
inline |
Definition at line 367 of file globals.hxx.
void FGGlobals::set_download_dir | ( | const SGPath & | path | ) |
Definition at line 468 of file globals.cxx.
void FGGlobals::set_fg_home | ( | const SGPath & | home | ) |
Definition at line 293 of file globals.cxx.
void FGGlobals::set_fg_root | ( | const SGPath & | root | ) |
Definition at line 265 of file globals.cxx.
void FGGlobals::set_headless | ( | bool | mode | ) |
Definition at line 1007 of file globals.cxx.
|
inline |
Definition at line 355 of file globals.hxx.
void FGGlobals::set_matlib | ( | SGMaterialLib * | m | ) |
Definition at line 966 of file globals.cxx.
void FGGlobals::set_renderer | ( | FGRenderer * | render | ) |
Definition at line 577 of file globals.cxx.
|
inline |
Definition at line 187 of file globals.hxx.
void FGGlobals::set_terrasync_dir | ( | const SGPath & | path | ) |
Definition at line 489 of file globals.cxx.
void FGGlobals::set_texture_cache_dir | ( | const SGPath & | textureCache | ) |
Definition at line 298 of file globals.cxx.
|
inline |
Definition at line 312 of file globals.hxx.
void FGGlobals::set_warp | ( | long int | w | ) |
Definition at line 935 of file globals.cxx.
void FGGlobals::set_warp_delta | ( | long int | d | ) |
Definition at line 945 of file globals.cxx.
void FGGlobals::setPackageRoot | ( | const SGSharedPtr< simgear::pkg::Root > & | p | ) |
Definition at line 997 of file globals.cxx.