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

« back to all changes in this revision

Viewing changes to COLLADASaxFrameworkLoader/include/COLLADASaxFWLLibraryCamerasLoader.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 COLLADASaxFrameworkLoader.
 
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
 
 
11
#ifndef __COLLADASAXFWL_LIBRARYCAMERASLOADER_H__
 
12
#define __COLLADASAXFWL_LIBRARYCAMERASLOADER_H__
 
13
 
 
14
#include "COLLADASaxFWLPrerequisites.h"
 
15
#include "COLLADASaxFWLFilePartLoader.h"
 
16
#include "COLLADASaxFWLXmlTypes.h"
 
17
 
 
18
 
 
19
namespace COLLADAFW
 
20
{
 
21
        class Camera;
 
22
}
 
23
 
 
24
namespace COLLADASaxFWL
 
25
{
 
26
 
 
27
    /** Loads all the cameras in a library cameras.  */
 
28
        class LibraryCamerasLoader : public FilePartLoader
 
29
        {
 
30
        private:
 
31
                /** The current camera.*/
 
32
                COLLADAFW::Camera* mCurrentCamera;
 
33
 
 
34
                /** The current camera has xfov or xmag ( depending on optics ).*/
 
35
                bool mCurrentCameraHasX;
 
36
 
 
37
                /** The current camera has yfov or ymag ( depending on optics ).*/
 
38
                bool mCurrentCameraHasY;
 
39
 
 
40
                /** The current camera has apect ratio.*/
 
41
                bool mCurrentCameraHasAspectRatio;
 
42
 
 
43
                /** True, if we are inside an optics element, false otherwise. Is used extra tag key generation.*/
 
44
                bool mInOptics;
 
45
 
 
46
        public:
 
47
 
 
48
        /** Constructor. */
 
49
                LibraryCamerasLoader( IFilePartLoader* callingFilePartLoader  );
 
50
 
 
51
        /** Destructor. */
 
52
                virtual ~LibraryCamerasLoader();
 
53
 
 
54
                /** Resets all the variables used for the current camera.*/
 
55
                void resetCurrentValues();
 
56
 
 
57
        /** Returns the unique id of the current parsed object. */
 
58
        virtual const COLLADAFW::UniqueId& getUniqueId();
 
59
 
 
60
                /** Finishes loading a library cameras.*/
 
61
                virtual bool end__library_cameras();
 
62
 
 
63
 
 
64
                /** Creates a new camera.*/
 
65
                virtual bool begin__camera( const camera__AttributeData& attributeData );
 
66
 
 
67
                /** Sends camera to the writer.*/
 
68
                virtual bool end__camera();
 
69
 
 
70
 
 
71
                /** Store that we are inside an optics element.*/
 
72
                virtual bool begin__optics(){mInOptics = true; return true;}
 
73
 
 
74
                /** Store that we are NOT inside an optics element.*/
 
75
                virtual bool end__optics(){mInOptics = false; return true;}
 
76
 
 
77
 
 
78
                /** We don't need to do anything here.*/
 
79
                virtual bool begin__optics__technique_common(){return true;}
 
80
 
 
81
                /** We don't need to do anything here.*/
 
82
                virtual bool end__optics__technique_common(){return true;}
 
83
 
 
84
 
 
85
                /** Set camera type to perspective.*/
 
86
                virtual bool begin__perspective();
 
87
 
 
88
                /** We don't need to do anything here.*/
 
89
                virtual bool end__perspective(){return true;}
 
90
 
 
91
 
 
92
                /** Set camera type to orthographic.*/
 
93
                virtual bool begin__orthographic();
 
94
 
 
95
                /** We don't need to do anything here.*/
 
96
                virtual bool end__orthographic(){return true;}
 
97
 
 
98
 
 
99
                /** Add animatable float to sid tree*/
 
100
                virtual bool begin__xfov( const xfov__AttributeData& attributeData );
 
101
 
 
102
                /** Move up in sid tree.*/
 
103
                virtual bool end__xfov();
 
104
                
 
105
                /** Stores the xfov of the current camera.*/
 
106
                virtual bool data__xfov( float value );
 
107
 
 
108
 
 
109
                /** Add animatable float to sid tree*/
 
110
                virtual bool begin__yfov( const yfov__AttributeData& attributeData );
 
111
 
 
112
                /** Move up in sid tree.*/
 
113
                virtual bool end__yfov();
 
114
 
 
115
                /** Stores the yfov of the current camera.*/
 
116
                virtual bool data__yfov( float value );
 
117
 
 
118
 
 
119
                /** Add animatable float to sid tree*/
 
120
                virtual bool begin__xmag( const xmag__AttributeData& attributeData );
 
121
 
 
122
                /** Move up in sid tree.*/
 
123
                virtual bool end__xmag();
 
124
 
 
125
                /** Stores the xmag of the current camera.*/
 
126
                virtual bool data__xmag( float value );
 
127
 
 
128
 
 
129
                /** Add animatable float to sid tree*/
 
130
                virtual bool begin__ymag( const ymag__AttributeData& attributeData );
 
131
 
 
132
                /** Move up in sid tree.*/
 
133
                virtual bool end__ymag();
 
134
 
 
135
                /** Stores the ymag of the current camera.*/
 
136
                virtual bool data__ymag( float value );
 
137
 
 
138
 
 
139
                /** Add animatable float to sid tree*/
 
140
                virtual bool begin__aspect_ratio( const aspect_ratio__AttributeData& attributeData );
 
141
 
 
142
                /** Move up in sid tree.*/
 
143
                virtual bool end__aspect_ratio();
 
144
 
 
145
                /** Stores the aspect ratio of the current camera.*/
 
146
                virtual bool data__aspect_ratio( float value );
 
147
 
 
148
 
 
149
                /** Add animatable float to sid tree*/
 
150
                virtual bool begin__znear( const znear__AttributeData& attributeData );
 
151
 
 
152
                /** Move up in sid tree.*/
 
153
                virtual bool end__znear();
 
154
 
 
155
                /** Stores the near clipping plane of the current camera.*/
 
156
                virtual bool data__znear( float value );
 
157
 
 
158
 
 
159
                /** Add animatable float to sid tree*/
 
160
                virtual bool begin__zfar( const zfar__AttributeData& attributeData );
 
161
 
 
162
                /** Move up in sid tree.*/
 
163
                virtual bool end__zfar();
 
164
 
 
165
                /** Stores the far clipping plane of the current camera.*/
 
166
                virtual bool data__zfar( float value );
 
167
 
 
168
 
 
169
                /** We don't need to do anything here.*/
 
170
                virtual bool begin__imager(){return true;}
 
171
 
 
172
                /** We don't need to do anything here.*/
 
173
                virtual bool end__imager(){return true;}
 
174
 
 
175
    private:
 
176
 
 
177
        /** Disable default copy ctor. */
 
178
                LibraryCamerasLoader( const LibraryCamerasLoader& pre );
 
179
 
 
180
        /** Disable default assignment operator. */
 
181
                const LibraryCamerasLoader& operator= ( const LibraryCamerasLoader& pre );
 
182
 
 
183
        };
 
184
 
 
185
} // namespace COLLADASAXFWL
 
186
 
 
187
#endif // __COLLADASAXFWL_LIBRARYCAMERASLOADER_H__