rtVTK  0.6.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Friends
rtVTK::Plugin Struct Reference

Provides generic plugin interface.. More...

List of all members.

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)

Detailed Description

Provides generic plugin interface..

Author:
QuigleyEJ1
Bug:
XXX(cpg) - template over real type of (void* ptr;)?

Member Typedef Documentation

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.

Parameters:
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.
Bug:
XXX(ejq) - does Create require the QWidget* argument? I think UI component's parent is reassigned on an addWidget() call anyway.

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.

Parameters:
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.
Returns:
void* - a pointer to a heap-allocated object of the plugin class, cast to a void*.

Part of a plugin's required interface.

Parameters:
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.

Parameters:
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.

Returns:
The unique ID of the plugin as an unsigned integer

Part of a plugin's required interface.

Parameters:
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.

Parameters:
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.

Parameters:
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.
Returns:
Success value of invoking the TraceRay function.

Constructor & Destructor Documentation

rtVTK::Plugin::Plugin ( ) [inline]

Assigns new plugin object a unique id. Initializes all other members to zero.


Member Function Documentation

void rtVTK::Plugin::callClose ( ) [inline]
void rtVTK::Plugin::callCreate ( MainWindow *const  mw,
const Camera camera,
const Mesh mesh,
QWidget *  sa_contents 
) [inline]

References create, and ptr.

Referenced by rtVTK::MainWindow::initializePlugin().

void rtVTK::Plugin::callIdle ( ) [inline]

References idle, and ptr.

void rtVTK::Plugin::callInit ( ) [inline]

References init, and ptr.

void rtVTK::Plugin::callRender ( ) [inline]

References ptr, and render.

void rtVTK::Plugin::callResize ( uint  w,
uint  h 
) [inline]

References ptr, and resize.

Referenced by rtVTK::MainWindow::slotSetActivePlugins().

bool rtVTK::Plugin::callTraceRay ( int  x,
int  y 
) [inline]

References ptr, and traceRay.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const Plugin plugin 
) [friend]

Overloaded output operator. Currently unused. Outputs name and address of plugin.

Parameters:
out: ostream& - output stream.
plugin: const Plugin& - plugin to be written.
Returns:
Returns the modified out parameter.

Member Data Documentation

Uniquely identifies a plugin.

Used to implement unique plugin IDs. This value is assigned to a Plugin object's id upon construction and then incremented.

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().

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().


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