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_POLYSPHPROJ_H__
11
#define __MayaDM_POLYSPHPROJ_H__
12
#include "MayaDMTypes.h"
13
#include "MayaDMConnectables.h"
14
#include "MayaDMPolyModifierWorld.h"
17
class PolySphProj : public PolyModifierWorld
22
PolySphProj():PolyModifierWorld(){}
23
PolySphProj(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
24
:PolyModifierWorld(file, name, parent, "polySphProj", shared, create){}
25
virtual ~PolySphProj(){}
27
void setProjectionCenter(const double3& pc)
29
if(pc == double3(0.0, 0.0, 0.0)) return;
30
fprintf(mFile,"\tsetAttr \".pc\" -type \"double3\" ");
34
void setProjectionCenterX(double pcx)
37
fprintf(mFile,"\tsetAttr \".pc.pcx\" %f;\n", pcx);
39
void setProjectionCenterY(double pcy)
42
fprintf(mFile,"\tsetAttr \".pc.pcy\" %f;\n", pcy);
44
void setProjectionCenterZ(double pcz)
47
fprintf(mFile,"\tsetAttr \".pc.pcz\" %f;\n", pcz);
49
void setImageCenter(const double2& ic)
51
if(ic == double2(0.5, 0.5)) return;
52
fprintf(mFile,"\tsetAttr \".ic\" -type \"double2\" ");
56
void setImageCenterX(double icx)
58
if(icx == 0.0) return;
59
fprintf(mFile,"\tsetAttr \".ic.icx\" %f;\n", icx);
61
void setImageCenterY(double icy)
63
if(icy == 0.0) return;
64
fprintf(mFile,"\tsetAttr \".ic.icy\" %f;\n", icy);
66
void setRotate(const double3& ro)
68
if(ro == double3(0.0, 0.0, 0.0)) return;
69
fprintf(mFile,"\tsetAttr \".ro\" -type \"double3\" ");
73
void setRotateX(double rx)
76
fprintf(mFile,"\tsetAttr \".ro.rx\" %f;\n", rx);
78
void setRotateY(double ry)
81
fprintf(mFile,"\tsetAttr \".ro.ry\" %f;\n", ry);
83
void setRotateZ(double rz)
86
fprintf(mFile,"\tsetAttr \".ro.rz\" %f;\n", rz);
88
void setProjectionScale(const double2& ps)
90
if(ps == double2(180.0, 90.0)) return;
91
fprintf(mFile,"\tsetAttr \".ps\" -type \"double2\" ");
95
void setProjectionHorizontalSweep(double phs)
98
fprintf(mFile,"\tsetAttr \".ps.phs\" %f;\n", phs);
100
void setProjectionVerticalSweep(double pvs)
103
fprintf(mFile,"\tsetAttr \".ps.pvs\" %f;\n", pvs);
105
void setUvSetName(const string& uvs)
107
if(uvs == "NULL") return;
108
fprintf(mFile,"\tsetAttr \".uvs\" -type \"string\" ");
110
fprintf(mFile,";\n");
112
void setImageScale(const double2& is)
114
if(is == double2(1.0, 1.0)) return;
115
fprintf(mFile,"\tsetAttr \".is\" -type \"double2\" ");
117
fprintf(mFile,";\n");
119
void setImageScaleU(double isu)
121
if(isu == 0.0) return;
122
fprintf(mFile,"\tsetAttr \".is.isu\" %f;\n", isu);
124
void setImageScaleV(double isv)
126
if(isv == 0.0) return;
127
fprintf(mFile,"\tsetAttr \".is.isv\" %f;\n", isv);
129
void setRadius(double r)
132
fprintf(mFile,"\tsetAttr \".r\" %f;\n", r);
134
void setRotationAngle(double ra)
137
fprintf(mFile,"\tsetAttr \".ra\" %f;\n", ra);
139
void setSeamCorrect(bool sc)
141
if(sc == false) return;
142
fprintf(mFile,"\tsetAttr \".sc\" %i;\n", sc);
144
void setUseOldPolyProjection(bool uopp)
146
if(uopp == false) return;
147
fprintf(mFile,"\tsetAttr \".uopp\" %i;\n", uopp);
149
void getProjectionCenter()const
151
fprintf(mFile,"\"%s.pc\"",mName.c_str());
153
void getProjectionCenterX()const
155
fprintf(mFile,"\"%s.pc.pcx\"",mName.c_str());
157
void getProjectionCenterY()const
159
fprintf(mFile,"\"%s.pc.pcy\"",mName.c_str());
161
void getProjectionCenterZ()const
163
fprintf(mFile,"\"%s.pc.pcz\"",mName.c_str());
165
void getImageCenter()const
167
fprintf(mFile,"\"%s.ic\"",mName.c_str());
169
void getImageCenterX()const
171
fprintf(mFile,"\"%s.ic.icx\"",mName.c_str());
173
void getImageCenterY()const
175
fprintf(mFile,"\"%s.ic.icy\"",mName.c_str());
177
void getRotate()const
179
fprintf(mFile,"\"%s.ro\"",mName.c_str());
181
void getRotateX()const
183
fprintf(mFile,"\"%s.ro.rx\"",mName.c_str());
185
void getRotateY()const
187
fprintf(mFile,"\"%s.ro.ry\"",mName.c_str());
189
void getRotateZ()const
191
fprintf(mFile,"\"%s.ro.rz\"",mName.c_str());
193
void getProjectionScale()const
195
fprintf(mFile,"\"%s.ps\"",mName.c_str());
197
void getProjectionHorizontalSweep()const
199
fprintf(mFile,"\"%s.ps.phs\"",mName.c_str());
201
void getProjectionVerticalSweep()const
203
fprintf(mFile,"\"%s.ps.pvs\"",mName.c_str());
205
void getUvSetName()const
207
fprintf(mFile,"\"%s.uvs\"",mName.c_str());
209
void getImageScale()const
211
fprintf(mFile,"\"%s.is\"",mName.c_str());
213
void getImageScaleU()const
215
fprintf(mFile,"\"%s.is.isu\"",mName.c_str());
217
void getImageScaleV()const
219
fprintf(mFile,"\"%s.is.isv\"",mName.c_str());
221
void getRadius()const
223
fprintf(mFile,"\"%s.r\"",mName.c_str());
225
void getRotationAngle()const
227
fprintf(mFile,"\"%s.ra\"",mName.c_str());
229
void getSeamCorrect()const
231
fprintf(mFile,"\"%s.sc\"",mName.c_str());
233
void getCompId()const
235
fprintf(mFile,"\"%s.cid\"",mName.c_str());
238
PolySphProj(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
239
:PolyModifierWorld(file, name, parent, nodeType, shared, create) {}
243
#endif//__MayaDM_POLYSPHPROJ_H__