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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMPolyCut.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_POLYCUT_H__
 
11
#define __MayaDM_POLYCUT_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMPolyModifierWorld.h"
 
15
namespace MayaDM
 
16
{
 
17
class PolyCut : public PolyModifierWorld
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        PolyCut():PolyModifierWorld(){}
 
23
        PolyCut(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :PolyModifierWorld(file, name, parent, "polyCut", shared, create){}
 
25
        virtual ~PolyCut(){}
 
26
 
 
27
        void setCutPlaneCenter(const double3& pc)
 
28
        {
 
29
                if(pc == double3(0.0, 0.0, 0.0)) return;
 
30
                fprintf(mFile,"\tsetAttr \".pc\" -type \"double3\" ");
 
31
                pc.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setCutPlaneCenterX(double pcx)
 
35
        {
 
36
                if(pcx == 0) return;
 
37
                fprintf(mFile,"\tsetAttr \".pc.pcx\" %f;\n", pcx);
 
38
        }
 
39
        void setCutPlaneCenterY(double pcy)
 
40
        {
 
41
                if(pcy == 0) return;
 
42
                fprintf(mFile,"\tsetAttr \".pc.pcy\" %f;\n", pcy);
 
43
        }
 
44
        void setCutPlaneCenterZ(double pcz)
 
45
        {
 
46
                if(pcz == 0) return;
 
47
                fprintf(mFile,"\tsetAttr \".pc.pcz\" %f;\n", pcz);
 
48
        }
 
49
        void setCutPlaneRotate(const double3& ro)
 
50
        {
 
51
                if(ro == double3(0.0, 0.0, 0.0)) return;
 
52
                fprintf(mFile,"\tsetAttr \".ro\" -type \"double3\" ");
 
53
                ro.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setCutPlaneRotateX(double rx)
 
57
        {
 
58
                if(rx == 0) return;
 
59
                fprintf(mFile,"\tsetAttr \".ro.rx\" %f;\n", rx);
 
60
        }
 
61
        void setCutPlaneRotateY(double ry)
 
62
        {
 
63
                if(ry == 0) return;
 
64
                fprintf(mFile,"\tsetAttr \".ro.ry\" %f;\n", ry);
 
65
        }
 
66
        void setCutPlaneRotateZ(double rz)
 
67
        {
 
68
                if(rz == 0) return;
 
69
                fprintf(mFile,"\tsetAttr \".ro.rz\" %f;\n", rz);
 
70
        }
 
71
        void setCutPlaneSize(const double2& ps)
 
72
        {
 
73
                if(ps == double2(1.0, 1.0)) return;
 
74
                fprintf(mFile,"\tsetAttr \".ps\" -type \"double2\" ");
 
75
                ps.write(mFile);
 
76
                fprintf(mFile,";\n");
 
77
        }
 
78
        void setCutPlaneWidth(double pw)
 
79
        {
 
80
                if(pw == 0) return;
 
81
                fprintf(mFile,"\tsetAttr \".ps.pw\" %f;\n", pw);
 
82
        }
 
83
        void setCutPlaneHeight(double ph)
 
84
        {
 
85
                if(ph == 0) return;
 
86
                fprintf(mFile,"\tsetAttr \".ps.ph\" %f;\n", ph);
 
87
        }
 
88
        void setExtractFaces(bool ef)
 
89
        {
 
90
                if(ef == false) return;
 
91
                fprintf(mFile,"\tsetAttr \".ef\" %i;\n", ef);
 
92
        }
 
93
        void setExtractOffset(const double3& eo)
 
94
        {
 
95
                if(eo == double3(0.5, 0.5, 0.5)) return;
 
96
                fprintf(mFile,"\tsetAttr \".eo\" -type \"double3\" ");
 
97
                eo.write(mFile);
 
98
                fprintf(mFile,";\n");
 
99
        }
 
100
        void setExtractOffsetX(double eox)
 
101
        {
 
102
                if(eox == 0) return;
 
103
                fprintf(mFile,"\tsetAttr \".eo.eox\" %f;\n", eox);
 
104
        }
 
105
        void setExtractOffsetY(double eoy)
 
106
        {
 
107
                if(eoy == 0) return;
 
108
                fprintf(mFile,"\tsetAttr \".eo.eoy\" %f;\n", eoy);
 
109
        }
 
110
        void setExtractOffsetZ(double eoz)
 
111
        {
 
112
                if(eoz == 0) return;
 
113
                fprintf(mFile,"\tsetAttr \".eo.eoz\" %f;\n", eoz);
 
114
        }
 
115
        void setDeleteFaces(bool df)
 
116
        {
 
117
                if(df == false) return;
 
118
                fprintf(mFile,"\tsetAttr \".df\" %i;\n", df);
 
119
        }
 
120
        void setOnObject(bool oo)
 
121
        {
 
122
                if(oo == true) return;
 
123
                fprintf(mFile,"\tsetAttr \".oo\" %i;\n", oo);
 
124
        }
 
125
        void getCutPlaneCenter()const
 
126
        {
 
127
                fprintf(mFile,"\"%s.pc\"",mName.c_str());
 
128
        }
 
129
        void getCutPlaneCenterX()const
 
130
        {
 
131
                fprintf(mFile,"\"%s.pc.pcx\"",mName.c_str());
 
132
        }
 
133
        void getCutPlaneCenterY()const
 
134
        {
 
135
                fprintf(mFile,"\"%s.pc.pcy\"",mName.c_str());
 
136
        }
 
137
        void getCutPlaneCenterZ()const
 
138
        {
 
139
                fprintf(mFile,"\"%s.pc.pcz\"",mName.c_str());
 
140
        }
 
141
        void getCutPlaneRotate()const
 
142
        {
 
143
                fprintf(mFile,"\"%s.ro\"",mName.c_str());
 
144
        }
 
145
        void getCutPlaneRotateX()const
 
146
        {
 
147
                fprintf(mFile,"\"%s.ro.rx\"",mName.c_str());
 
148
        }
 
149
        void getCutPlaneRotateY()const
 
150
        {
 
151
                fprintf(mFile,"\"%s.ro.ry\"",mName.c_str());
 
152
        }
 
153
        void getCutPlaneRotateZ()const
 
154
        {
 
155
                fprintf(mFile,"\"%s.ro.rz\"",mName.c_str());
 
156
        }
 
157
        void getCutPlaneSize()const
 
158
        {
 
159
                fprintf(mFile,"\"%s.ps\"",mName.c_str());
 
160
        }
 
161
        void getCutPlaneWidth()const
 
162
        {
 
163
                fprintf(mFile,"\"%s.ps.pw\"",mName.c_str());
 
164
        }
 
165
        void getCutPlaneHeight()const
 
166
        {
 
167
                fprintf(mFile,"\"%s.ps.ph\"",mName.c_str());
 
168
        }
 
169
        void getExtractFaces()const
 
170
        {
 
171
                fprintf(mFile,"\"%s.ef\"",mName.c_str());
 
172
        }
 
173
        void getExtractOffset()const
 
174
        {
 
175
                fprintf(mFile,"\"%s.eo\"",mName.c_str());
 
176
        }
 
177
        void getExtractOffsetX()const
 
178
        {
 
179
                fprintf(mFile,"\"%s.eo.eox\"",mName.c_str());
 
180
        }
 
181
        void getExtractOffsetY()const
 
182
        {
 
183
                fprintf(mFile,"\"%s.eo.eoy\"",mName.c_str());
 
184
        }
 
185
        void getExtractOffsetZ()const
 
186
        {
 
187
                fprintf(mFile,"\"%s.eo.eoz\"",mName.c_str());
 
188
        }
 
189
        void getDeleteFaces()const
 
190
        {
 
191
                fprintf(mFile,"\"%s.df\"",mName.c_str());
 
192
        }
 
193
        void getOnObject()const
 
194
        {
 
195
                fprintf(mFile,"\"%s.oo\"",mName.c_str());
 
196
        }
 
197
        void getCompId()const
 
198
        {
 
199
                fprintf(mFile,"\"%s.cid\"",mName.c_str());
 
200
        }
 
201
protected:
 
202
        PolyCut(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
203
                :PolyModifierWorld(file, name, parent, nodeType, shared, create) {}
 
204
 
 
205
};
 
206
}//namespace MayaDM
 
207
#endif//__MayaDM_POLYCUT_H__