2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of MayaDataModel.
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
10
#ifndef __MayaDM_POLYCUT_H__
11
#define __MayaDM_POLYCUT_H__
12
#include "MayaDMTypes.h"
13
#include "MayaDMConnectables.h"
14
#include "MayaDMPolyModifierWorld.h"
17
class PolyCut : public PolyModifierWorld
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){}
27
void setCutPlaneCenter(const double3& pc)
29
if(pc == double3(0.0, 0.0, 0.0)) return;
30
fprintf(mFile,"\tsetAttr \".pc\" -type \"double3\" ");
34
void setCutPlaneCenterX(double pcx)
37
fprintf(mFile,"\tsetAttr \".pc.pcx\" %f;\n", pcx);
39
void setCutPlaneCenterY(double pcy)
42
fprintf(mFile,"\tsetAttr \".pc.pcy\" %f;\n", pcy);
44
void setCutPlaneCenterZ(double pcz)
47
fprintf(mFile,"\tsetAttr \".pc.pcz\" %f;\n", pcz);
49
void setCutPlaneRotate(const double3& ro)
51
if(ro == double3(0.0, 0.0, 0.0)) return;
52
fprintf(mFile,"\tsetAttr \".ro\" -type \"double3\" ");
56
void setCutPlaneRotateX(double rx)
59
fprintf(mFile,"\tsetAttr \".ro.rx\" %f;\n", rx);
61
void setCutPlaneRotateY(double ry)
64
fprintf(mFile,"\tsetAttr \".ro.ry\" %f;\n", ry);
66
void setCutPlaneRotateZ(double rz)
69
fprintf(mFile,"\tsetAttr \".ro.rz\" %f;\n", rz);
71
void setCutPlaneSize(const double2& ps)
73
if(ps == double2(1.0, 1.0)) return;
74
fprintf(mFile,"\tsetAttr \".ps\" -type \"double2\" ");
78
void setCutPlaneWidth(double pw)
81
fprintf(mFile,"\tsetAttr \".ps.pw\" %f;\n", pw);
83
void setCutPlaneHeight(double ph)
86
fprintf(mFile,"\tsetAttr \".ps.ph\" %f;\n", ph);
88
void setExtractFaces(bool ef)
90
if(ef == false) return;
91
fprintf(mFile,"\tsetAttr \".ef\" %i;\n", ef);
93
void setExtractOffset(const double3& eo)
95
if(eo == double3(0.5, 0.5, 0.5)) return;
96
fprintf(mFile,"\tsetAttr \".eo\" -type \"double3\" ");
100
void setExtractOffsetX(double eox)
103
fprintf(mFile,"\tsetAttr \".eo.eox\" %f;\n", eox);
105
void setExtractOffsetY(double eoy)
108
fprintf(mFile,"\tsetAttr \".eo.eoy\" %f;\n", eoy);
110
void setExtractOffsetZ(double eoz)
113
fprintf(mFile,"\tsetAttr \".eo.eoz\" %f;\n", eoz);
115
void setDeleteFaces(bool df)
117
if(df == false) return;
118
fprintf(mFile,"\tsetAttr \".df\" %i;\n", df);
120
void setOnObject(bool oo)
122
if(oo == true) return;
123
fprintf(mFile,"\tsetAttr \".oo\" %i;\n", oo);
125
void getCutPlaneCenter()const
127
fprintf(mFile,"\"%s.pc\"",mName.c_str());
129
void getCutPlaneCenterX()const
131
fprintf(mFile,"\"%s.pc.pcx\"",mName.c_str());
133
void getCutPlaneCenterY()const
135
fprintf(mFile,"\"%s.pc.pcy\"",mName.c_str());
137
void getCutPlaneCenterZ()const
139
fprintf(mFile,"\"%s.pc.pcz\"",mName.c_str());
141
void getCutPlaneRotate()const
143
fprintf(mFile,"\"%s.ro\"",mName.c_str());
145
void getCutPlaneRotateX()const
147
fprintf(mFile,"\"%s.ro.rx\"",mName.c_str());
149
void getCutPlaneRotateY()const
151
fprintf(mFile,"\"%s.ro.ry\"",mName.c_str());
153
void getCutPlaneRotateZ()const
155
fprintf(mFile,"\"%s.ro.rz\"",mName.c_str());
157
void getCutPlaneSize()const
159
fprintf(mFile,"\"%s.ps\"",mName.c_str());
161
void getCutPlaneWidth()const
163
fprintf(mFile,"\"%s.ps.pw\"",mName.c_str());
165
void getCutPlaneHeight()const
167
fprintf(mFile,"\"%s.ps.ph\"",mName.c_str());
169
void getExtractFaces()const
171
fprintf(mFile,"\"%s.ef\"",mName.c_str());
173
void getExtractOffset()const
175
fprintf(mFile,"\"%s.eo\"",mName.c_str());
177
void getExtractOffsetX()const
179
fprintf(mFile,"\"%s.eo.eox\"",mName.c_str());
181
void getExtractOffsetY()const
183
fprintf(mFile,"\"%s.eo.eoy\"",mName.c_str());
185
void getExtractOffsetZ()const
187
fprintf(mFile,"\"%s.eo.eoz\"",mName.c_str());
189
void getDeleteFaces()const
191
fprintf(mFile,"\"%s.df\"",mName.c_str());
193
void getOnObject()const
195
fprintf(mFile,"\"%s.oo\"",mName.c_str());
197
void getCompId()const
199
fprintf(mFile,"\"%s.cid\"",mName.c_str());
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) {}
207
#endif//__MayaDM_POLYCUT_H__