NumberParameter Class Reference

Class representing parameters for numeric values. More...

#include <NumberParameter.h>

Inheritance diagram for NumberParameter:

Inheritance graph
[legend]
Collaboration diagram for NumberParameter:

Collaboration graph
[legend]

List of all members.

Public Types

enum  InputMethod { IM_SpinBox = 0, IM_Slider, IM_SliderPlusSpinBox, IM_NumInputMethods }
 Nested enumeration for the different input methods for editing number parameters. More...

Public Member Functions

 NumberParameter (const QString &name, Type type, const QVariant &value)
 Constructor of the NumberParameter class.
 NumberParameter (const NumberParameter &parameter, Node *node=0)
 Copy constructor of the NumberParameter class.
virtual ~NumberParameter ()
 Destructor of the FilenameParameter class.
virtual AbstractParameterclone ()
 Creates an exact copy of the parameter.
virtual void setDirty (bool dirty)
 Sets whether the parameter's value has changed.
void setEnabled (bool enabled)
 Sets whether the controls for editing the parameter or parameter group in the UI should be enabled.
InputMethod getInputMethod () const
 Returns the desired input method of numeric values of the parameter.
void setInputMethod (InputMethod inputMethod)
 Sets the desired input method of numeric values of the parameter.
QVariant getMinValue () const
 Returns the lower limit for numeric values of the parameter.
void setMinValue (QVariant minValue)
 Sets the lower limit for numeric values of the parameter.
QVariant getMaxValue () const
 Returns the upper limit for numeric values of the parameter.
float getAbsMaxValue () const
 Returns the absolute upper limit for numeric values of the parameter.
void setMaxValue (QVariant maxValue)
 Sets the upper limit for numeric values of the parameter.
QVariant getStepSize () const
 Returns the step size numeric values of the parameter.
void setStepSize (const QVariant &stepSize)
 Sets the step size numeric values of the parameter.
QString getUnit () const
 Returns the unit of the parameter.
void setUnit (const QString &unit)
 Sets the unit for the parameter.
void setTime (const QVariant &timeValue)
 Sets the current time for the parameter.
void setAnimated (const bool animated)
 Sets the current animation flag for the parameter.
void calculateExtrema ()
 Calculate the limits for numeric values of the parameter.
void scaleValues (const float &scaleFactor)
 Scales all values from the parameter.
bool isAnimated () const
 Returns whether the parameter contains keys.
void addKey (Key *key)
 Adds the given parameter to the given time in the list of keys.
void addKey (const int time)
 Adds the actuel numberparameter value to the given time in the list of keys.
void addKey (const QVariant &value)
 Adds the given parameter to the back of the list of keys.
void addKey (const float &value)
 Adds the given parameter to the back of the list of keys.
void addKeyPresorted (Key *key)
 Adds the given parameter to the given time in the list of keys, without sorting.
void setKeys (QList< float > *keys)
 Sets the given list in the given steps in the list of keys.
unsigned int numKeys () const
 Returns the number of keys in the list.
bool isEmpty () const
 Returns whether the list of keys is empty.
void removeKey (const float time)
 Removes the key at the given time.
void removeKey (const int index)
 Removes the key at the given index.
void removeKeys (const float minTime, const float maxTime)
 Removes the keys at the given range.
void removeKeys (const int minIndex, const int maxIndex)
 Removes the keys at the given range.
void clearKeys ()
 Removes all keys.
KeygetKey (const float &time)
 Returns the key at the given time.
KeygetKey (const unsigned int index)
 Returns the key at the given index.
QList< Key * > * getKeys ()
 Returns a pointer to the list of keys.
unsigned int getKeysSize () const
 Returns the size of the list of keys.
QVariant getKeyValueInterpol (const QVariant &time)
 Returns the interpolated value of the key at the given time.
QVariant getKeyValuePos (const float time)
 Returns the value of the key at the given time.
QVariant getKeyValueIndex (const unsigned int index) const
 Returns the value of the key at the given index.
QVariant getValue (bool triggerEvaluation=false)
 Returns the parameter's value while optionally triggering the evaluation chain.

Static Public Member Functions

static InputMethod decodeInputMethod (const QString &inputMethodString)
 Decodes the given input method string to an input method value.

Protected Member Functions

QList< Key * >::iterator findIndex (const float &time)
 Returns the sorted index from keylist by evaluating the time value.
QList< Key * >::iterator findIndex (const Key *key)
 Returns the sorted index from keylist by evaluating the time value of the given key.

Static Protected Member Functions

static bool lessThan (const Key *k1, const Key *k2)
 Less than definition Function for comparing unique icon Key *.

Private Attributes

InputMethod m_inputMethod
 The input method for numeric values of the parameter.
QVariant m_minValue
 The lower limit for numeric values of the parameter.
QVariant m_maxValue
 The upper limit for numeric values of the parameter.
QVariant m_stepSize
 The step size for numeric values of the parameter.
QString m_unit
 The parameter's unit (an empty string if no unit has been set).
QList< Key * > m_keys
 The list of keys for animating the parameter's numeric value.


Detailed Description

Class representing parameters for numeric values.

Member Enumeration Documentation

Nested enumeration for the different input methods for editing number parameters.

Enumerator:
IM_SpinBox 
IM_Slider 
IM_SliderPlusSpinBox 
IM_NumInputMethods 


Constructor & Destructor Documentation

NumberParameter::NumberParameter ( const QString &  name,
Type  type,
const QVariant &  value 
)

Constructor of the NumberParameter class.

Constructors and Destructors.

Parameters:
name The name of the parameter.
type The type of the parameter's value(s).
value The parameter's value.
animated The parameter's animation status.
Constructor of the FilenameParameter class.

Parameters:
name The name of the parameter.
type The type of the parameter's value(s).
value The parameter's value.
animated The parameter's animation status.

NumberParameter::NumberParameter ( const NumberParameter parameter,
Node node = 0 
)

Copy constructor of the NumberParameter class.

Parameters:
parameter The parameter to copy.
node The parent node.

NumberParameter::~NumberParameter (  )  [virtual]

Destructor of the FilenameParameter class.


Member Function Documentation

NumberParameter::InputMethod NumberParameter::decodeInputMethod ( const QString &  inputMethodString  )  [static]

Decodes the given input method string to an input method value.

Public Static Functions.

Parameters:
inputMethodString The input method string to decode.
Returns:
An input method corresponding to the given input method string.
Decodes the given input method string to an input method value.

Parameters:
inputMethodString The input method string to decode.
Returns:
An input method corresponding to the given input method string.

AbstractParameter * NumberParameter::clone (  )  [virtual]

Creates an exact copy of the parameter.

Public Functions.

Returns:
An exact copy of the parameter.
Creates an exact copy of the parameter.

Returns:
An exact copy of the parameter.

Reimplemented from Parameter.

void NumberParameter::setDirty ( bool  dirty  )  [virtual]

Sets whether the parameter's value has changed.

Parameters:
dirty The new value for the parameter's dirty flag.

Reimplemented from Parameter.

void NumberParameter::setEnabled ( bool  enabled  )  [virtual]

Sets whether the controls for editing the parameter or parameter group in the UI should be enabled.

Parameters:
enabled The value for the parameter's enabled flag.

Reimplemented from Parameter.

NumberParameter::InputMethod NumberParameter::getInputMethod (  )  const

Returns the desired input method of numeric values of the parameter.

Returns the desired input method of numeric values of the parameter, e.g. Slider, etc.

Returns:
The input method for numeric values of the parameter.

void NumberParameter::setInputMethod ( NumberParameter::InputMethod  inputMethod  ) 

Sets the desired input method of numeric values of the parameter.

Sets the desired input method of numeric values of the parameter, e.g. Slider, etc.

Parameters:
inputMethod The input method for numeric values of the parameter.
stepSize The input method for numeric values of the parameter.

QVariant NumberParameter::getMinValue (  )  const

Returns the lower limit for numeric values of the parameter.

Returns:
The lower limit for numeric values of the parameter.

void NumberParameter::setMinValue ( QVariant  minValue  ) 

Sets the lower limit for numeric values of the parameter.

Parameters:
minValue The lower limit for numeric values of the parameter.

QVariant NumberParameter::getMaxValue (  )  const

Returns the upper limit for numeric values of the parameter.

Returns:
The upper limit for numeric values of the parameter.

float NumberParameter::getAbsMaxValue (  )  const

Returns the absolute upper limit for numeric values of the parameter.

Returns:
The absolute upper limit for numeric values of the parameter.

void NumberParameter::setMaxValue ( QVariant  maxValue  ) 

Sets the upper limit for numeric values of the parameter.

Parameters:
maxValue The upper limit for numeric values of the parameter.

QVariant NumberParameter::getStepSize (  )  const

Returns the step size numeric values of the parameter.

Returns:
The step size for numeric values of the parameter.

void NumberParameter::setStepSize ( const QVariant &  stepSize  ) 

Sets the step size numeric values of the parameter.

Parameters:
stepSize The step size for numeric values of the parameter.

QString NumberParameter::getUnit (  )  const

Returns the unit of the parameter.

Returns:
The unit of the parameter (an empty string if no unit has been set).

The unit of the parameter.

void NumberParameter::setUnit ( const QString &  unit  ) 

Sets the unit for the parameter.

Parameters:
unit The unit for the parameter.

void NumberParameter::setTime ( const QVariant &  timeValue  ) 

Sets the current time for the parameter.

Parameters:
timeValue The current time for the parameter.

void NumberParameter::setAnimated ( const bool  animated  ) 

Sets the current animation flag for the parameter.

Parameters:
animated The new animation flag status.

void NumberParameter::calculateExtrema (  ) 

Calculate the limits for numeric values of the parameter.

void NumberParameter::scaleValues ( const float &  scaleFactor  ) 

Scales all values from the parameter.

Parameters:
The scale factor.

bool NumberParameter::isAnimated (  )  const

Returns whether the parameter contains keys.

Public Animation Functions.

Returns:
True if the parameter contains keys, otherwise False.
Returns whether the parameter contains keys.

Returns:
True if the parameter contains keys, otherwise False.

void NumberParameter::addKey ( Key key  ) 

Adds the given parameter to the given time in the list of keys.

Parameters:
key The key to add to the list.
key The key to add to the list

void NumberParameter::addKey ( const int  time  ) 

Adds the actuel numberparameter value to the given time in the list of keys.

Parameters:
time The time index to add the value to the list.

void NumberParameter::addKey ( const QVariant &  value  ) 

Adds the given parameter to the back of the list of keys.

Parameters:
value The value to add to the list.
value The value to add to the list

void NumberParameter::addKey ( const float &  value  ) 

Adds the given parameter to the back of the list of keys.

Parameters:
value The value to add to the list

void NumberParameter::addKeyPresorted ( Key key  ) 

Adds the given parameter to the given time in the list of keys, without sorting.

Parameters:
key The key to add to the list

void NumberParameter::setKeys ( QList< float > *  keys  ) 

Sets the given list in the given steps in the list of keys.

Sets the given List in the given steps in the list of keys.

Parameters:
keys The value list to add to the key list.
key The value list to add to the key list

unsigned int NumberParameter::numKeys (  )  const

Returns the number of keys in the list.

Returns the number of keys in list.

Returns:
The number of keys in the list.

The number of keys.

bool NumberParameter::isEmpty (  )  const

Returns whether the list of keys is empty.

Check for empty list.

Returns:
True if the list of keys is empty, otherwise False.

True if list is empty.

void NumberParameter::removeKey ( const float  time  ) 

Removes the key at the given time.

Parameters:
time The time of the key to remove.
time The time for the key to remove.

void NumberParameter::removeKey ( const int  index  ) 

Removes the key at the given index.

Parameters:
index The index for the key to remove.

void NumberParameter::removeKeys ( const float  minTime,
const float  maxTime 
)

Removes the keys at the given range.

Parameters:
minTime The start time for the keys to remove.
maxTime The end time for the keys to remove.

void NumberParameter::removeKeys ( const int  minIndex,
const int  maxIndex 
)

Removes the keys at the given range.

Parameters:
minIndex The start time for the keys to remove.
maxIndex The end time for the keys to remove.

void NumberParameter::clearKeys (  ) 

Removes all keys.

Key * NumberParameter::getKey ( const float &  time  ) 

Returns the key at the given time.

Parameters:
time The time to the key.
Returns:
The key at the given time.

Key * NumberParameter::getKey ( const unsigned int  index  ) 

Returns the key at the given index.

Parameters:
index The index to the Key.
Returns:
The key at the given index.

QList< Key * > * NumberParameter::getKeys (  ) 

Returns a pointer to the list of keys.

Returns:
A pointer to the list of keys.

unsigned int NumberParameter::getKeysSize (  )  const

Returns the size of the list of keys.

Returns:
The size of the list of keys.

QVariant NumberParameter::getKeyValueInterpol ( const QVariant &  time  )  [inline]

Returns the interpolated value of the key at the given time.

Parameters:
time The time of the key.
Returns:
The interpolated value of the key at the given time.

QVariant NumberParameter::getKeyValuePos ( const float  time  ) 

Returns the value of the key at the given time.

Parameters:
time The time to the Key.
Returns:
The value at the given time.
Parameters:
time The time of the key.
Returns:
The value at the given time.

QVariant NumberParameter::getKeyValueIndex ( const unsigned int  index  )  const

Returns the value of the key at the given index.

Parameters:
index The index to the Key.
Returns:
The value at the given index.

QVariant NumberParameter::getValue ( bool  triggerEvaluation = false  )  [virtual]

Returns the parameter's value while optionally triggering the evaluation chain.

Parameters:
triggerEvaluation Flag to control whether to trigger the evaluation chain.
Returns:
The parameter's value.
Parameters:
Trigger evaluation.
triggerEvaluation Flag to control whether to trigger the evaluation chain.
Returns:
The parameter's value.

Reimplemented from Parameter.

QList< Key * >::iterator NumberParameter::findIndex ( const float &  pos  )  [inline, protected]

Returns the sorted index from keylist by evaluating the time value.

Protected Functions.

Parameters:
time The time of the Key.
Returns:
A list iterator to the index in list.
Returns the sorted index from keylist by evaluating the time value.

pos The time of the Key.

Returns:
A list iterator to the index in list.

QList< Key * >::iterator NumberParameter::findIndex ( const Key key  )  [inline, protected]

Returns the sorted index from keylist by evaluating the time value of the given key.

Parameters:
key The Key to add.
Returns:
A list iterator to the index in list.
key The Key to add.
Returns:
A list iterator to the index in list.

bool NumberParameter::lessThan ( const Key k1,
const Key k2 
) [inline, static, protected]

Less than definition Function for comparing unique icon Key *.

Protected Helper Functions.

Parameters:
k1 The first key for comparison.
k2 The second key for comparison.
Returns:
A boolean as result from comparison.
Less than definition Function for comparing unique icon Key *

k1 The first key for comparison. k2 The second key for comparison.

Returns:
A boolean as result from comparison.


Member Data Documentation

The input method for numeric values of the parameter.

QVariant NumberParameter::m_minValue [private]

The lower limit for numeric values of the parameter.

QVariant NumberParameter::m_maxValue [private]

The upper limit for numeric values of the parameter.

QVariant NumberParameter::m_stepSize [private]

The step size for numeric values of the parameter.

QString NumberParameter::m_unit [private]

The parameter's unit (an empty string if no unit has been set).

QList<Key *> NumberParameter::m_keys [private]

The list of keys for animating the parameter's numeric value.


The documentation for this class was generated from the following files:

Generated on Wed Feb 24 15:01:01 2010 for Frapper by  doxygen 1.5.9