TuttleOFX
1
|
00001 #include "ParamInteger3D.hpp" 00002 00003 #include <tuttle/host/INode.hpp> 00004 00005 namespace tuttle { 00006 namespace host { 00007 namespace attribute { 00008 00009 ParamInteger3D::ParamInteger3D( INode& effect, 00010 const std::string& name, 00011 const ofx::attribute::OfxhParamDescriptor& descriptor ) 00012 : Param( effect ) 00013 , ofx::attribute::OfxhMultiDimParam<ParamInteger, 3>( 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 _controls.replace<2>( new ParamInteger( effect, name + ".z", descriptor, 2 ) ); 00018 } 00019 00020 Ofx3DPointI ParamInteger3D::getDefault() const 00021 { 00022 Ofx3DPointI point; 00023 00024 point.x = _controls.at<0>().getDefault(); 00025 point.y = _controls.at<1>().getDefault(); 00026 point.z = _controls.at<2>().getDefault(); 00027 return point; 00028 } 00029 00030 void ParamInteger3D::getValue( int& x, int& y, int& z ) const OFX_EXCEPTION_SPEC 00031 { 00032 _controls.at<0>().getValue( x ); 00033 _controls.at<1>().getValue( y ); 00034 _controls.at<2>().getValue( z ); 00035 } 00036 00037 void ParamInteger3D::getValueAtTime( const OfxTime time, int& x, int& y, int& z ) const OFX_EXCEPTION_SPEC 00038 { 00039 _controls.at<0>().getValueAtTime( time, x ); 00040 _controls.at<1>().getValueAtTime( time, y ); 00041 _controls.at<2>().getValueAtTime( time, z ); 00042 } 00043 00044 void ParamInteger3D::setValue( const int& x, const int& y, const int& z, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00045 { 00046 _controls.at<0>().setValue( x, change ); 00047 _controls.at<1>().setValue( y, change ); 00048 _controls.at<2>().setValue( z, change ); 00049 this->paramChanged( change ); 00050 } 00051 00052 void ParamInteger3D::setValueAtTime( const OfxTime time, const int& x, const int& y, const int& z, const ofx::attribute::EChange change ) OFX_EXCEPTION_SPEC 00053 { 00054 _controls.at<0>().setValueAtTime( time, x, change ); 00055 _controls.at<1>().setValueAtTime( time, y, change ); 00056 _controls.at<2>().setValueAtTime( time, z, change ); 00057 this->paramChanged( change ); 00058 } 00059 00060 } 00061 } 00062 } 00063