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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMCameraView.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_CAMERAVIEW_H__
 
11
#define __MayaDM_CAMERAVIEW_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class CameraView : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
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(){}
 
26
 
 
27
        void setEye(const double3& e)
 
28
        {
 
29
                if(e == double3(60.0, 45.0, 60.0)) return;
 
30
                fprintf(mFile,"\tsetAttr \".e\" -type \"double3\" ");
 
31
                e.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setEyeX(double ex)
 
35
        {
 
36
                if(ex == 0) return;
 
37
                fprintf(mFile,"\tsetAttr \".e.ex\" %f;\n", ex);
 
38
        }
 
39
        void setEyeY(double ey)
 
40
        {
 
41
                if(ey == 0) return;
 
42
                fprintf(mFile,"\tsetAttr \".e.ey\" %f;\n", ey);
 
43
        }
 
44
        void setEyeZ(double ez)
 
45
        {
 
46
                if(ez == 0) return;
 
47
                fprintf(mFile,"\tsetAttr \".e.ez\" %f;\n", ez);
 
48
        }
 
49
        void setCenterOfInterest(const double3& coi)
 
50
        {
 
51
                if(coi == double3(0, 0, 0)) return;
 
52
                fprintf(mFile,"\tsetAttr \".coi\" -type \"double3\" ");
 
53
                coi.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setCenterOfInterestX(double cx)
 
57
        {
 
58
                if(cx == 0) return;
 
59
                fprintf(mFile,"\tsetAttr \".coi.cx\" %f;\n", cx);
 
60
        }
 
61
        void setCenterOfInterestY(double cy)
 
62
        {
 
63
                if(cy == 0) return;
 
64
                fprintf(mFile,"\tsetAttr \".coi.cy\" %f;\n", cy);
 
65
        }
 
66
        void setCenterOfInterestZ(double cz)
 
67
        {
 
68
                if(cz == 0) return;
 
69
                fprintf(mFile,"\tsetAttr \".coi.cz\" %f;\n", cz);
 
70
        }
 
71
        void setUp(const double3& u)
 
72
        {
 
73
                if(u == double3(0.0, 1.0, 0.0)) return;
 
74
                fprintf(mFile,"\tsetAttr \".u\" -type \"double3\" ");
 
75
                u.write(mFile);
 
76
                fprintf(mFile,";\n");
 
77
        }
 
78
        void setUpX(double ux)
 
79
        {
 
80
                if(ux == 0) return;
 
81
                fprintf(mFile,"\tsetAttr \".u.ux\" %f;\n", ux);
 
82
        }
 
83
        void setUpY(double uy)
 
84
        {
 
85
                if(uy == 0) return;
 
86
                fprintf(mFile,"\tsetAttr \".u.uy\" %f;\n", uy);
 
87
        }
 
88
        void setUpZ(double uz)
 
89
        {
 
90
                if(uz == 0) return;
 
91
                fprintf(mFile,"\tsetAttr \".u.uz\" %f;\n", uz);
 
92
        }
 
93
        void setTumblePivot(const double3& tp)
 
94
        {
 
95
                if(tp == double3(0.0, 0.0, 0.0)) return;
 
96
                fprintf(mFile,"\tsetAttr \".tp\" -type \"double3\" ");
 
97
                tp.write(mFile);
 
98
                fprintf(mFile,";\n");
 
99
        }
 
100
        void setTumblePivotX(double tpx)
 
101
        {
 
102
                if(tpx == 0) return;
 
103
                fprintf(mFile,"\tsetAttr \".tp.tpx\" %f;\n", tpx);
 
104
        }
 
105
        void setTumblePivotY(double tpy)
 
106
        {
 
107
                if(tpy == 0) return;
 
108
                fprintf(mFile,"\tsetAttr \".tp.tpy\" %f;\n", tpy);
 
109
        }
 
110
        void setTumblePivotZ(double tpz)
 
111
        {
 
112
                if(tpz == 0) return;
 
113
                fprintf(mFile,"\tsetAttr \".tp.tpz\" %f;\n", tpz);
 
114
        }
 
115
        void setHorizontalAperture(double ha)
 
116
        {
 
117
                if(ha == 3) return;
 
118
                fprintf(mFile,"\tsetAttr \".ha\" %f;\n", ha);
 
119
        }
 
120
        void setVerticalAperture(double va)
 
121
        {
 
122
                if(va == 2) return;
 
123
                fprintf(mFile,"\tsetAttr \".va\" %f;\n", va);
 
124
        }
 
125
        void setFocalLength(double fl)
 
126
        {
 
127
                if(fl == 35.0) return;
 
128
                fprintf(mFile,"\tsetAttr \".fl\" %f;\n", fl);
 
129
        }
 
130
        void setOrthographicWidth(double ow)
 
131
        {
 
132
                if(ow == 1) return;
 
133
                fprintf(mFile,"\tsetAttr \".ow\" %f;\n", ow);
 
134
        }
 
135
        void setOrthographic(bool o)
 
136
        {
 
137
                if(o == false) return;
 
138
                fprintf(mFile,"\tsetAttr \".o\" %i;\n", o);
 
139
        }
 
140
        void setDescription(const string& d)
 
141
        {
 
142
                if(d == "NULL") return;
 
143
                fprintf(mFile,"\tsetAttr \".d\" -type \"string\" ");
 
144
                d.write(mFile);
 
145
                fprintf(mFile,";\n");
 
146
        }
 
147
        void getEye()const
 
148
        {
 
149
                fprintf(mFile,"\"%s.e\"",mName.c_str());
 
150
        }
 
151
        void getEyeX()const
 
152
        {
 
153
                fprintf(mFile,"\"%s.e.ex\"",mName.c_str());
 
154
        }
 
155
        void getEyeY()const
 
156
        {
 
157
                fprintf(mFile,"\"%s.e.ey\"",mName.c_str());
 
158
        }
 
159
        void getEyeZ()const
 
160
        {
 
161
                fprintf(mFile,"\"%s.e.ez\"",mName.c_str());
 
162
        }
 
163
        void getCenterOfInterest()const
 
164
        {
 
165
                fprintf(mFile,"\"%s.coi\"",mName.c_str());
 
166
        }
 
167
        void getCenterOfInterestX()const
 
168
        {
 
169
                fprintf(mFile,"\"%s.coi.cx\"",mName.c_str());
 
170
        }
 
171
        void getCenterOfInterestY()const
 
172
        {
 
173
                fprintf(mFile,"\"%s.coi.cy\"",mName.c_str());
 
174
        }
 
175
        void getCenterOfInterestZ()const
 
176
        {
 
177
                fprintf(mFile,"\"%s.coi.cz\"",mName.c_str());
 
178
        }
 
179
        void getUp()const
 
180
        {
 
181
                fprintf(mFile,"\"%s.u\"",mName.c_str());
 
182
        }
 
183
        void getUpX()const
 
184
        {
 
185
                fprintf(mFile,"\"%s.u.ux\"",mName.c_str());
 
186
        }
 
187
        void getUpY()const
 
188
        {
 
189
                fprintf(mFile,"\"%s.u.uy\"",mName.c_str());
 
190
        }
 
191
        void getUpZ()const
 
192
        {
 
193
                fprintf(mFile,"\"%s.u.uz\"",mName.c_str());
 
194
        }
 
195
        void getTumblePivot()const
 
196
        {
 
197
                fprintf(mFile,"\"%s.tp\"",mName.c_str());
 
198
        }
 
199
        void getTumblePivotX()const
 
200
        {
 
201
                fprintf(mFile,"\"%s.tp.tpx\"",mName.c_str());
 
202
        }
 
203
        void getTumblePivotY()const
 
204
        {
 
205
                fprintf(mFile,"\"%s.tp.tpy\"",mName.c_str());
 
206
        }
 
207
        void getTumblePivotZ()const
 
208
        {
 
209
                fprintf(mFile,"\"%s.tp.tpz\"",mName.c_str());
 
210
        }
 
211
        void getHorizontalAperture()const
 
212
        {
 
213
                fprintf(mFile,"\"%s.ha\"",mName.c_str());
 
214
        }
 
215
        void getVerticalAperture()const
 
216
        {
 
217
                fprintf(mFile,"\"%s.va\"",mName.c_str());
 
218
        }
 
219
        void getFocalLength()const
 
220
        {
 
221
                fprintf(mFile,"\"%s.fl\"",mName.c_str());
 
222
        }
 
223
        void getOrthographicWidth()const
 
224
        {
 
225
                fprintf(mFile,"\"%s.ow\"",mName.c_str());
 
226
        }
 
227
        void getOrthographic()const
 
228
        {
 
229
                fprintf(mFile,"\"%s.o\"",mName.c_str());
 
230
        }
 
231
        void getDescription()const
 
232
        {
 
233
                fprintf(mFile,"\"%s.d\"",mName.c_str());
 
234
        }
 
235
protected:
 
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) {}
 
238
 
 
239
};
 
240
}//namespace MayaDM
 
241
#endif//__MayaDM_CAMERAVIEW_H__