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_CAMERAVIEW_H__
11
#define __MayaDM_CAMERAVIEW_H__
12
#include "MayaDMTypes.h"
13
#include "MayaDMConnectables.h"
14
#include "MayaDMDependNode.h"
17
class CameraView : public DependNode
22
CameraView():DependNode(){}
23
CameraView(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
24
:DependNode(file, name, parent, "cameraView", shared, create){}
25
virtual ~CameraView(){}
27
void setEye(const double3& e)
29
if(e == double3(60.0, 45.0, 60.0)) return;
30
fprintf(mFile,"\tsetAttr \".e\" -type \"double3\" ");
34
void setEyeX(double ex)
37
fprintf(mFile,"\tsetAttr \".e.ex\" %f;\n", ex);
39
void setEyeY(double ey)
42
fprintf(mFile,"\tsetAttr \".e.ey\" %f;\n", ey);
44
void setEyeZ(double ez)
47
fprintf(mFile,"\tsetAttr \".e.ez\" %f;\n", ez);
49
void setCenterOfInterest(const double3& coi)
51
if(coi == double3(0, 0, 0)) return;
52
fprintf(mFile,"\tsetAttr \".coi\" -type \"double3\" ");
56
void setCenterOfInterestX(double cx)
59
fprintf(mFile,"\tsetAttr \".coi.cx\" %f;\n", cx);
61
void setCenterOfInterestY(double cy)
64
fprintf(mFile,"\tsetAttr \".coi.cy\" %f;\n", cy);
66
void setCenterOfInterestZ(double cz)
69
fprintf(mFile,"\tsetAttr \".coi.cz\" %f;\n", cz);
71
void setUp(const double3& u)
73
if(u == double3(0.0, 1.0, 0.0)) return;
74
fprintf(mFile,"\tsetAttr \".u\" -type \"double3\" ");
78
void setUpX(double ux)
81
fprintf(mFile,"\tsetAttr \".u.ux\" %f;\n", ux);
83
void setUpY(double uy)
86
fprintf(mFile,"\tsetAttr \".u.uy\" %f;\n", uy);
88
void setUpZ(double uz)
91
fprintf(mFile,"\tsetAttr \".u.uz\" %f;\n", uz);
93
void setTumblePivot(const double3& tp)
95
if(tp == double3(0.0, 0.0, 0.0)) return;
96
fprintf(mFile,"\tsetAttr \".tp\" -type \"double3\" ");
100
void setTumblePivotX(double tpx)
103
fprintf(mFile,"\tsetAttr \".tp.tpx\" %f;\n", tpx);
105
void setTumblePivotY(double tpy)
108
fprintf(mFile,"\tsetAttr \".tp.tpy\" %f;\n", tpy);
110
void setTumblePivotZ(double tpz)
113
fprintf(mFile,"\tsetAttr \".tp.tpz\" %f;\n", tpz);
115
void setHorizontalAperture(double ha)
118
fprintf(mFile,"\tsetAttr \".ha\" %f;\n", ha);
120
void setVerticalAperture(double va)
123
fprintf(mFile,"\tsetAttr \".va\" %f;\n", va);
125
void setFocalLength(double fl)
127
if(fl == 35.0) return;
128
fprintf(mFile,"\tsetAttr \".fl\" %f;\n", fl);
130
void setOrthographicWidth(double ow)
133
fprintf(mFile,"\tsetAttr \".ow\" %f;\n", ow);
135
void setOrthographic(bool o)
137
if(o == false) return;
138
fprintf(mFile,"\tsetAttr \".o\" %i;\n", o);
140
void setDescription(const string& d)
142
if(d == "NULL") return;
143
fprintf(mFile,"\tsetAttr \".d\" -type \"string\" ");
145
fprintf(mFile,";\n");
149
fprintf(mFile,"\"%s.e\"",mName.c_str());
153
fprintf(mFile,"\"%s.e.ex\"",mName.c_str());
157
fprintf(mFile,"\"%s.e.ey\"",mName.c_str());
161
fprintf(mFile,"\"%s.e.ez\"",mName.c_str());
163
void getCenterOfInterest()const
165
fprintf(mFile,"\"%s.coi\"",mName.c_str());
167
void getCenterOfInterestX()const
169
fprintf(mFile,"\"%s.coi.cx\"",mName.c_str());
171
void getCenterOfInterestY()const
173
fprintf(mFile,"\"%s.coi.cy\"",mName.c_str());
175
void getCenterOfInterestZ()const
177
fprintf(mFile,"\"%s.coi.cz\"",mName.c_str());
181
fprintf(mFile,"\"%s.u\"",mName.c_str());
185
fprintf(mFile,"\"%s.u.ux\"",mName.c_str());
189
fprintf(mFile,"\"%s.u.uy\"",mName.c_str());
193
fprintf(mFile,"\"%s.u.uz\"",mName.c_str());
195
void getTumblePivot()const
197
fprintf(mFile,"\"%s.tp\"",mName.c_str());
199
void getTumblePivotX()const
201
fprintf(mFile,"\"%s.tp.tpx\"",mName.c_str());
203
void getTumblePivotY()const
205
fprintf(mFile,"\"%s.tp.tpy\"",mName.c_str());
207
void getTumblePivotZ()const
209
fprintf(mFile,"\"%s.tp.tpz\"",mName.c_str());
211
void getHorizontalAperture()const
213
fprintf(mFile,"\"%s.ha\"",mName.c_str());
215
void getVerticalAperture()const
217
fprintf(mFile,"\"%s.va\"",mName.c_str());
219
void getFocalLength()const
221
fprintf(mFile,"\"%s.fl\"",mName.c_str());
223
void getOrthographicWidth()const
225
fprintf(mFile,"\"%s.ow\"",mName.c_str());
227
void getOrthographic()const
229
fprintf(mFile,"\"%s.o\"",mName.c_str());
231
void getDescription()const
233
fprintf(mFile,"\"%s.d\"",mName.c_str());
236
CameraView(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
237
:DependNode(file, name, parent, nodeType, shared, create) {}
241
#endif//__MayaDM_CAMERAVIEW_H__