TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/attribute/ParamDouble2D.cpp
Go to the documentation of this file.
00001 #include "ParamDouble2D.hpp"
00002 
00003 #include <tuttle/host/INode.hpp>
00004 
00005 namespace tuttle {
00006 namespace host {
00007 namespace attribute {
00008 
00009 ParamDouble2D::ParamDouble2D( INode&                           effect,
00010                               const std::string&                         name,
00011                               const ofx::attribute::OfxhParamDescriptor& descriptor )
00012         : Param( effect )
00013         , ParamDoubleMultiDim<2>( descriptor, name, effect.getParamSet() )
00014 {
00015         _controls.replace<0>( new ParamDouble( effect, name + ".x", descriptor, 0 ) );
00016         _controls.replace<1>( new ParamDouble( effect, name + ".y", descriptor, 1 ) );
00017 }
00018 
00019 OfxPointD ParamDouble2D::getDefault() const
00020 {
00021         OfxPointD point;
00022 
00023         point.x = _controls.at<0>().getDefault();
00024         point.y = _controls.at<1>().getDefault();
00025         return point;
00026 }
00027 
00028 void ParamDouble2D::getValue( double& x, double& y ) const OFX_EXCEPTION_SPEC
00029 {
00030         _controls.at<0>().getValue( x );
00031         _controls.at<1>().getValue( y );
00032 }
00033 
00034 void ParamDouble2D::getValueAtTime( const OfxTime time, double& x, double& y ) const OFX_EXCEPTION_SPEC
00035 {
00036         _controls.at<0>().getValueAtTime( time, x );
00037         _controls.at<1>().getValueAtTime( time, y );
00038 }
00039 
00040 void ParamDouble2D::setValue( const double& x, const double& y, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC
00041 {
00042         _controls.at<0>().setValue( x, change );
00043         _controls.at<1>().setValue( y, change );
00044         this->paramChanged( change );
00045 }
00046 
00047 void ParamDouble2D::setValueAtTime( const OfxTime time, const double& x, const double& y, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC
00048 {
00049         _controls.at<0>().setValueAtTime( time, x, change );
00050         _controls.at<1>().setValueAtTime( time, y, change );
00051         this->paramChanged( change );
00052 }
00053 
00054 }
00055 }
00056 }
00057