#include <Parameter.h>
Public Types |
|
enum |
Type { kString, kDouble, kDouble2, kDouble3, kDouble4, kAffineMatrix, kProjMatrix, kFile, kUnknown } |
enum | Property { kIsModified, kIsNotSaved, kIsDisabled } |
Public Member Functions |
|
Parameter () | |
virtual ParameterRef | clone () const =0 |
template<class T > | |
aw::Reference< T > | as () |
template<class T > | |
aw::Reference< const T > | as () const |
virtual Parameter::Type | getType () const =0 |
virtual const awString::IString & | getName () const =0 |
virtual double | getValueAsDouble (int index, bool &ok) const =0 |
Return the value at the given index as a
double if: 1) the given index is valid for the
Parameter::Type. |
|
double | getValueAsDoubleWithDefault (int index, double defaultValue) const |
Same as getValueAsDoubleWithDefault( index,
ok ), but returns the defaultValue if retrival was not ok. |
|
virtual bool | setValueAsDouble (int index, double value)=0 |
Sets the specified double inside the
ValueParameter's value. |
|
virtual bool | operator== (const Parameter ¶meter) const =0 |
bool | operator!= (const Parameter ¶meter) const |
virtual bool | getValueAsAffineMatrix (awLinear::AffineMatrix &) const =0 |
A few convenience methods for setting all
values when dealing with the affine matrix case. |
|
virtual bool | setValueAsAffineMatrix (const awLinear::AffineMatrix &)=0 |
virtual bool | getValueAsProjMatrix (awLinear::ProjMatrix &) const =0 |
virtual bool | setValueAsProjMatrix (const awLinear::ProjMatrix &)=0 |
virtual bool | checkConnectAssetValid ()=0 |
const awString::IString & | getValueAsString () const |
virtual bool | setValueAsString (const awString::IString &value)=0 |
Static Public Member Functions |
|
static const awString::IString | getTypeAsString (const Parameter::Type &type) |
static const Parameter::Type | getTypeFromString (const awString::IString &stringType) |
static void | parseFilenames (const awString::IString &stringToParse, awString::IString &filename1, awString::IString &filename2) |
Parses the given string delimited by this
separator into its two parts. |
|
Protected Member Functions |
|
Parameter (const Parameter &src) | |
virtual | ~Parameter () |
virtual void | recomputeValueAsString () const =0 |
Protected Attributes |
|
awString::IString | myValueAsString |
bool | myValueAsStringValid |
enum Type |
{ kString, kDouble, kDouble2, kDouble3, kDouble4, kAffineMatrix, kProjMatrix, kFile, // Underlying representation is a string kUnknown };
enum Property |
{ kIsModified, kIsNotSaved, kIsDisabled };
Parameter | ( | ) |
virtual ~Parameter | ( | ) | [protected, virtual] |
virtual ParameterRef clone | ( | ) | const [pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
aw::Reference< T > as | ( | ) |
{ return dynamic_cast<T *>( this ); }
aw::Reference< const T > as | ( | ) | const |
{ return dynamic_cast<const T *>( this ); }
virtual Parameter::Type getType | ( | ) | const [pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
static const awString::IString getTypeAsString | ( | const Parameter::Type & | type | ) | [static] |
static const Parameter::Type getTypeFromString | ( | const awString::IString & | stringType | ) | [static] |
virtual const awString::IString& getName | ( | ) | const [pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
const awString::IString& getValueAsString | ( | ) | const |
Access the parameter's value. It does not matter whether the Parameter is of type string or not -- you can always read/write it's string representation through getValueAsString and setValueAsString.
virtual bool setValueAsString | ( | const awString::IString & | value | ) | [pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
virtual double getValueAsDouble | ( | int | index, |
bool & | ok | ||
) | const [pure virtual] |
Return the value at the given index as a double if: 1) the given index is valid for the Parameter::Type.
and 2) the value at the given index is valid. Otherwise, return 0 and set the boolean to false.
Implemented in ProteinParameter, and ValueParameter.
double getValueAsDoubleWithDefault | ( | int | index, |
double | defaultValue | ||
) | const |
Same as getValueAsDoubleWithDefault( index, ok ), but returns the defaultValue if retrival was not ok.
virtual bool setValueAsDouble | ( | int | index, |
double | value | ||
) | [pure virtual] |
Sets the specified double inside the ValueParameter's value.
Note that this will affect the result of getValueAsString Returns false if the parameter is not of the right type or if it's not mutable and the parameter will remain unmodified.
Implemented in ProteinParameter, and ValueParameter.
virtual bool operator== | ( | const Parameter & | parameter | ) | const [pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
bool operator!= | ( | const Parameter & | parameter | ) | const |
virtual bool getValueAsAffineMatrix | ( | awLinear::AffineMatrix & | ) | const [pure virtual] |
A few convenience methods for setting all values when dealing with the affine matrix case.
Implemented in ProteinParameter, and ValueParameter.
virtual bool setValueAsAffineMatrix | ( | const awLinear::AffineMatrix & | ) | [pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
virtual bool getValueAsProjMatrix | ( | awLinear::ProjMatrix & | ) | const [pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
virtual bool setValueAsProjMatrix | ( | const awLinear::ProjMatrix & | ) | [pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
static void parseFilenames | ( | const awString::IString & | stringToParse, |
awString::IString & | filename1, | ||
awString::IString & | filename2 | ||
) | [static] |
Parses the given string delimited by this separator into its two parts.
virtual bool checkConnectAssetValid | ( | ) | [pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
virtual void recomputeValueAsString | ( | ) | const [protected, pure virtual] |
Implemented in ProteinParameter, and ValueParameter.
awString::IString
myValueAsString [mutable, protected] |
bool
myValueAsStringValid [mutable, protected] |