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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMTextureBakeSet.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_TEXTUREBAKESET_H__
 
11
#define __MayaDM_TEXTUREBAKESET_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMBakeSet.h"
 
15
namespace MayaDM
 
16
{
 
17
class TextureBakeSet : public BakeSet
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        TextureBakeSet():BakeSet(){}
 
23
        TextureBakeSet(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :BakeSet(file, name, parent, "textureBakeSet", shared, create){}
 
25
        virtual ~TextureBakeSet(){}
 
26
 
 
27
        void setSeparation(unsigned int sep)
 
28
        {
 
29
                if(sep == 0) return;
 
30
                fprintf(mFile,"\tsetAttr \".sep\" %i;\n", sep);
 
31
        }
 
32
        void setXResolution(int xres)
 
33
        {
 
34
                if(xres == 512) return;
 
35
                fprintf(mFile,"\tsetAttr \".xres\" %i;\n", xres);
 
36
        }
 
37
        void setYResolution(int yres)
 
38
        {
 
39
                if(yres == 512) return;
 
40
                fprintf(mFile,"\tsetAttr \".yres\" %i;\n", yres);
 
41
        }
 
42
        void setFileFormat(unsigned int format)
 
43
        {
 
44
                if(format == 0) return;
 
45
                fprintf(mFile,"\tsetAttr \".format\" %i;\n", format);
 
46
        }
 
47
        void setBitsPerChannel(unsigned int bits)
 
48
        {
 
49
                if(bits == 0) return;
 
50
                fprintf(mFile,"\tsetAttr \".bits\" %i;\n", bits);
 
51
        }
 
52
        void setOverrideUvSet(bool overrideuv)
 
53
        {
 
54
                if(overrideuv == 0) return;
 
55
                fprintf(mFile,"\tsetAttr \".overrideuv\" %i;\n", overrideuv);
 
56
        }
 
57
        void setUvSetName(const string& set)
 
58
        {
 
59
                if(set == "uvSet1") return;
 
60
                fprintf(mFile,"\tsetAttr \".set\" -type \"string\" ");
 
61
                set.write(mFile);
 
62
                fprintf(mFile,";\n");
 
63
        }
 
64
        void setUvRange(unsigned int range)
 
65
        {
 
66
                if(range == 0) return;
 
67
                fprintf(mFile,"\tsetAttr \".range\" %i;\n", range);
 
68
        }
 
69
        void setUMin(float ul)
 
70
        {
 
71
                if(ul == 1.0) return;
 
72
                fprintf(mFile,"\tsetAttr \".ul\" %f;\n", ul);
 
73
        }
 
74
        void setUMax(float uh)
 
75
        {
 
76
                if(uh == 1.0) return;
 
77
                fprintf(mFile,"\tsetAttr \".uh\" %f;\n", uh);
 
78
        }
 
79
        void setVMin(float vl)
 
80
        {
 
81
                if(vl == 1.0) return;
 
82
                fprintf(mFile,"\tsetAttr \".vl\" %f;\n", vl);
 
83
        }
 
84
        void setVMax(float vh)
 
85
        {
 
86
                if(vh == 1.0) return;
 
87
                fprintf(mFile,"\tsetAttr \".vh\" %f;\n", vh);
 
88
        }
 
89
        void setBackgroundMode(unsigned int bmode)
 
90
        {
 
91
                if(bmode == 0) return;
 
92
                fprintf(mFile,"\tsetAttr \".bmode\" %i;\n", bmode);
 
93
        }
 
94
        void setBackgroundColor(const float3& bgc)
 
95
        {
 
96
                if(bgc == float3(0.0f,0.0f,0.0f)) return;
 
97
                fprintf(mFile,"\tsetAttr \".bgc\" -type \"float3\" ");
 
98
                bgc.write(mFile);
 
99
                fprintf(mFile,";\n");
 
100
        }
 
101
        void setBackgroundColorR(float bgr)
 
102
        {
 
103
                if(bgr == 0.0) return;
 
104
                fprintf(mFile,"\tsetAttr \".bgc.bgr\" %f;\n", bgr);
 
105
        }
 
106
        void setBackgroundColorG(float bgg)
 
107
        {
 
108
                if(bgg == 0.0) return;
 
109
                fprintf(mFile,"\tsetAttr \".bgc.bgg\" %f;\n", bgg);
 
110
        }
 
111
        void setBackgroundColorB(float bgb)
 
112
        {
 
113
                if(bgb == 0.0) return;
 
114
                fprintf(mFile,"\tsetAttr \".bgc.bgb\" %f;\n", bgb);
 
115
        }
 
116
        void setFillTextureSeams(float fillseams)
 
117
        {
 
118
                if(fillseams == 1.0) return;
 
119
                fprintf(mFile,"\tsetAttr \".fillseams\" %f;\n", fillseams);
 
120
        }
 
121
        void setFinalGatherQuality(float fgq)
 
122
        {
 
123
                if(fgq == 1) return;
 
124
                fprintf(mFile,"\tsetAttr \".fgq\" %f;\n", fgq);
 
125
        }
 
126
        void setFinalGatherReflect(float fgr)
 
127
        {
 
128
                if(fgr == 0) return;
 
129
                fprintf(mFile,"\tsetAttr \".fgr\" %f;\n", fgr);
 
130
        }
 
131
        void setBakeToOneMap(bool one)
 
132
        {
 
133
                if(one == 0) return;
 
134
                fprintf(mFile,"\tsetAttr \".one\" %i;\n", one);
 
135
        }
 
136
        void setSamples(int nsp)
 
137
        {
 
138
                if(nsp == 1) return;
 
139
                fprintf(mFile,"\tsetAttr \".nsp\" %i;\n", nsp);
 
140
        }
 
141
        void getSeparation()const
 
142
        {
 
143
                fprintf(mFile,"\"%s.sep\"",mName.c_str());
 
144
        }
 
145
        void getPrefix()const
 
146
        {
 
147
                fprintf(mFile,"\"%s.pre\"",mName.c_str());
 
148
        }
 
149
        void getXResolution()const
 
150
        {
 
151
                fprintf(mFile,"\"%s.xres\"",mName.c_str());
 
152
        }
 
153
        void getYResolution()const
 
154
        {
 
155
                fprintf(mFile,"\"%s.yres\"",mName.c_str());
 
156
        }
 
157
        void getFileFormat()const
 
158
        {
 
159
                fprintf(mFile,"\"%s.format\"",mName.c_str());
 
160
        }
 
161
        void getBitsPerChannel()const
 
162
        {
 
163
                fprintf(mFile,"\"%s.bits\"",mName.c_str());
 
164
        }
 
165
        void getOverrideUvSet()const
 
166
        {
 
167
                fprintf(mFile,"\"%s.overrideuv\"",mName.c_str());
 
168
        }
 
169
        void getUvSetName()const
 
170
        {
 
171
                fprintf(mFile,"\"%s.set\"",mName.c_str());
 
172
        }
 
173
        void getUvRange()const
 
174
        {
 
175
                fprintf(mFile,"\"%s.range\"",mName.c_str());
 
176
        }
 
177
        void getUMin()const
 
178
        {
 
179
                fprintf(mFile,"\"%s.ul\"",mName.c_str());
 
180
        }
 
181
        void getUMax()const
 
182
        {
 
183
                fprintf(mFile,"\"%s.uh\"",mName.c_str());
 
184
        }
 
185
        void getVMin()const
 
186
        {
 
187
                fprintf(mFile,"\"%s.vl\"",mName.c_str());
 
188
        }
 
189
        void getVMax()const
 
190
        {
 
191
                fprintf(mFile,"\"%s.vh\"",mName.c_str());
 
192
        }
 
193
        void getBackgroundMode()const
 
194
        {
 
195
                fprintf(mFile,"\"%s.bmode\"",mName.c_str());
 
196
        }
 
197
        void getBackgroundColor()const
 
198
        {
 
199
                fprintf(mFile,"\"%s.bgc\"",mName.c_str());
 
200
        }
 
201
        void getBackgroundColorR()const
 
202
        {
 
203
                fprintf(mFile,"\"%s.bgc.bgr\"",mName.c_str());
 
204
        }
 
205
        void getBackgroundColorG()const
 
206
        {
 
207
                fprintf(mFile,"\"%s.bgc.bgg\"",mName.c_str());
 
208
        }
 
209
        void getBackgroundColorB()const
 
210
        {
 
211
                fprintf(mFile,"\"%s.bgc.bgb\"",mName.c_str());
 
212
        }
 
213
        void getFillTextureSeams()const
 
214
        {
 
215
                fprintf(mFile,"\"%s.fillseams\"",mName.c_str());
 
216
        }
 
217
        void getFillScale()const
 
218
        {
 
219
                fprintf(mFile,"\"%s.fillscale\"",mName.c_str());
 
220
        }
 
221
        void getFinalGatherQuality()const
 
222
        {
 
223
                fprintf(mFile,"\"%s.fgq\"",mName.c_str());
 
224
        }
 
225
        void getFinalGatherReflect()const
 
226
        {
 
227
                fprintf(mFile,"\"%s.fgr\"",mName.c_str());
 
228
        }
 
229
        void getBakeToOneMap()const
 
230
        {
 
231
                fprintf(mFile,"\"%s.one\"",mName.c_str());
 
232
        }
 
233
        void getSamples()const
 
234
        {
 
235
                fprintf(mFile,"\"%s.nsp\"",mName.c_str());
 
236
        }
 
237
protected:
 
238
        TextureBakeSet(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
239
                :BakeSet(file, name, parent, nodeType, shared, create) {}
 
240
 
 
241
};
 
242
}//namespace MayaDM
 
243
#endif//__MayaDM_TEXTUREBAKESET_H__