Provides generic plugin interface.. More...
Public Types | |
typedef void *(* | Create )(MainWindow *const, const Camera &, const Mesh &, QWidget *) |
typedef void *(* | Init )(void *) |
typedef void(* | Resize )(void *, uint, uint) |
typedef void(* | Render )(void *) |
typedef void(* | Close )(void *) |
typedef void(* | Idle )(void *) |
typedef bool(* | TraceRay )(void *, int, int) |
typedef uint | PluginID |
Public Member Functions | |
Plugin () | |
Function Wrappers | |
Convenience functions to wrap actual function calls. | |
void | callCreate (MainWindow *const mw, const Camera &camera, const Mesh &mesh, QWidget *sa_contents) |
void | callInit () |
void | callResize (uint w, uint h) |
void | callRender () |
void | callClose () |
void | callIdle () |
bool | callTraceRay (int x, int y) |
Public Attributes | |
const PluginID | id |
void * | ptr |
string | name |
bool | requiresTab |
bool | initialized |
Interface Functions | |
Pointers to interface functions. | |
Create | create |
Init | init |
Resize | resize |
Render | render |
Close | closer |
Idle | idle |
TraceRay | traceRay |
Static Public Attributes | |
static PluginID | idCounter = 0 |
Friends | |
ostream & | operator<< (ostream &out, const Plugin &plugin) |
Provides generic plugin interface..
Part of a plugin's required interface. This function should be responsible for deallocating the memory pointed to by the void* being passed as an argument.
ptr | : void* - a pointer to an object of the plugin class type. It is the responsibility of the plugin interface writer to cast this void pointer to the proper type before invoking any of its member functions. |
Create function Part of a plugin's required interface. This function should create an object of the plugin class and return a void* to that object.
glw | : glWidget* - A plugin may use this argument to make signal/slot connections using interface provided by glWidget. |
camera | : const Camera& - The current camera position. |
mesh | : const Mesh& |
layout | : QLayout* - A layout provided by MainWindow. A plugin may add any UI elements to this layout. |
parent | : QWidget* - A parent for any UI elements that the plugin will add. |
Part of a plugin's required interface.
ptr | : void* - a pointer to an object of the plugin class type. It is the responsibility of the plugin interface writer to cast this void pointer to the proper type before invoking any of its member functions. |
Init function Part of a plugin's required interface.
ptr | : void* - a pointer to an object of the plugin class type. It is the responsibility of the plugin interface writer to cast this void pointer to the proper type before invoking any of its member functions. |
Every object of type Plugin has a unique PluginID.
Part of a plugin's required interface.
ptr | : void* - a pointer to an object of the plugin class type. It is the responsibility of the plugin interface writer to cast this void pointer to the proper type before invoking any of its member functions. |
Part of a plugin's required interface.
ptr | : void* - a pointer to an object of the plugin class type. It is the responsibility of the plugin interface writer to cast this void pointer to the proper type before invoking any of its member functions. |
w | : unsigned int - new width. |
h | : unsigned int - new height. |
Part of a plugin's required interface. If a plugin class is a ray tracer that implements a TraceRay function, this interface function should invoke it and return its success value. If a plugin class does not implement a TraceRay function, this interface function should simply return false.
ptr | : void* - a pointer to an object of the plugin class type. It is the responsibility of the plugin interface writer to cast this void pointer to the proper type before invoking any of its member functions. |
x | : int - the x-coordinate of the pixel to be traced. |
y | : int - the y-coordinate of the pixel to be traced. |
rtVTK::Plugin::Plugin | ( | ) | [inline] |
Assigns new plugin object a unique id. Initializes all other members to zero.
void rtVTK::Plugin::callClose | ( | ) | [inline] |
Referenced by rtVTK::MainWindow::initializePlugin(), and rtVTK::PluginManager::unload().
void rtVTK::Plugin::callCreate | ( | MainWindow *const | mw, |
const Camera & | camera, | ||
const Mesh & | mesh, | ||
QWidget * | sa_contents | ||
) | [inline] |
Referenced by rtVTK::MainWindow::initializePlugin().
void rtVTK::Plugin::callIdle | ( | ) | [inline] |
void rtVTK::Plugin::callInit | ( | ) | [inline] |
void rtVTK::Plugin::callRender | ( | ) | [inline] |
void rtVTK::Plugin::callResize | ( | uint | w, |
uint | h | ||
) | [inline] |
Referenced by rtVTK::MainWindow::slotSetActivePlugins().
bool rtVTK::Plugin::callTraceRay | ( | int | x, |
int | y | ||
) | [inline] |
ostream& operator<< | ( | ostream & | out, |
const Plugin & | plugin | ||
) | [friend] |
Overloaded output operator. Currently unused. Outputs name and address of plugin.
out | : ostream& - output stream. |
plugin | : const Plugin& - plugin to be written. |
Referenced by callClose(), and rtVTK::PluginManager::load().
Referenced by callCreate(), and rtVTK::PluginManager::load().
const PluginID rtVTK::Plugin::id |
Uniquely identifies a plugin.
rtVTK::Plugin::PluginID rtVTK::Plugin::idCounter = 0 [static] |
Used to implement unique plugin IDs. This value is assigned to a Plugin object's id upon construction and then incremented.
Referenced by callIdle(), and rtVTK::PluginManager::load().
Referenced by callInit(), and rtVTK::PluginManager::load().
Referenced by rtVTK::MainWindow::initializePlugin(), and rtVTK::PluginManager::unload().
string rtVTK::Plugin::name |
Stores the name of the plugin. This name is provided by the plugin's interface and is distinct from the plugin's file name.
Referenced by rtVTK::TimerDialog::addSlotList(), rtVTK::PluginManager::findValidDLLs(), rtVTK::MainWindow::initializePlugin(), rtVTK::PluginManager::load(), and rtVTK::TimerDialog::slotAddTimer().
void* rtVTK::Plugin::ptr |
Pointer to actual plugin object. Stored without knowledge of type. A plugin writer is responsible for casting this pointer to the correct type within interface function implementations.
Referenced by rtVTK::TimerDialog::addSlotList(), callClose(), callCreate(), callIdle(), callInit(), callRender(), callResize(), callTraceRay(), and rtVTK::TimerDialog::slotAddTimer().
Referenced by callRender(), and rtVTK::PluginManager::load().
Referenced by callResize(), and rtVTK::PluginManager::load().
Referenced by callTraceRay(), and rtVTK::PluginManager::load().