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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMMakeNurbCircle.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_MAKENURBCIRCLE_H__
 
11
#define __MayaDM_MAKENURBCIRCLE_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMAbstractBaseCreate.h"
 
15
namespace MayaDM
 
16
{
 
17
class MakeNurbCircle : public AbstractBaseCreate
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        MakeNurbCircle():AbstractBaseCreate(){}
 
23
        MakeNurbCircle(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :AbstractBaseCreate(file, name, parent, "makeNurbCircle", shared, create){}
 
25
        virtual ~MakeNurbCircle(){}
 
26
 
 
27
        void setFirst(const double3& fp)
 
28
        {
 
29
                fprintf(mFile,"\tsetAttr \".fp\" -type \"double3\" ");
 
30
                fp.write(mFile);
 
31
                fprintf(mFile,";\n");
 
32
        }
 
33
        void setFirstPointX(double fpx)
 
34
        {
 
35
                if(fpx == 1) return;
 
36
                fprintf(mFile,"\tsetAttr \".fp.fpx\" %f;\n", fpx);
 
37
        }
 
38
        void setFirstPointY(double fpy)
 
39
        {
 
40
                if(fpy == 0) return;
 
41
                fprintf(mFile,"\tsetAttr \".fp.fpy\" %f;\n", fpy);
 
42
        }
 
43
        void setFirstPointZ(double fpz)
 
44
        {
 
45
                if(fpz == 0) return;
 
46
                fprintf(mFile,"\tsetAttr \".fp.fpz\" %f;\n", fpz);
 
47
        }
 
48
        void setNormal(const double3& nr)
 
49
        {
 
50
                fprintf(mFile,"\tsetAttr \".nr\" -type \"double3\" ");
 
51
                nr.write(mFile);
 
52
                fprintf(mFile,";\n");
 
53
        }
 
54
        void setNormalX(double nrx)
 
55
        {
 
56
                if(nrx == 0) return;
 
57
                fprintf(mFile,"\tsetAttr \".nr.nrx\" %f;\n", nrx);
 
58
        }
 
59
        void setNormalY(double nry)
 
60
        {
 
61
                if(nry == 0) return;
 
62
                fprintf(mFile,"\tsetAttr \".nr.nry\" %f;\n", nry);
 
63
        }
 
64
        void setNormalZ(double nrz)
 
65
        {
 
66
                if(nrz == 1) return;
 
67
                fprintf(mFile,"\tsetAttr \".nr.nrz\" %f;\n", nrz);
 
68
        }
 
69
        void setCenter(const double3& c)
 
70
        {
 
71
                fprintf(mFile,"\tsetAttr \".c\" -type \"double3\" ");
 
72
                c.write(mFile);
 
73
                fprintf(mFile,";\n");
 
74
        }
 
75
        void setCenterX(double cx)
 
76
        {
 
77
                if(cx == 0) return;
 
78
                fprintf(mFile,"\tsetAttr \".c.cx\" %f;\n", cx);
 
79
        }
 
80
        void setCenterY(double cy)
 
81
        {
 
82
                if(cy == 0) return;
 
83
                fprintf(mFile,"\tsetAttr \".c.cy\" %f;\n", cy);
 
84
        }
 
85
        void setCenterZ(double cz)
 
86
        {
 
87
                if(cz == 0) return;
 
88
                fprintf(mFile,"\tsetAttr \".c.cz\" %f;\n", cz);
 
89
        }
 
90
        void setRadius(double r)
 
91
        {
 
92
                if(r == 1) return;
 
93
                fprintf(mFile,"\tsetAttr \".r\" %f;\n", r);
 
94
        }
 
95
        void setSweep(double sw)
 
96
        {
 
97
                if(sw == 6.2831853) return;
 
98
                fprintf(mFile,"\tsetAttr \".sw\" %f;\n", sw);
 
99
        }
 
100
        void setUseTolerance(bool ut)
 
101
        {
 
102
                if(ut == false) return;
 
103
                fprintf(mFile,"\tsetAttr \".ut\" %i;\n", ut);
 
104
        }
 
105
        void setDegree(unsigned int d)
 
106
        {
 
107
                if(d == 3) return;
 
108
                fprintf(mFile,"\tsetAttr \".d\" %i;\n", d);
 
109
        }
 
110
        void setSections(int s)
 
111
        {
 
112
                if(s == 8) return;
 
113
                fprintf(mFile,"\tsetAttr \".s\" %i;\n", s);
 
114
        }
 
115
        void setTolerance(double tol)
 
116
        {
 
117
                if(tol == 0) return;
 
118
                fprintf(mFile,"\tsetAttr \".tol\" %f;\n", tol);
 
119
        }
 
120
        void setFixCenter(bool fc)
 
121
        {
 
122
                if(fc == true) return;
 
123
                fprintf(mFile,"\tsetAttr \".fc\" %i;\n", fc);
 
124
        }
 
125
        void getFirst()const
 
126
        {
 
127
                fprintf(mFile,"\"%s.fp\"",mName.c_str());
 
128
        }
 
129
        void getFirstPointX()const
 
130
        {
 
131
                fprintf(mFile,"\"%s.fp.fpx\"",mName.c_str());
 
132
        }
 
133
        void getFirstPointY()const
 
134
        {
 
135
                fprintf(mFile,"\"%s.fp.fpy\"",mName.c_str());
 
136
        }
 
137
        void getFirstPointZ()const
 
138
        {
 
139
                fprintf(mFile,"\"%s.fp.fpz\"",mName.c_str());
 
140
        }
 
141
        void getNormal()const
 
142
        {
 
143
                fprintf(mFile,"\"%s.nr\"",mName.c_str());
 
144
        }
 
145
        void getNormalX()const
 
146
        {
 
147
                fprintf(mFile,"\"%s.nr.nrx\"",mName.c_str());
 
148
        }
 
149
        void getNormalY()const
 
150
        {
 
151
                fprintf(mFile,"\"%s.nr.nry\"",mName.c_str());
 
152
        }
 
153
        void getNormalZ()const
 
154
        {
 
155
                fprintf(mFile,"\"%s.nr.nrz\"",mName.c_str());
 
156
        }
 
157
        void getCenter()const
 
158
        {
 
159
                fprintf(mFile,"\"%s.c\"",mName.c_str());
 
160
        }
 
161
        void getCenterX()const
 
162
        {
 
163
                fprintf(mFile,"\"%s.c.cx\"",mName.c_str());
 
164
        }
 
165
        void getCenterY()const
 
166
        {
 
167
                fprintf(mFile,"\"%s.c.cy\"",mName.c_str());
 
168
        }
 
169
        void getCenterZ()const
 
170
        {
 
171
                fprintf(mFile,"\"%s.c.cz\"",mName.c_str());
 
172
        }
 
173
        void getRadius()const
 
174
        {
 
175
                fprintf(mFile,"\"%s.r\"",mName.c_str());
 
176
        }
 
177
        void getSweep()const
 
178
        {
 
179
                fprintf(mFile,"\"%s.sw\"",mName.c_str());
 
180
        }
 
181
        void getUseTolerance()const
 
182
        {
 
183
                fprintf(mFile,"\"%s.ut\"",mName.c_str());
 
184
        }
 
185
        void getDegree()const
 
186
        {
 
187
                fprintf(mFile,"\"%s.d\"",mName.c_str());
 
188
        }
 
189
        void getSections()const
 
190
        {
 
191
                fprintf(mFile,"\"%s.s\"",mName.c_str());
 
192
        }
 
193
        void getTolerance()const
 
194
        {
 
195
                fprintf(mFile,"\"%s.tol\"",mName.c_str());
 
196
        }
 
197
        void getFixCenter()const
 
198
        {
 
199
                fprintf(mFile,"\"%s.fc\"",mName.c_str());
 
200
        }
 
201
        void getOutputCurve()const
 
202
        {
 
203
                fprintf(mFile,"\"%s.oc\"",mName.c_str());
 
204
        }
 
205
protected:
 
206
        MakeNurbCircle(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
207
                :AbstractBaseCreate(file, name, parent, nodeType, shared, create) {}
 
208
 
 
209
};
 
210
}//namespace MayaDM
 
211
#endif//__MayaDM_MAKENURBCIRCLE_H__