CSLDoubleProxy Class Reference

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

#include <SL_Double.h>

Inheritance diagram for CSLDoubleProxy:

CSLAnimatableType List of all members.

Public Member Functions

  CSLDoubleProxy (CdotXSITemplate *in_pTemplate, SI_Int in_nIndex, SI_Double in_dThreshold=SI_EPSILON)
CSLDoubleProxy operator= (const CSLDoubleProxy &in_Value)
CSLDoubleProxy operator= (const SI_Double &in_Value)
SI_Bool  operator== (const CSLDoubleProxy &in_ToCompare)
SI_Bool  operator== (const SI_Double &in_ToCompare)
  operator SI_Double ()
  Conversion operator.
SI_Double  Threshold ()
void  SetThreshold (SI_Double in_dThreshold)
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 double parameter in a template.


Constructor & Destructor Documentation

CSLDoubleProxy ( CdotXSITemplate in_pTemplate,
SI_Int  in_nIndex,
SI_Double  in_dThreshold = SI_EPSILON  
)

Constructor. Connects to a double parameter in the template

Parameters:
in_pTemplate  Pointer to the template
in_Index  Index of the parameter in the template
in_dThreshold  Tolerance value used to determine equality between two doubles.
See also:
CSLDoubleProxy::Threshold

CSLDoubleProxy::SetThreshold


Member Function Documentation

CSLDoubleProxy& operator= ( const CSLDoubleProxy 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.

CSLDoubleProxy& operator= ( const SI_Double &  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 CSLDoubleProxy 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:
CSLDoubleProxy::SetThreshold

CSLDoubleProxy::Threshold

SI_Bool operator== ( const SI_Double &  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:
CSLDoubleProxy::SetThreshold

CSLDoubleProxy::Threshold

SI_Double Threshold (  ) 

Returns the threshold value

Returns:
Tolerance value used to determine equality between two doubles.
See also:
CSLDoubleProxy::SetThreshold

void SetThreshold ( SI_Double  in_dThreshold  ) 

Sets the thresold value

Parameters:
in_dThreshold  Tolerance value used to determine equality between two doubles. Example
        // no threshold, the values must be absolutely equal
        CSLDoubleProxy l_dProxy( in_pTemplate, in_paramIdx, 0.0 );
        l_dProxy = 0.00501;

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

        // use a tolerance of 0.0001
        l_dProxy.SetThreshold( 0.0001 ); 

        if ( l_dProxy == 0.005 )
        {
            // 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_DOUBLE_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: