~ubuntu-branches/ubuntu/wily/opencollada/wily-proposed

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMPolySphProj.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
ImportĀ upstreamĀ versionĀ 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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_POLYSPHPROJ_H__
 
11
#define __MayaDM_POLYSPHPROJ_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMPolyModifierWorld.h"
 
15
namespace MayaDM
 
16
{
 
17
class PolySphProj : public PolyModifierWorld
 
18
{
 
19
public:
 
20
public:
 
21
 
 
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(){}
 
26
 
 
27
        void setProjectionCenter(const double3& pc)
 
28
        {
 
29
                if(pc == double3(0.0, 0.0, 0.0)) return;
 
30
                fprintf(mFile,"\tsetAttr \".pc\" -type \"double3\" ");
 
31
                pc.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setProjectionCenterX(double pcx)
 
35
        {
 
36
                if(pcx == 0) return;
 
37
                fprintf(mFile,"\tsetAttr \".pc.pcx\" %f;\n", pcx);
 
38
        }
 
39
        void setProjectionCenterY(double pcy)
 
40
        {
 
41
                if(pcy == 0) return;
 
42
                fprintf(mFile,"\tsetAttr \".pc.pcy\" %f;\n", pcy);
 
43
        }
 
44
        void setProjectionCenterZ(double pcz)
 
45
        {
 
46
                if(pcz == 0) return;
 
47
                fprintf(mFile,"\tsetAttr \".pc.pcz\" %f;\n", pcz);
 
48
        }
 
49
        void setImageCenter(const double2& ic)
 
50
        {
 
51
                if(ic == double2(0.5, 0.5)) return;
 
52
                fprintf(mFile,"\tsetAttr \".ic\" -type \"double2\" ");
 
53
                ic.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setImageCenterX(double icx)
 
57
        {
 
58
                if(icx == 0.0) return;
 
59
                fprintf(mFile,"\tsetAttr \".ic.icx\" %f;\n", icx);
 
60
        }
 
61
        void setImageCenterY(double icy)
 
62
        {
 
63
                if(icy == 0.0) return;
 
64
                fprintf(mFile,"\tsetAttr \".ic.icy\" %f;\n", icy);
 
65
        }
 
66
        void setRotate(const double3& ro)
 
67
        {
 
68
                if(ro == double3(0.0, 0.0, 0.0)) return;
 
69
                fprintf(mFile,"\tsetAttr \".ro\" -type \"double3\" ");
 
70
                ro.write(mFile);
 
71
                fprintf(mFile,";\n");
 
72
        }
 
73
        void setRotateX(double rx)
 
74
        {
 
75
                if(rx == 0) return;
 
76
                fprintf(mFile,"\tsetAttr \".ro.rx\" %f;\n", rx);
 
77
        }
 
78
        void setRotateY(double ry)
 
79
        {
 
80
                if(ry == 0) return;
 
81
                fprintf(mFile,"\tsetAttr \".ro.ry\" %f;\n", ry);
 
82
        }
 
83
        void setRotateZ(double rz)
 
84
        {
 
85
                if(rz == 0) return;
 
86
                fprintf(mFile,"\tsetAttr \".ro.rz\" %f;\n", rz);
 
87
        }
 
88
        void setProjectionScale(const double2& ps)
 
89
        {
 
90
                if(ps == double2(180.0, 90.0)) return;
 
91
                fprintf(mFile,"\tsetAttr \".ps\" -type \"double2\" ");
 
92
                ps.write(mFile);
 
93
                fprintf(mFile,";\n");
 
94
        }
 
95
        void setProjectionHorizontalSweep(double phs)
 
96
        {
 
97
                if(phs == 0) return;
 
98
                fprintf(mFile,"\tsetAttr \".ps.phs\" %f;\n", phs);
 
99
        }
 
100
        void setProjectionVerticalSweep(double pvs)
 
101
        {
 
102
                if(pvs == 0) return;
 
103
                fprintf(mFile,"\tsetAttr \".ps.pvs\" %f;\n", pvs);
 
104
        }
 
105
        void setUvSetName(const string& uvs)
 
106
        {
 
107
                if(uvs == "NULL") return;
 
108
                fprintf(mFile,"\tsetAttr \".uvs\" -type \"string\" ");
 
109
                uvs.write(mFile);
 
110
                fprintf(mFile,";\n");
 
111
        }
 
112
        void setImageScale(const double2& is)
 
113
        {
 
114
                if(is == double2(1.0, 1.0)) return;
 
115
                fprintf(mFile,"\tsetAttr \".is\" -type \"double2\" ");
 
116
                is.write(mFile);
 
117
                fprintf(mFile,";\n");
 
118
        }
 
119
        void setImageScaleU(double isu)
 
120
        {
 
121
                if(isu == 0.0) return;
 
122
                fprintf(mFile,"\tsetAttr \".is.isu\" %f;\n", isu);
 
123
        }
 
124
        void setImageScaleV(double isv)
 
125
        {
 
126
                if(isv == 0.0) return;
 
127
                fprintf(mFile,"\tsetAttr \".is.isv\" %f;\n", isv);
 
128
        }
 
129
        void setRadius(double r)
 
130
        {
 
131
                if(r == 1) return;
 
132
                fprintf(mFile,"\tsetAttr \".r\" %f;\n", r);
 
133
        }
 
134
        void setRotationAngle(double ra)
 
135
        {
 
136
                if(ra == 0) return;
 
137
                fprintf(mFile,"\tsetAttr \".ra\" %f;\n", ra);
 
138
        }
 
139
        void setSeamCorrect(bool sc)
 
140
        {
 
141
                if(sc == false) return;
 
142
                fprintf(mFile,"\tsetAttr \".sc\" %i;\n", sc);
 
143
        }
 
144
        void setUseOldPolyProjection(bool uopp)
 
145
        {
 
146
                if(uopp == false) return;
 
147
                fprintf(mFile,"\tsetAttr \".uopp\" %i;\n", uopp);
 
148
        }
 
149
        void getProjectionCenter()const
 
150
        {
 
151
                fprintf(mFile,"\"%s.pc\"",mName.c_str());
 
152
        }
 
153
        void getProjectionCenterX()const
 
154
        {
 
155
                fprintf(mFile,"\"%s.pc.pcx\"",mName.c_str());
 
156
        }
 
157
        void getProjectionCenterY()const
 
158
        {
 
159
                fprintf(mFile,"\"%s.pc.pcy\"",mName.c_str());
 
160
        }
 
161
        void getProjectionCenterZ()const
 
162
        {
 
163
                fprintf(mFile,"\"%s.pc.pcz\"",mName.c_str());
 
164
        }
 
165
        void getImageCenter()const
 
166
        {
 
167
                fprintf(mFile,"\"%s.ic\"",mName.c_str());
 
168
        }
 
169
        void getImageCenterX()const
 
170
        {
 
171
                fprintf(mFile,"\"%s.ic.icx\"",mName.c_str());
 
172
        }
 
173
        void getImageCenterY()const
 
174
        {
 
175
                fprintf(mFile,"\"%s.ic.icy\"",mName.c_str());
 
176
        }
 
177
        void getRotate()const
 
178
        {
 
179
                fprintf(mFile,"\"%s.ro\"",mName.c_str());
 
180
        }
 
181
        void getRotateX()const
 
182
        {
 
183
                fprintf(mFile,"\"%s.ro.rx\"",mName.c_str());
 
184
        }
 
185
        void getRotateY()const
 
186
        {
 
187
                fprintf(mFile,"\"%s.ro.ry\"",mName.c_str());
 
188
        }
 
189
        void getRotateZ()const
 
190
        {
 
191
                fprintf(mFile,"\"%s.ro.rz\"",mName.c_str());
 
192
        }
 
193
        void getProjectionScale()const
 
194
        {
 
195
                fprintf(mFile,"\"%s.ps\"",mName.c_str());
 
196
        }
 
197
        void getProjectionHorizontalSweep()const
 
198
        {
 
199
                fprintf(mFile,"\"%s.ps.phs\"",mName.c_str());
 
200
        }
 
201
        void getProjectionVerticalSweep()const
 
202
        {
 
203
                fprintf(mFile,"\"%s.ps.pvs\"",mName.c_str());
 
204
        }
 
205
        void getUvSetName()const
 
206
        {
 
207
                fprintf(mFile,"\"%s.uvs\"",mName.c_str());
 
208
        }
 
209
        void getImageScale()const
 
210
        {
 
211
                fprintf(mFile,"\"%s.is\"",mName.c_str());
 
212
        }
 
213
        void getImageScaleU()const
 
214
        {
 
215
                fprintf(mFile,"\"%s.is.isu\"",mName.c_str());
 
216
        }
 
217
        void getImageScaleV()const
 
218
        {
 
219
                fprintf(mFile,"\"%s.is.isv\"",mName.c_str());
 
220
        }
 
221
        void getRadius()const
 
222
        {
 
223
                fprintf(mFile,"\"%s.r\"",mName.c_str());
 
224
        }
 
225
        void getRotationAngle()const
 
226
        {
 
227
                fprintf(mFile,"\"%s.ra\"",mName.c_str());
 
228
        }
 
229
        void getSeamCorrect()const
 
230
        {
 
231
                fprintf(mFile,"\"%s.sc\"",mName.c_str());
 
232
        }
 
233
        void getCompId()const
 
234
        {
 
235
                fprintf(mFile,"\"%s.cid\"",mName.c_str());
 
236
        }
 
237
protected:
 
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) {}
 
240
 
 
241
};
 
242
}//namespace MayaDM
 
243
#endif//__MayaDM_POLYSPHPROJ_H__