#include <application.h>

Public Member Functions | |
| Application (const std::string &configFilename="") | |
| virtual void | Run () |
| Start the Application. | |
| virtual bool | KeyPressed (const dtCore::Keyboard *keyboard, int kc) |
| Called when a key is pressed. | |
| const dtCore::GenericKeyboardListener * | GetKeyboardListener () const |
| |
| dtCore::GenericKeyboardListener * | GetKeyboardListener () |
| |
| const std::string & | GetConfigPropertyValue (const std::string &name, const std::string &defaultValue="") const |
| |
| void | SetConfigPropertyValue (const std::string &name, const std::string &value) |
| Sets the value of a given config property. | |
| void | RemoveConfigPropertyValue (const std::string &name) |
| Removes a property with the given name. | |
| void | AddView (dtCore::View &view) |
| Add a view to the Viewer. | |
| void | RemoveView (dtCore::View &view) |
| Remove a view to the Viewer. | |
| void | SetNextStatisticsType () |
| Cycle through the statistics modes. | |
Static Public Member Functions | |
| static std::string | GenerateDefaultConfigFile (const std::string &filename="config.xml") |
| Generate a default configuration file. | |
| static ApplicationConfigData | GetDefaultConfigData () |
| the publicized default settings for a generated config file. | |
Protected Member Functions | |
| virtual | ~Application () |
| virtual void | PreFrame (const double deltaSimTime) |
| override for preframe | |
| virtual void | Frame (const double deltaSimTime) |
| override for frame | |
| virtual void | PostFrame (const double deltaSimTime) |
| override for postframe | |
| virtual void | CreateInstances (const std::string &name="defaultWin", int x=100, int y=100, int width=640, int height=480, bool cursor=true, bool fullScreen=false) |
| Create basic instances and set up system hooks. | |
| bool | ParseConfigFile (const std::string &file) |
| Read the supplied config file, called from the constructor Read an existing data file and setup the internal class members with attributes from the data file. | |
| const osgViewer::CompositeViewer * | GetCompositeViewer () const |
| |
| osgViewer::CompositeViewer * | GetCompositeViewer () |
| |
Classes | |
| class | AppXMLApplicator |
| A utility to apply the parsed data to the Application instance. | |
The Application class of the dtCore Application Base Class library is the base level class for most applications. It contains the basic components required for applications. An optional XML configuration file can be supplied on the constructor which contains the attributes for the internal DeltaWin, Camera, and Scene. A default Config File can be created by calling GenerateDefaultConfigFile(). This file will contain the default parameters and can be edited, then supplied to the constructor.
Typical use:
Application *app = new Application("Mydatafile.xml"); app->Config(); app->Run();
| XERCES_CPP_NAMESPACE_USE Application::Application | ( | const std::string & | configFilename = "" |
) |
| Application::~Application | ( | ) | [protected, virtual] |
| void Application::Run | ( | ) | [virtual] |
Start the Application.
| std::string dtABC::Application::GenerateDefaultConfigFile | ( | const std::string & | filename = "config.xml" |
) | [static] |
Generate a default configuration file.
This method writes out all the default attributes from the internal Application members and writes them out to a .xml file ("config.xml").
| the | file path to be used when writing. |
| bool Application::KeyPressed | ( | const dtCore::Keyboard * | keyboard, | |
| int | kc | |||
| ) | [virtual] |
Called when a key is pressed.
| keyboard | the source of the event | |
| key | the key pressed | |
| character | the corresponding character |
| const dtCore::GenericKeyboardListener* dtABC::Application::GetKeyboardListener | ( | ) | const [inline] |
| dtCore::GenericKeyboardListener* dtABC::Application::GetKeyboardListener | ( | ) | [inline] |
| ApplicationConfigData Application::GetDefaultConfigData | ( | ) | [static] |
the publicized default settings for a generated config file.
| const std::string & Application::GetConfigPropertyValue | ( | const std::string & | name, | |
| const std::string & | defaultValue = "" | |||
| ) | const |
| void Application::SetConfigPropertyValue | ( | const std::string & | name, | |
| const std::string & | value | |||
| ) |
Sets the value of a given config property.
"i" can't be the "end()" because the insert returned false, meaning it does have that key.
| void Application::RemoveConfigPropertyValue | ( | const std::string & | name | ) |
Removes a property with the given name.
| void Application::AddView | ( | dtCore::View & | view | ) |
Add a view to the Viewer.
| void Application::RemoveView | ( | dtCore::View & | view | ) |
Remove a view to the Viewer.
| void dtABC::Application::SetNextStatisticsType | ( | ) |
Cycle through the statistics modes.
| void Application::PreFrame | ( | const double | deltaSimTime | ) | [protected, virtual] |
| void Application::Frame | ( | const double | deltaSimTime | ) | [protected, virtual] |
| void Application::PostFrame | ( | const double | deltaSimTime | ) | [protected, virtual] |
| void Application::CreateInstances | ( | const std::string & | name = "defaultWin", |
|
| int | x = 100, |
|||
| int | y = 100, |
|||
| int | width = 640, |
|||
| int | height = 480, |
|||
| bool | cursor = true, |
|||
| bool | fullScreen = false | |||
| ) | [protected, virtual] |
Create basic instances and set up system hooks.
| bool Application::ParseConfigFile | ( | const std::string & | file | ) | [protected] |
Read the supplied config file, called from the constructor Read an existing data file and setup the internal class members with attributes from the data file.
| file | the name of the data file to be parsed. |
| const osgViewer::CompositeViewer* dtABC::Application::GetCompositeViewer | ( | ) | const [inline, protected] |
| osgViewer::CompositeViewer* dtABC::Application::GetCompositeViewer | ( | ) | [inline, protected] |