CSLFloatProxy Class Reference

Class that allows modification of a float parameter in a template. More...

#include <SL_Float.h>

Inheritance diagram for CSLFloatProxy:

CSLAnimatableType List of all members.

Public Member Functions

  CSLFloatProxy (CdotXSITemplate *in_pTemplate, SI_Int in_nIndex, SI_Float in_fThreshold=SI_EPSILON)
CSLFloatProxy operator= (const CSLFloatProxy &in_Value)
CSLFloatProxy operator= (const SI_Float &in_Value)
SI_Bool  operator== (const CSLFloatProxy &in_ToCompare)
SI_Bool  operator== (const SI_Float &in_ToCompare)
  operator SI_Float ()
  Conversion operator.
SI_Float  Threshold ()
void  SetThreshold (SI_Float in_fThreshold)
virtual EElementType  Type ()
virtual SI_Float  GetFloatValue ()
virtual SI_Void  SetFloatValue (SI_Float in_fValue)
virtual SI_Error  Connect (CdotXSITemplate *in_pTemplate, SI_Int in_nIndex)

Detailed Description

Class that allows modification of a float parameter in a template.


Constructor & Destructor Documentation

CSLFloatProxy ( CdotXSITemplate in_pTemplate,
SI_Int  in_nIndex,
SI_Float  in_fThreshold = SI_EPSILON  
)

Constructor. Connects to a parameter in the parent template

Parameters:
in_pTemplate  Pointer to the parent template
in_Index  Index of the parameter in the template
in_fThreshold  Tolerance value used to determine equality between two floats.
See also:
CSLFloatProxy::Threshold

CSLFloatProxy::SetThreshold


Member Function Documentation

CSLFloatProxy& operator= ( const CSLFloatProxy in_Value  ) 

Assignment operator. Assigns in_Value to the parameter referred by this proxy.

Parameters:
in_Value  The new value
Returns:
Reference to the current object.

CSLFloatProxy& operator= ( const SI_Float &  in_Value  ) 

Assignment operator. Assigns in_Value to the parameter referred by this proxy.

Parameters:
in_Value  The new value
Returns:
Reference to the current object.

SI_Bool operator== ( const CSLFloatProxy in_ToCompare  ) 

Comparison operator. Compares in_ToCompare with the value of the parameter referred by this proxy.

Parameters:
in_ToCompare  The instance to compare values with
Returns:
Whether or not the referred parameter and in_ToCompare are equal
Note:
Comparison is performed with a threshold value. You can perform exact comparison by setting the Threshold value to zero.
See also:
CSLFloatProxy::Threshold

CSLFloatProxy::SetThreshold

SI_Bool operator== ( const SI_Float &  in_ToCompare  ) 

Comparison operator. Compares in_ToCompare with the value of the parameter referred by this proxy.

Parameters:
in_ToCompare  The instance to compare values with
Returns:
Whether or not the referred parameter and in_ToCompare are equal
Note:
Comparison is performed with a threshold value. You can perform exact comparison by setting the Threshold value to zero.
See also:
CSLFloatProxy::Threshold

CSLFloatProxy::SetThreshold

SI_Float Threshold (  ) 

Returns the threshold value

Returns:
Tolerance value used to determine equality between two floats.
See also:
CSLFloatProxy::SetThreshold

void SetThreshold ( SI_Float  in_fThreshold  ) 

Sets the thresold value

Parameters:
in_fThreshold  Tolerance value used to determine equality between two floats. Example
        // no threshold, the values must be absolutely equal
        CSLFloatProxy l_fProxy( in_pTemplate, in_paramIdx, 0.0 );
        l_fProxy = 0.00501;

        if ( l_fProxy == 0.005F )
        {
            // We get here because abs(0.00501 - 0.005) > 0
        }

        // use a tolerance of 0.0001
        l_fProxy.SetThreshold( 0.0001F ); 

        if ( l_fProxy == 0.005F )
        {
            // We get here because abs(0.00501 - 0.005) <= 0.0001
        }
See also:
CSLDoubleProxy::Threshold

virtual EElementType Type (  )  [virtual]

Returns the animatable type of this class

Returns:
CSLAnimatableType::SI_FLOAT_TYPE

Implements CSLAnimatableType.

virtual SI_Float GetFloatValue (  )  [virtual]

Converts the value of the referred parameter to float

Returns:
The converted value

Implements CSLAnimatableType.

virtual SI_Void SetFloatValue ( SI_Float  in_fValue  )  [virtual]

Sets the value of the referred parameter from a float

Parameters:
in_fValue  The float value used to set the parameter

Implements CSLAnimatableType.

virtual SI_Error Connect ( CdotXSITemplate in_pTemplate,
SI_Int  in_nIndex  
) [virtual]

Connects the proxy to a parameter of a template

Parameters:
in_pTemplate  Parent template
in_nIndex  Index of the parameter in the parent template
Return values:
SI_SUCCESS 

Reimplemented from CSLAnimatableType.


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