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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMPolyMoveUV.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_POLYMOVEUV_H__
 
11
#define __MayaDM_POLYMOVEUV_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMPolyModifier.h"
 
15
namespace MayaDM
 
16
{
 
17
class PolyMoveUV : public PolyModifier
 
18
{
 
19
public:
 
20
public:
 
21
 
 
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(){}
 
26
 
 
27
        void setTranslate(const double2& t)
 
28
        {
 
29
                if(t == double2(0.0, 0.0)) return;
 
30
                fprintf(mFile,"\tsetAttr \".t\" -type \"double2\" ");
 
31
                t.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setTranslateU(double tu)
 
35
        {
 
36
                if(tu == 0.0) return;
 
37
                fprintf(mFile,"\tsetAttr \".t.tu\" %f;\n", tu);
 
38
        }
 
39
        void setTranslateV(double tv)
 
40
        {
 
41
                if(tv == 0.0) return;
 
42
                fprintf(mFile,"\tsetAttr \".t.tv\" %f;\n", tv);
 
43
        }
 
44
        void setRotationAngle(double ra)
 
45
        {
 
46
                if(ra == 0) return;
 
47
                fprintf(mFile,"\tsetAttr \".ra\" %f;\n", ra);
 
48
        }
 
49
        void setPivot(const double2& pvt)
 
50
        {
 
51
                if(pvt == double2(0.5, 0.5)) return;
 
52
                fprintf(mFile,"\tsetAttr \".pvt\" -type \"double2\" ");
 
53
                pvt.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setPivotU(double pvu)
 
57
        {
 
58
                if(pvu == 0.0) return;
 
59
                fprintf(mFile,"\tsetAttr \".pvt.pvu\" %f;\n", pvu);
 
60
        }
 
61
        void setPivotV(double pvv)
 
62
        {
 
63
                if(pvv == 0.0) return;
 
64
                fprintf(mFile,"\tsetAttr \".pvt.pvv\" %f;\n", pvv);
 
65
        }
 
66
        void setScale(const double2& s)
 
67
        {
 
68
                if(s == double2(1.0, 1.0)) return;
 
69
                fprintf(mFile,"\tsetAttr \".s\" -type \"double2\" ");
 
70
                s.write(mFile);
 
71
                fprintf(mFile,";\n");
 
72
        }
 
73
        void setScaleU(double su)
 
74
        {
 
75
                if(su == 0.0) return;
 
76
                fprintf(mFile,"\tsetAttr \".s.su\" %f;\n", su);
 
77
        }
 
78
        void setScaleV(double sv)
 
79
        {
 
80
                if(sv == 0.0) return;
 
81
                fprintf(mFile,"\tsetAttr \".s.sv\" %f;\n", sv);
 
82
        }
 
83
        void setRandom(float ran)
 
84
        {
 
85
                if(ran == 0.0) return;
 
86
                fprintf(mFile,"\tsetAttr \".ran\" %f;\n", ran);
 
87
        }
 
88
        void setRandomSeed(int rs)
 
89
        {
 
90
                if(rs == 0) return;
 
91
                fprintf(mFile,"\tsetAttr \".rs\" %i;\n", rs);
 
92
        }
 
93
        void setAxisLen(const double2& l)
 
94
        {
 
95
                if(l == double2(1.0, 1.0)) return;
 
96
                fprintf(mFile,"\tsetAttr \".l\" -type \"double2\" ");
 
97
                l.write(mFile);
 
98
                fprintf(mFile,";\n");
 
99
        }
 
100
        void setAxisLenX(double lx)
 
101
        {
 
102
                if(lx == 0.0) return;
 
103
                fprintf(mFile,"\tsetAttr \".l.lx\" %f;\n", lx);
 
104
        }
 
105
        void setAxisLenY(double ly)
 
106
        {
 
107
                if(ly == 0.0) return;
 
108
                fprintf(mFile,"\tsetAttr \".l.ly\" %f;\n", ly);
 
109
        }
 
110
        void setUvSetName(const string& uvs)
 
111
        {
 
112
                if(uvs == "NULL") return;
 
113
                fprintf(mFile,"\tsetAttr \".uvs\" -type \"string\" ");
 
114
                uvs.write(mFile);
 
115
                fprintf(mFile,";\n");
 
116
        }
 
117
        void getTranslate()const
 
118
        {
 
119
                fprintf(mFile,"\"%s.t\"",mName.c_str());
 
120
        }
 
121
        void getTranslateU()const
 
122
        {
 
123
                fprintf(mFile,"\"%s.t.tu\"",mName.c_str());
 
124
        }
 
125
        void getTranslateV()const
 
126
        {
 
127
                fprintf(mFile,"\"%s.t.tv\"",mName.c_str());
 
128
        }
 
129
        void getRotationAngle()const
 
130
        {
 
131
                fprintf(mFile,"\"%s.ra\"",mName.c_str());
 
132
        }
 
133
        void getPivot()const
 
134
        {
 
135
                fprintf(mFile,"\"%s.pvt\"",mName.c_str());
 
136
        }
 
137
        void getPivotU()const
 
138
        {
 
139
                fprintf(mFile,"\"%s.pvt.pvu\"",mName.c_str());
 
140
        }
 
141
        void getPivotV()const
 
142
        {
 
143
                fprintf(mFile,"\"%s.pvt.pvv\"",mName.c_str());
 
144
        }
 
145
        void getScale()const
 
146
        {
 
147
                fprintf(mFile,"\"%s.s\"",mName.c_str());
 
148
        }
 
149
        void getScaleU()const
 
150
        {
 
151
                fprintf(mFile,"\"%s.s.su\"",mName.c_str());
 
152
        }
 
153
        void getScaleV()const
 
154
        {
 
155
                fprintf(mFile,"\"%s.s.sv\"",mName.c_str());
 
156
        }
 
157
        void getRandom()const
 
158
        {
 
159
                fprintf(mFile,"\"%s.ran\"",mName.c_str());
 
160
        }
 
161
        void getRandomSeed()const
 
162
        {
 
163
                fprintf(mFile,"\"%s.rs\"",mName.c_str());
 
164
        }
 
165
        void getAxisLen()const
 
166
        {
 
167
                fprintf(mFile,"\"%s.l\"",mName.c_str());
 
168
        }
 
169
        void getAxisLenX()const
 
170
        {
 
171
                fprintf(mFile,"\"%s.l.lx\"",mName.c_str());
 
172
        }
 
173
        void getAxisLenY()const
 
174
        {
 
175
                fprintf(mFile,"\"%s.l.ly\"",mName.c_str());
 
176
        }
 
177
        void getCompId()const
 
178
        {
 
179
                fprintf(mFile,"\"%s.cid\"",mName.c_str());
 
180
        }
 
181
        void getUvSetName()const
 
182
        {
 
183
                fprintf(mFile,"\"%s.uvs\"",mName.c_str());
 
184
        }
 
185
protected:
 
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) {}
 
188
 
 
189
};
 
190
}//namespace MayaDM
 
191
#endif//__MayaDM_POLYMOVEUV_H__