2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of MayaDataModel.
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
10
#ifndef __MayaDM_POLYMOVEUV_H__
11
#define __MayaDM_POLYMOVEUV_H__
12
#include "MayaDMTypes.h"
13
#include "MayaDMConnectables.h"
14
#include "MayaDMPolyModifier.h"
17
class PolyMoveUV : public PolyModifier
22
PolyMoveUV():PolyModifier(){}
23
PolyMoveUV(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
24
:PolyModifier(file, name, parent, "polyMoveUV", shared, create){}
25
virtual ~PolyMoveUV(){}
27
void setTranslate(const double2& t)
29
if(t == double2(0.0, 0.0)) return;
30
fprintf(mFile,"\tsetAttr \".t\" -type \"double2\" ");
34
void setTranslateU(double tu)
37
fprintf(mFile,"\tsetAttr \".t.tu\" %f;\n", tu);
39
void setTranslateV(double tv)
42
fprintf(mFile,"\tsetAttr \".t.tv\" %f;\n", tv);
44
void setRotationAngle(double ra)
47
fprintf(mFile,"\tsetAttr \".ra\" %f;\n", ra);
49
void setPivot(const double2& pvt)
51
if(pvt == double2(0.5, 0.5)) return;
52
fprintf(mFile,"\tsetAttr \".pvt\" -type \"double2\" ");
56
void setPivotU(double pvu)
58
if(pvu == 0.0) return;
59
fprintf(mFile,"\tsetAttr \".pvt.pvu\" %f;\n", pvu);
61
void setPivotV(double pvv)
63
if(pvv == 0.0) return;
64
fprintf(mFile,"\tsetAttr \".pvt.pvv\" %f;\n", pvv);
66
void setScale(const double2& s)
68
if(s == double2(1.0, 1.0)) return;
69
fprintf(mFile,"\tsetAttr \".s\" -type \"double2\" ");
73
void setScaleU(double su)
76
fprintf(mFile,"\tsetAttr \".s.su\" %f;\n", su);
78
void setScaleV(double sv)
81
fprintf(mFile,"\tsetAttr \".s.sv\" %f;\n", sv);
83
void setRandom(float ran)
85
if(ran == 0.0) return;
86
fprintf(mFile,"\tsetAttr \".ran\" %f;\n", ran);
88
void setRandomSeed(int rs)
91
fprintf(mFile,"\tsetAttr \".rs\" %i;\n", rs);
93
void setAxisLen(const double2& l)
95
if(l == double2(1.0, 1.0)) return;
96
fprintf(mFile,"\tsetAttr \".l\" -type \"double2\" ");
100
void setAxisLenX(double lx)
102
if(lx == 0.0) return;
103
fprintf(mFile,"\tsetAttr \".l.lx\" %f;\n", lx);
105
void setAxisLenY(double ly)
107
if(ly == 0.0) return;
108
fprintf(mFile,"\tsetAttr \".l.ly\" %f;\n", ly);
110
void setUvSetName(const string& uvs)
112
if(uvs == "NULL") return;
113
fprintf(mFile,"\tsetAttr \".uvs\" -type \"string\" ");
115
fprintf(mFile,";\n");
117
void getTranslate()const
119
fprintf(mFile,"\"%s.t\"",mName.c_str());
121
void getTranslateU()const
123
fprintf(mFile,"\"%s.t.tu\"",mName.c_str());
125
void getTranslateV()const
127
fprintf(mFile,"\"%s.t.tv\"",mName.c_str());
129
void getRotationAngle()const
131
fprintf(mFile,"\"%s.ra\"",mName.c_str());
135
fprintf(mFile,"\"%s.pvt\"",mName.c_str());
137
void getPivotU()const
139
fprintf(mFile,"\"%s.pvt.pvu\"",mName.c_str());
141
void getPivotV()const
143
fprintf(mFile,"\"%s.pvt.pvv\"",mName.c_str());
147
fprintf(mFile,"\"%s.s\"",mName.c_str());
149
void getScaleU()const
151
fprintf(mFile,"\"%s.s.su\"",mName.c_str());
153
void getScaleV()const
155
fprintf(mFile,"\"%s.s.sv\"",mName.c_str());
157
void getRandom()const
159
fprintf(mFile,"\"%s.ran\"",mName.c_str());
161
void getRandomSeed()const
163
fprintf(mFile,"\"%s.rs\"",mName.c_str());
165
void getAxisLen()const
167
fprintf(mFile,"\"%s.l\"",mName.c_str());
169
void getAxisLenX()const
171
fprintf(mFile,"\"%s.l.lx\"",mName.c_str());
173
void getAxisLenY()const
175
fprintf(mFile,"\"%s.l.ly\"",mName.c_str());
177
void getCompId()const
179
fprintf(mFile,"\"%s.cid\"",mName.c_str());
181
void getUvSetName()const
183
fprintf(mFile,"\"%s.uvs\"",mName.c_str());
186
PolyMoveUV(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
187
:PolyModifier(file, name, parent, nodeType, shared, create) {}
191
#endif//__MayaDM_POLYMOVEUV_H__