TuttleOFX
1
|
00001 #include "ParamDouble3D.hpp" 00002 00003 #include <tuttle/host/INode.hpp> 00004 00005 namespace tuttle { 00006 namespace host { 00007 namespace attribute { 00008 00009 ParamDouble3D::ParamDouble3D( INode& effect, 00010 const std::string& name, 00011 const ofx::attribute::OfxhParamDescriptor& descriptor ) 00012 : Param( effect ) 00013 , ParamDoubleMultiDim<3>( 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 _controls.replace<2>( new ParamDouble( effect, name + ".z", descriptor, 2 ) ); 00018 } 00019 00020 Ofx3DPointD ParamDouble3D::getDefault() const 00021 { 00022 Ofx3DPointD 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 ParamDouble3D::getValue( double& x, double& y, double& 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 ParamDouble3D::getValueAtTime( const OfxTime time, double& x, double& y, double& 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 ParamDouble3D::setValue( const double& x, const double& y, const double& 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 ParamDouble3D::setValueAtTime( const OfxTime time, const double& x, const double& y, const double& 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