VoreenApplication Class Reference

Represents basic properties of a Voreen application. More...

#include <voreenapplication.h>

Inheritance diagram for VoreenApplication:
VoreenApplicationQt

List of all members.

Public Types

enum  ApplicationType {
  APP_NONE = 0, APP_SHADER = 1, APP_DATA = 2, APP_LOGGING = 4,
  APP_PYTHON = 8, APP_DEFAULT = 0xFFFF
}
 

Features used in this application.

More...

Public Member Functions

 VoreenApplication (const std::string &name, const std::string &displayName, int argc, char **argv, ApplicationType appType=APP_DEFAULT)
virtual ~VoreenApplication ()
 Calls deinitialize() on all registered modules and deletes them.
std::string getName () const
std::string getDisplayName () const
CommandlineParsergetCommandLineParser ()
virtual void prepareCommandParser ()
 Overwrite this method to add commands to the CommandlineParser.
virtual void init ()
 Do the actual initializations as controlled by appType_: Initialize tgt, execute command parser, start logging, detect paths and initialize Python.
virtual void initGL ()
 Do OpenGL-specific initialization and call initialize() on all registered modules.
void addModule (VoreenModule *module)
 Registers a module.
const std::vector< VoreenModule * > getModules () const
 Returns all registered modules.
virtual tgt::TimercreateTimer (tgt::EventHandler *handler) const
 Factory method for timers.
virtual IOProgresscreateProgressDialog () const
 Factory method for progress dialogs.
void setProcessorWidgetFactory (ProcessorWidgetFactory *factory)
 Sets a toolkit specific factory that is used by the processors for creating their processor widgets.
const ProcessorWidgetFactorygetProcessorWidgetFactory () const
 Returns a toolkit specific factory that is used by the processors for creating their processor widgets.
std::string getBasePath () const
 Paths.
std::string getCachePath (const std::string &filename="") const
 Constructs an absolute path consisting of the cache directory (typically voreen/data/cache) and the given filename.
std::string getDataPath (const std::string &filename="") const
 Constructs an absolute path consisting of the data directory (typically voreen/data) and the given filename.
std::string getVolumePath (const std::string &filename="") const
 Constructs an absolute path consisting of the volume data directory and the given filename.
std::string getShaderPath (const std::string &filename="") const
 Constructs an absolute path consisting of the shader source directory and the given filename.
std::string getSnapshotPath (const std::string &filename="") const
 Constructs an absolute path consisting of Snapshot directory and the given filename.
std::string getFontPath (const std::string &filename="") const
 Constructs an absolute path consisting of the font directory (typically voreen/data/fonts) and the given filename.
std::string getNetworkPath (const std::string &filename="") const
 Constructs an absolute path consisting of network file directory (typically voreen/data/networks) and the given filename.
std::string getWorkspacePath (const std::string &filename="") const
 Constructs an absolute path consisting of workspace file directory (typically voreen/data/workspaces) and the given filename.
std::string getScriptPath (const std::string &filename="") const
 Constructs an absolute path consisting of script directory (typically voreen/data/scripts) and the given filename.
std::string getTransFuncPath (const std::string &filename="") const
 Constructs an absolute path consisting of transfer function directory (typically voreen/data/transferfuncs) and the given filename.
std::string getTexturePath (const std::string &filename="") const
 Constructs an absolute path consisting of the textures directory (typically voreen/data/textures) and the given filename.
std::string getModulePath (const std::string &filename="") const
 Constructs an absolute path consisting of the module directory (typically voreen/src/modules) and the given filename.
std::string getTemporaryPath (const std::string &filename="") const
 Constructs an absolute path consisting of the temporary directory (typically voreen/data/tmp) and the given filename.
std::string getDocumentationPath (const std::string &filename="") const
 Constructs an absolute path consisting of the documentation directory (typically voreen/doc) and the given filename.
std::string getDocumentsPath (const std::string &filename="") const
 Constructs an absolute path consisting of the documents directory (typically "C:\Documents and Settings\user\Documents" on Windows and $HOME on unix) and the given filename.

Static Public Member Functions

static VoreenApplicationapp ()
 Allows access to the global instance of this class.

Protected Attributes

ApplicationType appType_
std::string name_
std::string displayName_
CommandlineParser cmdParser_
ProcessorWidgetFactoryprocessorWidgetFactory_
std::string basePath_
std::string cachePath_
std::string dataPath_
std::string texturePath_
std::string fontPath_
std::string volumePath_
std::string temporaryPath_
std::string documentationPath_
std::string documentsPath_
tgt::LogLevel logLevel_
std::string logFile_

Static Protected Attributes

static VoreenApplicationapp_ = 0
static const std::string loggerCat_ = "voreen.VoreenApplication"

Detailed Description

Represents basic properties of a Voreen application.

There should only be one instance of this class, which can be access via the static metho app().

Definition at line 51 of file voreenapplication.h.


Member Enumeration Documentation

Features used in this application.

Enumerator:
APP_NONE 

nothing

APP_SHADER 

detect shader path

APP_DATA 

detect data path

APP_LOGGING 

activate logging to the console

APP_PYTHON 

activate python scripting

APP_DEFAULT 

all features

Definition at line 54 of file voreenapplication.h.


Constructor & Destructor Documentation

VoreenApplication ( const std::string &  name,
const std::string &  displayName,
int  argc,
char **  argv,
ApplicationType  appType = APP_DEFAULT 
)
Parameters:
name Short name of the application in lowercase ("voreenve")
displayName Nice-looking name of the application ("VoreenVE")
argc Number of arguments as retrieved from main()
argv Argument vector as retrieved from main()
appType Features to activate

Definition at line 167 of file voreenapplication.cpp.

~VoreenApplication (  )  [virtual]

Calls deinitialize() on all registered modules and deletes them.

Also deinitializes tgt.

See also:
VoreenModule

Definition at line 180 of file voreenapplication.cpp.


Member Function Documentation

IOProgress * createProgressDialog (  )  const [virtual]

Factory method for progress dialogs.

Note:
You have to override this function in a toolkit specific subclass in order to actual create a progress dialog. The standard implementation returns the null pointer.

Reimplemented in VoreenApplicationQt.

Definition at line 373 of file voreenapplication.cpp.

tgt::Timer * createTimer ( tgt::EventHandler handler  )  const [virtual]

Factory method for timers.

Parameters:
handler The event handler that will be used for broadcasting the timer events. Must not be null.
Note:
You have to override this function in a toolkit specific subclass in order to actual create a timer. The standard implementation returns the null pointer.

Reimplemented in VoreenApplicationQt.

Definition at line 369 of file voreenapplication.cpp.

std::string getBasePath (  )  const

Paths.

Returns the application's base path as detected by

See also:
init().

Definition at line 385 of file voreenapplication.cpp.

const ProcessorWidgetFactory * getProcessorWidgetFactory (  )  const

Returns a toolkit specific factory that is used by the processors for creating their processor widgets.

If no factory has been assigned, the null pointer is returned.

Definition at line 381 of file voreenapplication.cpp.

void setProcessorWidgetFactory ( ProcessorWidgetFactory factory  ) 

Sets a toolkit specific factory that is used by the processors for creating their processor widgets.

Processor widgets are created by Processor::initialize, if a factory is available.

Definition at line 377 of file voreenapplication.cpp.