source: NonGTP/FCollada/FUtils/FUDaeEnum.h @ 964

Revision 964, 5.5 KB checked in by igarcia, 18 years ago (diff)
RevLine 
[964]1/*
2        Copyright (C) 2005-2006 Feeling Software Inc.
3        MIT License: http://www.opensource.org/licenses/mit-license.php
4*/
5/*
6        Based on the FS Import classes:
7        Copyright (C) 2005-2006 Feeling Software Inc
8        Copyright (C) 2005-2006 Autodesk Media Entertainment
9        MIT License: http://www.opensource.org/licenses/mit-license.php
10*/
11
12#ifndef _FU_DAE_ENUM_H_
13#define _FU_DAE_ENUM_H_
14
15// Animation curve interpolation function
16// Defaults to the STEP interpolation by definition in COLLADA.
17// BEZIER is the more common interpolation type
18namespace FUDaeInterpolation
19{
20        enum Interpolation
21        {
22                STEP = 0, //equivalent to no interpolation
23                LINEAR,
24                BEZIER,
25
26                UNKNOWN,
27                DEFAULT = STEP,
28        };
29
30        FCOLLADA_EXPORT Interpolation FromString(const string& value);
31        const char* ToString(const Interpolation& value);
32};
33
34typedef vector<FUDaeInterpolation::Interpolation> FUDaeInterpolationList;
35
36// COLLADA generic degree function. Used by lights and the profile_COMMON materials.
37namespace FUDaeFunction
38{
39        enum Function
40        {
41                CONSTANT = 0,
42                LINEAR,
43                QUADRATIC,
44
45                UNKNOWN,
46                DEFAULT = CONSTANT,
47        };
48
49        FCOLLADA_EXPORT Function FromString(const char* value);
50        inline Function FromString(const string& value) { return FromString(value.c_str()); }
51};
52
53
54// Material texture channels. Used by profile_common materials to assign textures to channels/slots
55// Multi-texturing is done by assigning more than one texture per slot.
56// Defaults to diffuse texture slot
57#undef TRANSPARENT // Win32: GDI stupidely defines this in the global namespace
58namespace FUDaeTextureChannel
59{
60        enum Channel
61        {
62                AMBIENT = 0,
63                BUMP,
64                DIFFUSE,
65                DISPLACEMENT,
66                EMISSION,
67                FILTER,
68                OPACITY,
69                REFLECTION,
70                REFRACTION,
71                SHININESS,
72                SPECULAR,
73                SPECULAR_LEVEL,
74                TRANSPARENT,
75
76                COUNT,
77                UNKNOWN,
78                DEFAULT = DIFFUSE,
79        };
80
81        FCOLLADA_EXPORT Channel FromString(const string& value);
82};
83
84// Morph controller method
85// NORMALIZED implies that the morph targets all have absolute vertex positions
86// RELATIVE implies that the morph targets have relative vertex positions
87//
88// Whether the vertex position is relative or absolute is irrelevant,
89// as long as you use the correct weight generation function:
90// NORMALIZED: base_weight = 1.0f - SUM(weight[t])
91// RELATIVE: base_weight = 1.0f
92// and position[k] = SUM(weight[t][k] * position[t][k])
93#undef RELATIVE // Win32: GDI stupidely defines this in the global namespace
94namespace FUDaeMorphMethod
95{
96        enum Method
97        {
98                NORMALIZED = 0,
99                RELATIVE,
100
101                UNKNOWN,
102                DEFAULT = NORMALIZED,
103        };
104
105        FCOLLADA_EXPORT Method FromString(const char* value);
106        FCOLLADA_EXPORT const char* ToString(Method method);
107        inline Method FromString(const string& value) { return FromString(value.c_str()); }
108};
109
110// Maya uses the infinity to determine what happens outside an animation curve
111// Intentionally matches the MFnAnimCurve::InfinityType enum
112namespace FUDaeInfinity
113{
114        enum Infinity
115        {
116                CONSTANT = 0,
117                LINEAR,
118                CYCLE,
119                CYCLE_RELATIVE,
120                OSCILLATE,
121
122                UNKNOWN,
123                DEFAULT = CONSTANT
124        };
125
126        FCOLLADA_EXPORT Infinity FromString(const char* value);
127        FCOLLADA_EXPORT const char* ToString(Infinity infinity);
128        inline Infinity FromString(const string& value) { return FromString(value.c_str()); }
129};
130
131// Maya uses the blend mode for texturing purposes
132// Intentionally matches the equivalent Maya enum
133#undef IN
134#undef OUT
135#undef DIFFERENCE
136namespace FUDaeBlendMode
137{
138        enum Mode
139        {
140                NONE,
141                OVER,
142                IN,
143                OUT,
144                ADD,
145                SUBSTRACT,
146                MULTIPLY,
147                DIFFERENCE,
148                LIGHTEN,
149                DARKEN,
150                SATURATE,
151                DESATURATE,
152                ILLUMINATE,
153
154                UNKNOWN,
155                DEFAULT = NONE,
156        };
157
158        FCOLLADA_EXPORT Mode FromString(const char* value);
159        FCOLLADA_EXPORT const char* ToString(Mode mode);
160        inline Mode FromString(const string& value) { return FromString(value.c_str()); }
161}
162
163// Geometry Input Semantics
164// Found in the <mesh><vertices>, <mesh><polygons>...
165namespace FUDaeGeometryInput
166{
167        enum Semantic
168        {
169                POSITION = 0,
170                VERTEX,
171                NORMAL,
172                GEOTANGENT,
173                GEOBINORMAL,
174                TEXCOORD,
175                TEXTANGENT,
176                TEXBINORMAL,
177                UV,
178                COLOR,
179                EXTRA, // Maya-specific, used for blind data
180
181                UNKNOWN = -1,
182        };
183        typedef vector<Semantic> SemanticList;
184
185        FCOLLADA_EXPORT Semantic FromString(const char* value);
186    FCOLLADA_EXPORT const char* ToString(Semantic semantic);
187        inline Semantic FromString(const string& value) { return FromString(value.c_str()); }
188}
189
190/** The types of effect profiles. */
191namespace FUDaeProfileType
192{
193        /** Enumerates the types of effect profiles. */
194        enum Type
195        {
196                CG, /**< The CG profile. */
197                HLSL, /**< The HLSL profile for DirectX. */
198                GLSL, /**< The GLSL profile for OpenGL. */
199                GLES, /**< The GLES profile for OpenGL ES. */
200                COMMON, /**< The common profile which encapsulates the standard lighting equations: Lambert, Phong, Blinn. */
201
202                UNKNOWN /**< Not a valid profile type. */
203        };
204
205        /** Converts the COLLADA profile name string to a profile type.
206                Examples of COLLADA profile name strings are 'profile_CG' and 'profile_COMMON'.
207                @param value The profile name string.
208                @return The profile type. */
209        FCOLLADA_EXPORT Type FromString(const char* value);
210        inline Type FromString(const string& value) { return FromString(value.c_str()); } /**< See above. */
211
212        /** Converts the profile type to its COLLADA profile name string.
213                Examples of COLLADA profile name strings are 'profile_CG' and 'profile_COMMON'.
214                @param type The profile type.
215                @return The name string for the profile type. */
216        FCOLLADA_EXPORT const char* ToString(Type type);
217}
218
219#endif // _FU_DAE_ENUM_H_
220
Note: See TracBrowser for help on using the repository browser.