ValueParameter Class Reference

#include <ValueParameter.h>

Inheritance diagram for ValueParameter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  ValueParameter (const awString::IString &name, const Parameter::Type type, const awString::IString &valueString)
virtual ParameterRef  clone () const
int  getValueCount () const
  Returns the number of valid values actually read.
virtual Parameter::Type  getType () const
virtual const awString::IString &  getName () const
virtual bool  setValueAsString (const awString::IString &value)
virtual double  getValueAsDouble (int index, bool &) const
  Return the value at the given index as a double if: 1) the given index is valid for the Parameter::Type.
virtual bool  setValueAsDouble (int index, double value)
  Sets the specified double inside the ValueParameter's value.
template<int N>
bool  setValueAsDoubles (const double values[N])
  Sets the given number of doubles using the provided same-sized array.
template<class T , int N>
bool  getDoubleValues (T values[N]) const
virtual bool  operator== (const Parameter &parameter) const
bool  operator== (const ValueParameter &parameter) const
virtual bool  getValueAsAffineMatrix (awLinear::AffineMatrix &) const
  A few convenience methods for setting all values when dealing with the affine matrix case.
virtual bool  setValueAsAffineMatrix (const awLinear::AffineMatrix &)
virtual bool  getValueAsProjMatrix (awLinear::ProjMatrix &) const
virtual bool  setValueAsProjMatrix (const awLinear::ProjMatrix &)
virtual bool  checkConnectAssetValid ()
bool  isMipMapName () const
bool  isColorChannelName () const

Static Public Member Functions

static int  getValueCountForType (const Parameter::Type &type)
  Returns the number of expected values for a given Parameter::Type.

Protected Member Functions

  ValueParameter (const ValueParameter &src)
virtual  ~ValueParameter ()
bool  isDoubleType () const
virtual void  recomputeValueAsString () const
void  setNamingFlags ()

Constructor & Destructor Documentation

ValueParameter ( const awString::IString &  name,
const Parameter::Type  type,
const awString::IString &  valueString 
)
ValueParameter ( const ValueParameter src ) [protected]
virtual ~ValueParameter ( ) [protected, virtual]

Member Function Documentation

virtual ParameterRef clone ( ) const [virtual]
static int getValueCountForType ( const Parameter::Type type ) [static]

Returns the number of expected values for a given Parameter::Type.

int getValueCount ( ) const

Returns the number of valid values actually read.

The number of valid values read will be less than or equal to the value count for the type.

virtual Parameter::Type getType ( ) const [virtual]
virtual const awString::IString& getName ( ) const [virtual]
virtual bool setValueAsString ( const awString::IString &  value ) [virtual]
virtual double getValueAsDouble ( int  index,
bool &  ok 
) const [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.

Implements Parameter.

virtual bool setValueAsDouble ( int  index,
double  value 
) [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.

Implements Parameter.

bool setValueAsDoubles ( const double  values[N] )

Sets the given number of doubles using the provided same-sized array.

Returns true if successful (the number of doubles corresponds with the parameter type); false otherwise.

{
    if( isDoubleType() )
    {
        int valueCount = getValueCountForType( myType );

        if( N < valueCount )
            valueCount = N;

        for( int i = 0; i < valueCount; ++i )
        {
            myDoubleValues[i] = values[i];
        }
        myValueAsStringValid = false;
        return true;
    }
    return false;
}
bool getDoubleValues ( values[N] ) const
{
    int valueCount = myLastValueIndex + 1;

    if( valueCount > N )
        valueCount = N;

    for( int i = 0; i < valueCount; ++i )
    {
        values[i] = (T)myDoubleValues[i];
    }

    for( int i = valueCount; i < N; ++i )
    {
        values[i] = (T)0.0;
    }
    return isDoubleType();
}
virtual bool operator== ( const Parameter parameter ) const [virtual]

Implements Parameter.

bool operator== ( const ValueParameter parameter ) const
virtual bool getValueAsAffineMatrix ( awLinear::AffineMatrix &  ) const [virtual]

A few convenience methods for setting all values when dealing with the affine matrix case.

Implements Parameter.

virtual bool setValueAsAffineMatrix ( const awLinear::AffineMatrix &  ) [virtual]
virtual bool getValueAsProjMatrix ( awLinear::ProjMatrix &  ) const [virtual]
virtual bool setValueAsProjMatrix ( const awLinear::ProjMatrix &  ) [virtual]
virtual bool checkConnectAssetValid ( ) [virtual]
bool isMipMapName ( ) const [inline]
{ return myIsMipMapName; }
bool isColorChannelName ( ) const [inline]
{ return myIsColorChannelName; }
bool isDoubleType ( ) const [protected]
virtual void recomputeValueAsString ( ) const [protected, virtual]
void setNamingFlags ( ) [protected]

ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter
ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter ValueParameter