VWLib REFERENCE MANUAL


NAME
vwIncrementor - A generic incrementor class.

INHERITS FROM
vwWidget, vwLabel [Protected]

HEADER FILE
#include <vwIncrementor.h>

PUBLIC METHOD SUMMARY
vwIncrementor::vwIncrementor ( vwMediator * concreteMediator, pfSCS * scs, pfFont * font);
virtual vwIncrementor::~vwIncrementor ( void);
virtual void vwIncrementor::setDataParms ( float dataMin, float dataMax, float incriment);
virtual void vwIncrementor::setDataParms ( int dataMin, int dataMax, int incriment);
virtual void vwIncrementor::initValue ( char * label, float value=0.0);
virtual void vwIncrementor::initValue ( char * label, int value=0.0);
void vwIncrementor::increment ( void);
void vwIncrementor::decrement ( void);
inline void vwIncrementor::setLabelColor ( float * rgba);
inline void vwIncrementor::setLabelSize ( float size=1.0);
inline void vwIncrementor::setLabelVSpc ( float verticalSpacing=1.0);
inline void vwIncrementor::setLabelHeight ( float height=0.0);
inline void vwIncrementor::setSpacingScale ( float horiz=1.0, float vert=1.0, float depth=1.0);
inline int vwIncrementor::isGeneric ( int expandedState);
inline iType vwIncrementor::getIncDataType ( void);
inline void vwIncrementor::getDataMin ( float * dataMin);
inline void vwIncrementor::getDataMin ( int * dataMin);
inline void vwIncrementor::getDataMax ( float * dataMax);
inline void vwIncrementor::getDataMax ( int * dataMax);
inline void vwIncrementor::getValue ( float * value);
inline void vwIncrementor::getValue ( int * value);

PROTECTED METHOD SUMMARY
virtual void vwIncrementor::doProcessIncrement ( void);
virtual void vwIncrementor::setValue ( float value);
virtual void vwIncrementor::setLabel ( char * label);

INHERITED PUBLIC METHODS

   Inherited from vwWidget
virtual void vwWidget::setActive ( int activeState=True);
virtual void vwWidget::setOver ( int overState=True);
virtual void vwWidget::setVisible ( int visibiltyState=True);
inline int vwWidget::getActive ( void);
inline int vwWidget::getOver ( void);

inline int vwWidget::getPressed (

void);
inline int vwWidget::getVisible ( void);
inline int vwWidget::getDragged ( void);
inline int vwWidget::getIdent ( void);
inline int vwWidget::getInterface ( void);
void vwWidget::getColor ( wColor colorIndex, float rgba[]);
inline void vwWidget::setColor ( wColor colorIndex=ACTIVE);
void vwWidget::registerColor ( wColor colorIndex, float *rgba);
inline int vwWidget::isOfType ( wType wdg_type);
inline pfSCS * vwWidget::getSCS ( void);
inline pfDCS * vwWidget::getDCS ( void);
inline void vwWidget::getParentMtx ( pfMatrix * m);

   Inherited from vwSubject
virtual void vwSubject::attach ( vwObserver *concreteObserver);
virtual void vwSubject::detach ( vwObserver *concreteObserver);
inline void vwSubject::setSubectData ( void * data);
inline void * vwSubject::getSubjectData ( void);
inline unsigned long vwSubject::getID ( void);

INHERITED PROTECTED METHODS

   Inherited from vwWidget
virtual void vwWidget::doSetColor ( wColor colorIndex);
virtual void vwWidget::setWType ( wType widgetType);

   Inherited from vwLabel
void vwLabel::setLabelColor ( float * rgba);
void vwLabel::setLabelText ( vwWidget::wdgStruct *widget_struct, pfFont *font);
void vwLabel::addToLabel ( char *word, int column, int row);
void vwLabel::initLabelParms ( pfFont * font, int total_words=1, int total_rows=1);
inline void vwLabel::setLabelSize ( float size=1.0);
inline void vwLabel::setLabelVSpc ( float verticalSpacing=1.0);
inline void vwLabel::setLabelHeight ( float hight=0.0);
inline void vwLabel::setSpacingScale ( float horiz=1.0, float vert=1.0, float depth=1.0);
inline void vwLabel::setFlatten ( int flatten=True);
inline void vwLabel::clearLabel ( void);

   Inherited from vwSubject
virtual void vwSubject::notify ( void);

CLASS DESCRIPTION
vwIncrementor is the generic incrimentor class publicly derived from vwWidget and protectedly derived from vwLabel.  It displays a value and changes its internal and displayed value when incriment() or decrement() are called. Its value is changed by plus or minus increment (the value of increment is set in setDataParms()). increment() and decrement() notify() any attached concrete observers after a call to doProcessIncrement(). The first call to a vwIncrementor should be setDataParms(), followed by initValue(). A vwIncrementor can be initialized to be either a float incrementor or an int incrementor. An intuitive implementation of the vwIncrementor in a CAVE application, checks first that getOver() is True and then increments upon a right wand button click and decrements upon a left wand button click.

METHOD DESCRIPTIONS

   vwIncrementor()
vwIncrementor ( vwMediator *concreteMediator, pfSCS *scs, pfFont *font);

Construct an incrimentor.

*concreteMediator specifies a pointer to the concrete mediator of the interface being created.

*scs specifies a pointer to a Performer pfSCS containing the button geometry.

*font specifies a pointer to the pfFont used by the interface.

   ~vwIncrementor()
virtual ~vwIncrementor ( void);

Destruct an instance.

   setDataParms()
virtual void setDataParms ( float dataMin, float dataMax, float increment);

Overloaded method. Initialize a vwIncrementor to type float. This should be the first call after the incrementor has been created. This method should be called once. It will determine, by default, that the void data pointer received by vwObserver::update() points to the floating point value of the incrementor. Passing an identical value for dataMin and dataMax will disable boundary checking.

dataMin specifies the minimum data value in the incrementor's range.

dataMax specifies the maximum data value in the incrementor's range.

increment specifies the the amount that is added when the increment() is called, or the amount that is subtracted when decrement() is called.

   setDataParms()
virtual void setDataParms ( int dataMin, int dataMax, int increment);

Overloaded method. Initialize a vwIncrementor to type int. This should be the first call after the incrementor has been created. And should be called only once. This method will determine, by default, that the void data pointer received by vwObserver::update() points to the integer value of the incrementor. Passing the same value for dataMin and dataMax will disable boundary checking.

dataMin specifies the minimum data value in the incrementor's range.

dataMax specifies the maximum data value in the incrementor's range.

increment specifies the the amount that is added when the increment() is called, or the amount that is subtracted when decrement() is called.

   initValue()
virtual void initValue ( char * label, float value);

Overloaded function that sets the incrementor's description text and initial value. vwIncrementor's value should be initially set to float if the incrementor was initialized as a floating point incrementor. This method does not generate an event. It must be called before using the incrementor, since it creates the pfText label. It may be called more than once. The increminator's value will be clamped to the boundaries of the datarange if boundary checking was not disabled.

*label specifies a pointer to a string that will be used to identify the type of data being displayed.

value specifies the initial floating point value that will be displayed and maintained internally by the vwIncrementor.

   initValue()
virtual void initValue ( char * label, int value);

Overloaded function that sets the incrementor's description text and initial value. vwIncrementor's value should be initially set to int if the incrementor was initialized as a floating point incrementor. This method does not generate an event. It must be called before using the incrementor, since it creates the pfText label. It may be called more than once. The incrementor's value will be clamped to the boundaries of the datarange if boundary checking was not disabled.

*label specifies a pointer to a string that will be used to identify the type of data being displayed.

value specifies the initial integer value that will be displayed and maintained internally by the vwIncrementor.

   increment()
void increment ( void);

Adds the increment value specified in setDataParms() to the vwIncrementor's label and internal value. Calls the hook function doProcessIncrement() and then calls notify(), generating an update() in any concrete vwObservers attached to it.

   decrement()
void decrement ( void);

Subtracts the increment value specified in setDataParms() from the vwIncrementor's label and internal value. Calls the hook function doProcessIncrement() and then calls notify(), generating an update() in any concrete vwObservers attached to it.

   setLabelColor()
inline void setLabelColor ( float *rgba);

Set the label color.

*rgba specifies a pointer to a 4 component float color.

   setLabelSize()
inline void setLabelSize ( float size=1.0);

Set the label scalefactor.

size specifies a float scalefactor. Default value is 1.0.

   setLabelVSpc()
inline void setLabelVSpc ( float verticalSpacing=1.0);

Set the label vertical spacing factor.

verticalSpacing specifies a float vertical spacing factor. Default value is 1.0.

   setLabelHeight
inline void setLabelHeight ( float height=0.0);

Set the labels height displacement.

height specifies a float displacement factor. Default value is 0.0.

   setSpacingScale()
inline void setSpacingScale ( float horiz=1.0, float vert=1.0, float depth=1.0);

Set the label's pfString spaceingScale.

horiz specifies a float horizontal scalefactor. Default value is 1.0.

vert specifies a float vertical scalefactor. Default value is 1.0.

depth specifies a float depth scalefactor. Default value is 1.0.

   isGeneric()
inline int isGeneric ( void);

Returns True if this is a generic vwIncrementor, Should return False (0) by any subclass of vwIncrementor.

getIncDataType()
inline iType getIncDataType ( void);

Get the incrementor's datatype. Returns an enum defined in vwIncrementor.h. The return iType can be one of the following: vwIncrementor::INTEGER, vwIncrementor::FLOAT or vwIncrementor::PRE_INITIALIZED.

  getDataMin()
inline void getDataMin ( float * dataMin);

Overloaded function for retrieving floating point minimum data value.

*dataMin specifies a pointer to a float who's addressed value will be updated with the minimum data value of the vwIncrementor.

   getDataMin()
inline void getDataMin ( int * dataMin);

Overloaded function for retrieving integer minimum data value.

*dataMin specifies a pointer to an int who's addressed value will be updated with the minimum data value of the vwIncrementor.

  getDataMax()
inline void getDataMax ( float * dataMax);

Overloaded function for retrieving floating point maximum data value.

*dataMax specifies a pointer to a float who's addressed value will be updated with the maximum data value of the vwIncrementor.

  getDataMax()
inline void getDataMax ( int * dataMax);

Overloaded function for retrieving integer maximum data value.

*dataMax specifies a pointer to an integer who's addressed value will be updated with the maximum data value of the vwIncrementor.

  getValue()
inline void getValue ( float * value);

Overloaded function for retrieving the current floating point value of the vwIncrementor.

*value specifies a pointer to a float who's addressed value will be updated with the incrementor's current value.

  getValue()
inline void getValue ( int * value);

Overloaded function for retrieving the current integer value of the vwIncrementor.

*value specifies a pointer to an integer who's addressed value will be updated with the incrementor's current value.

  doProcessIncrement() [Protected]
virtual void doProcessIncrement ( void);

Hook operation into increment() and decrement(). Gets called before notify(). Does nothing in generic vwIncrementor.

  setValue() [Protected]
virtual void setValue ( float value);

Modifies the incrementor's label with the an updated value.

value specifies the new value that should be displayed in the label.

   setLabel() [Protected]
virtual void setLabel ( char * label);

Called by initValue(). Initializes the vwIncrementor's label.

*label specifies a pointer to a string that will be the description for the incrementor's label.

   doGetFunction() [Protected]
virtual int doGetFunction ( void);

A hook operation meant to be overridden by subclasses of vwIncrementor. doGetFunction() is called from within getFunction(). It returns -1 in the case of the base vwIncrementor class. It is intended to return the integer value of an enum in subclasses.

SEE ALSO
vwWidget, vwLabel

vrmedlab.jpg (7272 bytes)