HyperspaceExplorer 0.7.1
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes
Global Class Reference

As a workaround to end the embarassing practice of keeping global variables, I have created this class as a singleton. You might also call it a namespace. More...

#include <Globals.h>

Collaboration diagram for Global:
Collaboration graph
[legend]

List of all members.

Classes

struct  Impl

Public Member Functions

QStringList & rcdirs ()
QAction * getQuitAction ()
QMainWindow * getMainWindow ()
Color & FogColor ()
void setFogColor (const Color &rgba)
 Set the global fog color.

Static Public Member Functions

static unsigned long getMaxMemory ()
static Color & white ()
static Color & grey50 ()
static bool checkMemory ()

Public Attributes

const double SR3

Private Attributes

Impl * pImpl_

Detailed Description

As a workaround to end the embarassing practice of keeping global variables, I have created this class as a singleton. You might also call it a namespace.

I plan to advance this class to a full-blown registry though. One day.

Members are accessed with the SingletonHolder static function, i.e. Globals::Instance().

Author:
Helge Preuss <lene.preuss@gmail.com>

Member Function Documentation

bool Global::checkMemory ( ) [static]
Returns:
Whether to check for memory usage

References Global::Impl::check_memory.

Color & Global::FogColor ( )
Returns:
The global fog color

References Global::Impl::fog_color.

QMainWindow * Global::getMainWindow ( )
Returns:
The main window of the application

References Global::Impl::mainWindow.

long unsigned int Global::getMaxMemory ( ) [static]

maximum amount of memory available for use

References Global::Impl::MaximumMemory.

QAction * Global::getQuitAction ( )
Returns:
The QAction associated with quitting the application

References Global::Impl::quitAction.

Color & Global::grey50 ( ) [static]

color definition for Grey

References Global::Impl::Grey50.

QStringList & Global::rcdirs ( )

why tf did i make that global again? damn, i really should write comments immediately after writing the code

void Global::setFogColor ( const Color &  rgba)

Set the global fog color.

Parameters:
rgbaThe new fog color

References Global::Impl::fog_color.

Color & Global::white ( ) [static]

color definition for White

References Global::Impl::White.


Member Data Documentation

const double Global::SR3

sqrt (3), stored to save computation time, probably superfluous


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:18 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo