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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMRevolve.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_REVOLVE_H__
 
11
#define __MayaDM_REVOLVE_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMAbstractBaseCreate.h"
 
15
namespace MayaDM
 
16
{
 
17
class Revolve : public AbstractBaseCreate
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        Revolve():AbstractBaseCreate(){}
 
23
        Revolve(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :AbstractBaseCreate(file, name, parent, "revolve", shared, create){}
 
25
        virtual ~Revolve(){}
 
26
 
 
27
        void setStartSweep(double ssw)
 
28
        {
 
29
                if(ssw == 0) return;
 
30
                fprintf(mFile,"\tsetAttr \".ssw\" %f;\n", ssw);
 
31
        }
 
32
        void setEndSweep(double esw)
 
33
        {
 
34
                if(esw == 6.2831853) return;
 
35
                fprintf(mFile,"\tsetAttr \".esw\" %f;\n", esw);
 
36
        }
 
37
        void setUseTolerance(bool ut)
 
38
        {
 
39
                if(ut == false) return;
 
40
                fprintf(mFile,"\tsetAttr \".ut\" %i;\n", ut);
 
41
        }
 
42
        void setDegree(unsigned int d)
 
43
        {
 
44
                if(d == 3) return;
 
45
                fprintf(mFile,"\tsetAttr \".d\" %i;\n", d);
 
46
        }
 
47
        void setSections(int s)
 
48
        {
 
49
                if(s == 8) return;
 
50
                fprintf(mFile,"\tsetAttr \".s\" %i;\n", s);
 
51
        }
 
52
        void setTolerance(double tol)
 
53
        {
 
54
                if(tol == 0) return;
 
55
                fprintf(mFile,"\tsetAttr \".tol\" %f;\n", tol);
 
56
        }
 
57
        void setAxis(const double3& ax)
 
58
        {
 
59
                fprintf(mFile,"\tsetAttr \".ax\" -type \"double3\" ");
 
60
                ax.write(mFile);
 
61
                fprintf(mFile,";\n");
 
62
        }
 
63
        void setAxisX(double axx)
 
64
        {
 
65
                if(axx == 1) return;
 
66
                fprintf(mFile,"\tsetAttr \".ax.axx\" %f;\n", axx);
 
67
        }
 
68
        void setAxisY(double axy)
 
69
        {
 
70
                if(axy == 0) return;
 
71
                fprintf(mFile,"\tsetAttr \".ax.axy\" %f;\n", axy);
 
72
        }
 
73
        void setAxisZ(double axz)
 
74
        {
 
75
                if(axz == 0) return;
 
76
                fprintf(mFile,"\tsetAttr \".ax.axz\" %f;\n", axz);
 
77
        }
 
78
        void setPivot(const double3& p)
 
79
        {
 
80
                fprintf(mFile,"\tsetAttr \".p\" -type \"double3\" ");
 
81
                p.write(mFile);
 
82
                fprintf(mFile,";\n");
 
83
        }
 
84
        void setPivotX(double px)
 
85
        {
 
86
                if(px == 0) return;
 
87
                fprintf(mFile,"\tsetAttr \".p.px\" %f;\n", px);
 
88
        }
 
89
        void setPivotY(double py)
 
90
        {
 
91
                if(py == 0) return;
 
92
                fprintf(mFile,"\tsetAttr \".p.py\" %f;\n", py);
 
93
        }
 
94
        void setPivotZ(double pz)
 
95
        {
 
96
                if(pz == 0) return;
 
97
                fprintf(mFile,"\tsetAttr \".p.pz\" %f;\n", pz);
 
98
        }
 
99
        void setAutoCorrectNormal(bool acn)
 
100
        {
 
101
                if(acn == false) return;
 
102
                fprintf(mFile,"\tsetAttr \".acn\" %i;\n", acn);
 
103
        }
 
104
        void setComputePivotAndAxis(unsigned int cpa)
 
105
        {
 
106
                if(cpa == 0) return;
 
107
                fprintf(mFile,"\tsetAttr \".cpa\" %i;\n", cpa);
 
108
        }
 
109
        void setRadius(double r)
 
110
        {
 
111
                if(r == 1) return;
 
112
                fprintf(mFile,"\tsetAttr \".r\" %f;\n", r);
 
113
        }
 
114
        void setRadiusAnchor(double ra)
 
115
        {
 
116
                if(ra == -1) return;
 
117
                fprintf(mFile,"\tsetAttr \".ra\" %f;\n", ra);
 
118
        }
 
119
        void setAxisChoice(unsigned int aco)
 
120
        {
 
121
                if(aco == 0) return;
 
122
                fprintf(mFile,"\tsetAttr \".aco\" %i;\n", aco);
 
123
        }
 
124
        void setBridge(bool br)
 
125
        {
 
126
                if(br == false) return;
 
127
                fprintf(mFile,"\tsetAttr \".br\" %i;\n", br);
 
128
        }
 
129
        void getInputCurve()const
 
130
        {
 
131
                fprintf(mFile,"\"%s.ic\"",mName.c_str());
 
132
        }
 
133
        void getStartSweep()const
 
134
        {
 
135
                fprintf(mFile,"\"%s.ssw\"",mName.c_str());
 
136
        }
 
137
        void getEndSweep()const
 
138
        {
 
139
                fprintf(mFile,"\"%s.esw\"",mName.c_str());
 
140
        }
 
141
        void getUseTolerance()const
 
142
        {
 
143
                fprintf(mFile,"\"%s.ut\"",mName.c_str());
 
144
        }
 
145
        void getDegree()const
 
146
        {
 
147
                fprintf(mFile,"\"%s.d\"",mName.c_str());
 
148
        }
 
149
        void getSections()const
 
150
        {
 
151
                fprintf(mFile,"\"%s.s\"",mName.c_str());
 
152
        }
 
153
        void getTolerance()const
 
154
        {
 
155
                fprintf(mFile,"\"%s.tol\"",mName.c_str());
 
156
        }
 
157
        void getAxis()const
 
158
        {
 
159
                fprintf(mFile,"\"%s.ax\"",mName.c_str());
 
160
        }
 
161
        void getAxisX()const
 
162
        {
 
163
                fprintf(mFile,"\"%s.ax.axx\"",mName.c_str());
 
164
        }
 
165
        void getAxisY()const
 
166
        {
 
167
                fprintf(mFile,"\"%s.ax.axy\"",mName.c_str());
 
168
        }
 
169
        void getAxisZ()const
 
170
        {
 
171
                fprintf(mFile,"\"%s.ax.axz\"",mName.c_str());
 
172
        }
 
173
        void getPivot()const
 
174
        {
 
175
                fprintf(mFile,"\"%s.p\"",mName.c_str());
 
176
        }
 
177
        void getPivotX()const
 
178
        {
 
179
                fprintf(mFile,"\"%s.p.px\"",mName.c_str());
 
180
        }
 
181
        void getPivotY()const
 
182
        {
 
183
                fprintf(mFile,"\"%s.p.py\"",mName.c_str());
 
184
        }
 
185
        void getPivotZ()const
 
186
        {
 
187
                fprintf(mFile,"\"%s.p.pz\"",mName.c_str());
 
188
        }
 
189
        void getAutoCorrectNormal()const
 
190
        {
 
191
                fprintf(mFile,"\"%s.acn\"",mName.c_str());
 
192
        }
 
193
        void getComputePivotAndAxis()const
 
194
        {
 
195
                fprintf(mFile,"\"%s.cpa\"",mName.c_str());
 
196
        }
 
197
        void getRadius()const
 
198
        {
 
199
                fprintf(mFile,"\"%s.r\"",mName.c_str());
 
200
        }
 
201
        void getRadiusAnchor()const
 
202
        {
 
203
                fprintf(mFile,"\"%s.ra\"",mName.c_str());
 
204
        }
 
205
        void getAxisChoice()const
 
206
        {
 
207
                fprintf(mFile,"\"%s.aco\"",mName.c_str());
 
208
        }
 
209
        void getBridge()const
 
210
        {
 
211
                fprintf(mFile,"\"%s.br\"",mName.c_str());
 
212
        }
 
213
        void getOutputSurface()const
 
214
        {
 
215
                fprintf(mFile,"\"%s.os\"",mName.c_str());
 
216
        }
 
217
        void getBridgeCurve()const
 
218
        {
 
219
                fprintf(mFile,"\"%s.bc\"",mName.c_str());
 
220
        }
 
221
        void getCompAxis()const
 
222
        {
 
223
                fprintf(mFile,"\"%s.ca\"",mName.c_str());
 
224
        }
 
225
        void getCompAxisX()const
 
226
        {
 
227
                fprintf(mFile,"\"%s.ca.cax\"",mName.c_str());
 
228
        }
 
229
        void getCompAxisY()const
 
230
        {
 
231
                fprintf(mFile,"\"%s.ca.cay\"",mName.c_str());
 
232
        }
 
233
        void getCompAxisZ()const
 
234
        {
 
235
                fprintf(mFile,"\"%s.ca.caz\"",mName.c_str());
 
236
        }
 
237
        void getCompPivot()const
 
238
        {
 
239
                fprintf(mFile,"\"%s.cp\"",mName.c_str());
 
240
        }
 
241
        void getCompPivotX()const
 
242
        {
 
243
                fprintf(mFile,"\"%s.cp.cpx\"",mName.c_str());
 
244
        }
 
245
        void getCompPivotY()const
 
246
        {
 
247
                fprintf(mFile,"\"%s.cp.cpy\"",mName.c_str());
 
248
        }
 
249
        void getCompPivotZ()const
 
250
        {
 
251
                fprintf(mFile,"\"%s.cp.cpz\"",mName.c_str());
 
252
        }
 
253
        void getCompAxisChoice()const
 
254
        {
 
255
                fprintf(mFile,"\"%s.cac\"",mName.c_str());
 
256
        }
 
257
        void getCompAnchor()const
 
258
        {
 
259
                fprintf(mFile,"\"%s.cn\"",mName.c_str());
 
260
        }
 
261
        void getCompAnchorX()const
 
262
        {
 
263
                fprintf(mFile,"\"%s.cn.cnx\"",mName.c_str());
 
264
        }
 
265
        void getCompAnchorY()const
 
266
        {
 
267
                fprintf(mFile,"\"%s.cn.cny\"",mName.c_str());
 
268
        }
 
269
        void getCompAnchorZ()const
 
270
        {
 
271
                fprintf(mFile,"\"%s.cn.cnz\"",mName.c_str());
 
272
        }
 
273
protected:
 
274
        Revolve(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
275
                :AbstractBaseCreate(file, name, parent, nodeType, shared, create) {}
 
276
 
 
277
};
 
278
}//namespace MayaDM
 
279
#endif//__MayaDM_REVOLVE_H__