1 /* 2 Copyright (c) 2008-2009 NetAllied Systems GmbH 3 4 This file is part of MayaDataModel. 5 6 Licensed under the MIT Open Source License, 7 for details please see LICENSE file or the website 8 http://www.opensource.org/licenses/mit-license.php 9 */ 10 #ifndef __MayaDM_UNITTOTIMECONVERSION_H__ 11 #define __MayaDM_UNITTOTIMECONVERSION_H__ 12 #include "MayaDMTypes.h" 13 #include "MayaDMConnectables.h" 14 #include "MayaDMDependNode.h" 15 namespace MayaDM 16 { 17 class UnitToTimeConversion : public DependNode 18 { 19 public: 20 public: 21 UnitToTimeConversion()22 UnitToTimeConversion():DependNode(){} 23 UnitToTimeConversion(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true) 24 :DependNode(file, name, parent, "unitToTimeConversion", shared, create){} ~UnitToTimeConversion()25 virtual ~UnitToTimeConversion(){} 26 setInput(double i_)27 void setInput(double i_) 28 { 29 if(i_ == 0.0) return; 30 fprintf(mFile,"\tsetAttr \".i\" %f;\n", i_); 31 } setConversionFactor(double cf)32 void setConversionFactor(double cf) 33 { 34 if(cf == 1.0) return; 35 fprintf(mFile,"\tsetAttr \".cf\" %f;\n", cf); 36 } getInput()37 void getInput()const 38 { 39 fprintf(mFile,"\"%s.i\"",mName.c_str()); 40 } getOutput()41 void getOutput()const 42 { 43 fprintf(mFile,"\"%s.o\"",mName.c_str()); 44 } 45 protected: 46 UnitToTimeConversion(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true) DependNode(file,name,parent,nodeType,shared,create)47 :DependNode(file, name, parent, nodeType, shared, create) {} 48 49 }; 50 }//namespace MayaDM 51 #endif//__MayaDM_UNITTOTIMECONVERSION_H__ 52