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_NURBSTESSELLATE_H__
11 #define __MayaDM_NURBSTESSELLATE_H__
12 #include "MayaDMTypes.h"
13 #include "MayaDMConnectables.h"
14 #include "MayaDMParentTessellate.h"
15 namespace MayaDM
16 {
17 class NurbsTessellate : public ParentTessellate
18 {
19 public:
20 public:
21 
NurbsTessellate()22 	NurbsTessellate():ParentTessellate(){}
23 	NurbsTessellate(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
24 		:ParentTessellate(file, name, parent, "nurbsTessellate", shared, create){}
~NurbsTessellate()25 	virtual ~NurbsTessellate(){}
26 
setSmoothEdge(bool ues)27 	void setSmoothEdge(bool ues)
28 	{
29 		if(ues == false) return;
30 		fprintf(mFile,"\tsetAttr \".ues\" %i;\n", ues);
31 	}
setSmoothEdgeRatio(double esr)32 	void setSmoothEdgeRatio(double esr)
33 	{
34 		if(esr == 0.99) return;
35 		fprintf(mFile,"\tsetAttr \".esr\" %f;\n", esr);
36 	}
setExplicitTessellationAttributes(bool eta)37 	void setExplicitTessellationAttributes(bool eta)
38 	{
39 		if(eta == true) return;
40 		fprintf(mFile,"\tsetAttr \".eta\" %i;\n", eta);
41 	}
setUDivisionsFactor(double nuf)42 	void setUDivisionsFactor(double nuf)
43 	{
44 		if(nuf == 1.5) return;
45 		fprintf(mFile,"\tsetAttr \".nuf\" %f;\n", nuf);
46 	}
setVDivisionsFactor(double nvf)47 	void setVDivisionsFactor(double nvf)
48 	{
49 		if(nvf == 1.5) return;
50 		fprintf(mFile,"\tsetAttr \".nvf\" %f;\n", nvf);
51 	}
setCurvatureTolerance(unsigned int cvt)52 	void setCurvatureTolerance(unsigned int cvt)
53 	{
54 		if(cvt == 2) return;
55 		fprintf(mFile,"\tsetAttr \".cvt\" %i;\n", cvt);
56 	}
getInputSurface()57 	void getInputSurface()const
58 	{
59 		fprintf(mFile,"\"%s.is\"",mName.c_str());
60 	}
getSmoothEdge()61 	void getSmoothEdge()const
62 	{
63 		fprintf(mFile,"\"%s.ues\"",mName.c_str());
64 	}
getSmoothEdgeRatio()65 	void getSmoothEdgeRatio()const
66 	{
67 		fprintf(mFile,"\"%s.esr\"",mName.c_str());
68 	}
getExplicitTessellationAttributes()69 	void getExplicitTessellationAttributes()const
70 	{
71 		fprintf(mFile,"\"%s.eta\"",mName.c_str());
72 	}
getUDivisionsFactor()73 	void getUDivisionsFactor()const
74 	{
75 		fprintf(mFile,"\"%s.nuf\"",mName.c_str());
76 	}
getVDivisionsFactor()77 	void getVDivisionsFactor()const
78 	{
79 		fprintf(mFile,"\"%s.nvf\"",mName.c_str());
80 	}
getCurvatureTolerance()81 	void getCurvatureTolerance()const
82 	{
83 		fprintf(mFile,"\"%s.cvt\"",mName.c_str());
84 	}
85 protected:
86 	NurbsTessellate(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
ParentTessellate(file,name,parent,nodeType,shared,create)87 		:ParentTessellate(file, name, parent, nodeType, shared, create) {}
88 
89 };
90 }//namespace MayaDM
91 #endif//__MayaDM_NURBSTESSELLATE_H__
92