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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMTransferAttributes.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_TRANSFERATTRIBUTES_H__
 
11
#define __MayaDM_TRANSFERATTRIBUTES_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMWeightGeometryFilter.h"
 
15
namespace MayaDM
 
16
{
 
17
class TransferAttributes : public WeightGeometryFilter
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        TransferAttributes():WeightGeometryFilter(){}
 
23
        TransferAttributes(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :WeightGeometryFilter(file, name, parent, "transferAttributes", shared, create){}
 
25
        virtual ~TransferAttributes(){}
 
26
 
 
27
        void setTransferPositions(unsigned int pos)
 
28
        {
 
29
                if(pos == 0) return;
 
30
                fprintf(mFile,"\tsetAttr \".pos\" %i;\n", pos);
 
31
        }
 
32
        void setTransferNormals(unsigned int nml)
 
33
        {
 
34
                if(nml == 0) return;
 
35
                fprintf(mFile,"\tsetAttr \".nml\" %i;\n", nml);
 
36
        }
 
37
        void setTransferUVs(unsigned int uvs)
 
38
        {
 
39
                if(uvs == 0) return;
 
40
                fprintf(mFile,"\tsetAttr \".uvs\" %i;\n", uvs);
 
41
        }
 
42
        void setSourceUVSet(const string& suv)
 
43
        {
 
44
                if(suv == "NULL") return;
 
45
                fprintf(mFile,"\tsetAttr \".suv\" -type \"string\" ");
 
46
                suv.write(mFile);
 
47
                fprintf(mFile,";\n");
 
48
        }
 
49
        void setTargetUVSet(const string& tuv)
 
50
        {
 
51
                if(tuv == "NULL") return;
 
52
                fprintf(mFile,"\tsetAttr \".tuv\" -type \"string\" ");
 
53
                tuv.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setTransferColors(unsigned int col)
 
57
        {
 
58
                if(col == 0) return;
 
59
                fprintf(mFile,"\tsetAttr \".col\" %i;\n", col);
 
60
        }
 
61
        void setSourceColorSet(const string& scs)
 
62
        {
 
63
                if(scs == "NULL") return;
 
64
                fprintf(mFile,"\tsetAttr \".scs\" -type \"string\" ");
 
65
                scs.write(mFile);
 
66
                fprintf(mFile,";\n");
 
67
        }
 
68
        void setTargetColorSet(const string& tcs)
 
69
        {
 
70
                if(tcs == "NULL") return;
 
71
                fprintf(mFile,"\tsetAttr \".tcs\" -type \"string\" ");
 
72
                tcs.write(mFile);
 
73
                fprintf(mFile,";\n");
 
74
        }
 
75
        void setSampleSpace(unsigned int spa)
 
76
        {
 
77
                if(spa == 0) return;
 
78
                fprintf(mFile,"\tsetAttr \".spa\" %i;\n", spa);
 
79
        }
 
80
        void setSourceUVSpace(const string& sus)
 
81
        {
 
82
                if(sus == "NULL") return;
 
83
                fprintf(mFile,"\tsetAttr \".sus\" -type \"string\" ");
 
84
                sus.write(mFile);
 
85
                fprintf(mFile,";\n");
 
86
        }
 
87
        void setTargetUVSpace(const string& tus)
 
88
        {
 
89
                if(tus == "NULL") return;
 
90
                fprintf(mFile,"\tsetAttr \".tus\" -type \"string\" ");
 
91
                tus.write(mFile);
 
92
                fprintf(mFile,";\n");
 
93
        }
 
94
        void setSearchMethod(unsigned int mtd)
 
95
        {
 
96
                if(mtd == 1) return;
 
97
                fprintf(mFile,"\tsetAttr \".mtd\" %i;\n", mtd);
 
98
        }
 
99
        void setSearchDistance(double dis)
 
100
        {
 
101
                if(dis == 0.0) return;
 
102
                fprintf(mFile,"\tsetAttr \".dis\" %f;\n", dis);
 
103
        }
 
104
        void setSearchTolerance(double tol)
 
105
        {
 
106
                if(tol == 1.3) return;
 
107
                fprintf(mFile,"\tsetAttr \".tol\" %f;\n", tol);
 
108
        }
 
109
        void setSearchScale(const double3& ss)
 
110
        {
 
111
                if(ss == double3(1.0, 1.0, 1.0)) return;
 
112
                fprintf(mFile,"\tsetAttr \".ss\" -type \"double3\" ");
 
113
                ss.write(mFile);
 
114
                fprintf(mFile,";\n");
 
115
        }
 
116
        void setSearchScaleX(double ssx)
 
117
        {
 
118
                if(ssx == 0) return;
 
119
                fprintf(mFile,"\tsetAttr \".ss.ssx\" %f;\n", ssx);
 
120
        }
 
121
        void setSearchScaleY(double ssy)
 
122
        {
 
123
                if(ssy == 0) return;
 
124
                fprintf(mFile,"\tsetAttr \".ss.ssy\" %f;\n", ssy);
 
125
        }
 
126
        void setSearchScaleZ(double ssz)
 
127
        {
 
128
                if(ssz == 0) return;
 
129
                fprintf(mFile,"\tsetAttr \".ss.ssz\" %f;\n", ssz);
 
130
        }
 
131
        void setFlipUVs(unsigned int fuv)
 
132
        {
 
133
                if(fuv == 0) return;
 
134
                fprintf(mFile,"\tsetAttr \".fuv\" %i;\n", fuv);
 
135
        }
 
136
        void setColorBorders(unsigned int clb)
 
137
        {
 
138
                if(clb == 1) return;
 
139
                fprintf(mFile,"\tsetAttr \".clb\" %i;\n", clb);
 
140
        }
 
141
        void getSource(size_t src_i)const
 
142
        {
 
143
                fprintf(mFile,"\"%s.src[%i]\"",mName.c_str(),src_i);
 
144
        }
 
145
        void getSource()const
 
146
        {
 
147
 
 
148
                fprintf(mFile,"\"%s.src\"",mName.c_str());
 
149
        }
 
150
        void getTransferPositions()const
 
151
        {
 
152
                fprintf(mFile,"\"%s.pos\"",mName.c_str());
 
153
        }
 
154
        void getTransferNormals()const
 
155
        {
 
156
                fprintf(mFile,"\"%s.nml\"",mName.c_str());
 
157
        }
 
158
        void getTransferUVs()const
 
159
        {
 
160
                fprintf(mFile,"\"%s.uvs\"",mName.c_str());
 
161
        }
 
162
        void getSourceUVSet()const
 
163
        {
 
164
                fprintf(mFile,"\"%s.suv\"",mName.c_str());
 
165
        }
 
166
        void getTargetUVSet()const
 
167
        {
 
168
                fprintf(mFile,"\"%s.tuv\"",mName.c_str());
 
169
        }
 
170
        void getTransferColors()const
 
171
        {
 
172
                fprintf(mFile,"\"%s.col\"",mName.c_str());
 
173
        }
 
174
        void getSourceColorSet()const
 
175
        {
 
176
                fprintf(mFile,"\"%s.scs\"",mName.c_str());
 
177
        }
 
178
        void getTargetColorSet()const
 
179
        {
 
180
                fprintf(mFile,"\"%s.tcs\"",mName.c_str());
 
181
        }
 
182
        void getSampleSpace()const
 
183
        {
 
184
                fprintf(mFile,"\"%s.spa\"",mName.c_str());
 
185
        }
 
186
        void getSourceUVSpace()const
 
187
        {
 
188
                fprintf(mFile,"\"%s.sus\"",mName.c_str());
 
189
        }
 
190
        void getTargetUVSpace()const
 
191
        {
 
192
                fprintf(mFile,"\"%s.tus\"",mName.c_str());
 
193
        }
 
194
        void getSearchMethod()const
 
195
        {
 
196
                fprintf(mFile,"\"%s.mtd\"",mName.c_str());
 
197
        }
 
198
        void getSearchDistance()const
 
199
        {
 
200
                fprintf(mFile,"\"%s.dis\"",mName.c_str());
 
201
        }
 
202
        void getSearchTolerance()const
 
203
        {
 
204
                fprintf(mFile,"\"%s.tol\"",mName.c_str());
 
205
        }
 
206
        void getSearchScale()const
 
207
        {
 
208
                fprintf(mFile,"\"%s.ss\"",mName.c_str());
 
209
        }
 
210
        void getSearchScaleX()const
 
211
        {
 
212
                fprintf(mFile,"\"%s.ss.ssx\"",mName.c_str());
 
213
        }
 
214
        void getSearchScaleY()const
 
215
        {
 
216
                fprintf(mFile,"\"%s.ss.ssy\"",mName.c_str());
 
217
        }
 
218
        void getSearchScaleZ()const
 
219
        {
 
220
                fprintf(mFile,"\"%s.ss.ssz\"",mName.c_str());
 
221
        }
 
222
        void getFlipUVs()const
 
223
        {
 
224
                fprintf(mFile,"\"%s.fuv\"",mName.c_str());
 
225
        }
 
226
        void getColorBorders()const
 
227
        {
 
228
                fprintf(mFile,"\"%s.clb\"",mName.c_str());
 
229
        }
 
230
protected:
 
231
        TransferAttributes(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
232
                :WeightGeometryFilter(file, name, parent, nodeType, shared, create) {}
 
233
 
 
234
};
 
235
}//namespace MayaDM
 
236
#endif//__MayaDM_TRANSFERATTRIBUTES_H__