TuttleOFX
1
|
00001 #include "ParamInteger2D.hpp" 00002 00003 #include <tuttle/host/INode.hpp> 00004 00005 namespace tuttle { 00006 namespace host { 00007 namespace attribute { 00008 00009 ParamInteger2D::ParamInteger2D( INode& effect, 00010 const std::string& name, 00011 const ofx::attribute::OfxhParamDescriptor& descriptor ) 00012 : Param( effect ) 00013 , ofx::attribute::OfxhMultiDimParam<ParamInteger, 2>( descriptor, name, effect.getParamSet() ) 00014 { 00015 _controls.replace<0>( new ParamInteger( effect, name + ".x", descriptor, 0 ) ); 00016 _controls.replace<1>( new ParamInteger( effect, name + ".y", descriptor, 1 ) ); 00017 } 00018 00019 OfxPointI ParamInteger2D::getDefault() const 00020 { 00021 OfxPointI point; 00022 00023 point.x = _controls.at<0>().getDefault(); 00024 point.y = _controls.at<1>().getDefault(); 00025 return point; 00026 } 00027 00028 void ParamInteger2D::getValue( int& x, int& y ) const OFX_EXCEPTION_SPEC 00029 { 00030 _controls.at<0>().getValue( x ); 00031 _controls.at<1>().getValue( y ); 00032 } 00033 00034 void ParamInteger2D::getValueAtTime( const OfxTime time, int& x, int& y ) const OFX_EXCEPTION_SPEC 00035 { 00036 _controls.at<0>().getValueAtTime( time, x ); 00037 _controls.at<1>().getValueAtTime( time, y ); 00038 } 00039 00040 void ParamInteger2D::setValue( const int& x, const int& 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 ParamInteger2D::setValueAtTime( const OfxTime time, const int& x, const int& 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