Optika Development
Optika::Generic2DArrayWidget< S > Class Template Reference

An abstract base class for all 2D Array Widets. More...

#include <Optika_ArrayWidget.hpp>

Inheritance diagram for Optika::Generic2DArrayWidget< S >:
Inheritance graph
[legend]
Collaboration diagram for Optika::Generic2DArrayWidget< S >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Constructors
 Generic2DArrayWidget (QString name, QString type, const RCP< const ParameterEntryValidator > validator, QWidget *parent=0)
 Constructs a Generic2DArrayWidget.
Getters and Setters
void initData (TwoDArray< S > array)
 Initializes all of the data in the array widget so when it pops up, the individual widgets are populate with their current values in the array. Also, sets the baseArray to array.
TwoDArray< S > getArrayFromWidgets ()
 Retrieves all the data currently entered in each of the individual widgets and compiles it into a TwoDArray.
virtual S getWidgetValue (int row, int col)=0
 Gets the current value entred in the widget located at row,col.
TwoDArray< S > getData () const
 gets the data currently stored in baseArray.

Protected Member Functions

Protected Functions
void doAcceptWork ()
 Do all the things that need to be done when accept is called.
virtual QWidget * getEditorWidget (int row, int col)=0

Protected Attributes

Protected members
TwoDArray< QWidget * > widgetArray
 An array containing the individual widgets which make up the array widget editor. The widget at row,col is the widget which will edit the value at row,col in the baseArray.
TwoDArray< S > baseArray
 The actual array data that the widget is editing. When the user is finished editing, this TwoDArray is then populated with the values they entered.

Detailed Description

template<class S>
class Optika::Generic2DArrayWidget< S >

An abstract base class for all 2D Array Widets.

TwoDArray


Constructor & Destructor Documentation

template<class S >
Optika::Generic2DArrayWidget< S >::Generic2DArrayWidget ( QString  name,
QString  type,
const RCP< const ParameterEntryValidator >  validator,
QWidget *  parent = 0 
)

Constructs a Generic2DArrayWidget.

Parameters:
nameThe name of the parameter beting edited.
typeThe arrays template type.
validatorThe validator to be used on the Array.
parentThe parent widget.

Member Function Documentation

template<class S>
void Optika::Generic2DArrayWidget< S >::doAcceptWork ( ) [inline, protected, virtual]

Do all the things that need to be done when accept is called.

Namely, set the base array to what is currently entered in the individual widgets and call done.

Implements Optika::GenericArrayWidget< S >.

template<class S>
TwoDArray<S> Optika::Generic2DArrayWidget< S >::getArrayFromWidgets ( ) [inline]

Retrieves all the data currently entered in each of the individual widgets and compiles it into a TwoDArray.

Returns:
A TwoDArray representing the current values in the idividual widgets.

Referenced by Optika::Generic2DArrayWidget< short >::doAcceptWork().

template<class S>
virtual QWidget* Optika::Generic2DArrayWidget< S >::getEditorWidget ( int  row,
int  col 
) [protected, pure virtual]

Get a widget used for editing the value located at row,col in the baseArray.

Parameters:
rowThe row of the value for which an editor widget is desired.
colThe column of the value for which and editor widget is desired.
Returns:
An editor widget used to edit the value at row,co. in the baseArray.

Implemented in Optika::Int2DArrayWidget, Optika::Short2DArrayWidget, Optika::Double2DArrayWidget, Optika::Float2DArrayWidget, and Optika::String2DArrayWidget.

template<class S>
virtual S Optika::Generic2DArrayWidget< S >::getWidgetValue ( int  row,
int  col 
) [pure virtual]

Gets the current value entred in the widget located at row,col.

Returns:
The value entered in the widget at row,col.

Implemented in Optika::Int2DArrayWidget, Optika::Short2DArrayWidget, Optika::Double2DArrayWidget, Optika::Float2DArrayWidget, and Optika::String2DArrayWidget.

Referenced by Optika::Generic2DArrayWidget< short >::getArrayFromWidgets().

template<class S>
void Optika::Generic2DArrayWidget< S >::initData ( TwoDArray< S >  array) [inline]

Initializes all of the data in the array widget so when it pops up, the individual widgets are populate with their current values in the array. Also, sets the baseArray to array.

Parameters:
arrayThe array that should be used to populate the individual widgets making up the ArrayWidget.

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs