TemplateProperty< T > Class Template Reference

Stores a parameter value and additional information regarding the parameter. More...

#include <templateproperty.h>

Inheritance diagram for TemplateProperty< T >:
Property AbstractSerializable Serializable NumericProperty< T >

List of all members.

Public Member Functions

 TemplateProperty (const std::string &id, const std::string &guiText, T value, Processor::InvalidationLevel=Processor::INVALID_RESULT)
 TemplateProperty (const TemplateProperty *)
void set (const T &value)
const T & get () const
virtual void invalidate ()
 Notifies the property that its stored value has changed.
void onValueEqual (const T &value, const Action &action=NoAction(), const Action &elseaction=NoAction())
void onValueLess (const T &value, const Action &action=NoAction(), const Action &elseaction=NoAction())
void onValueLessEqual (const T &value, const Action &action=NoAction(), const Action &elseaction=NoAction())
void onValueGreater (const T &value, const Action &action=NoAction(), const Action &elseaction=NoAction())
void onValueGreaterEqual (const T &value, const Action &action=NoAction(), const Action &elseaction=NoAction())
void onValueIn (const std::set< T > &values, const Action &action=NoAction(), const Action &elseaction=NoAction())
void onChange (const Action &action=NoAction())
void addCondition (const Condition &condition)
TemplateProperty< T > & verifiesValueEqual (const T &value)
TemplateProperty< T > & verifiesValueLess (const T &value)
TemplateProperty< T > & verifiesValueLessEqual (const T &value)
TemplateProperty< T > & verifiesValueGreater (const T &value)
TemplateProperty< T > & verifiesValueGreaterEqual (const T &value)
TemplateProperty< T > & verifiesValueIn (const std::set< T > &values)
ConditionaddValidation (const Condition &condition)
TemplateProperty< T > & verifies (const Condition &condition)
bool isValidValue (const T &value)
 Returns whether the given value would be valid for this property.

Protected Member Functions

void validate (const T &value, bool restore=true)
 Runs validate() on all Validations.
virtual void executeLinks (const T &prevValue, const T &curValue)
 Executes the links currently registered at the property with the previous and current values.

Protected Attributes

value_
std::vector< Condition * > conditions_
std::vector< Condition * > validations_

Detailed Description

template<class T>
class voreen::TemplateProperty< T >

Stores a parameter value and additional information regarding the parameter.

If shader recompiling is needed when the parameter changed, pass a pointer to the appropriate shader variable. If the parameter should not be changeable, the isChangeable to false.

Definition at line 43 of file templateproperty.h.


Member Function Documentation

bool isValidValue ( const T &  value  )  [inline]

Returns whether the given value would be valid for this property.

The property is not modified.

Definition at line 251 of file templateproperty.h.

void validate ( const T &  value,
bool  restore = true 
) [inline, protected]

Runs validate() on all Validations.

If any of them is not met() a Condition::ValidationFailed exception is thrown.

Definition at line 197 of file templateproperty.h.