FUtils/FUDaeEnum.h

00001 /*
00002     Copyright (C) 2005-2006 Feeling Software Inc.
00003     MIT License: http://www.opensource.org/licenses/mit-license.php
00004 */
00005 /*
00006     Based on the FS Import classes:
00007     Copyright (C) 2005-2006 Feeling Software Inc
00008     Copyright (C) 2005-2006 Autodesk Media Entertainment
00009     MIT License: http://www.opensource.org/licenses/mit-license.php
00010 */
00011 
00012 #ifndef _FU_DAE_ENUM_H_
00013 #define _FU_DAE_ENUM_H_
00014 
00015 // Animation curve interpolation function
00016 // Defaults to the STEP interpolation by definition in COLLADA.
00017 // BEZIER is the more common interpolation type
00018 namespace FUDaeInterpolation
00019 {
00020     enum Interpolation
00021     {
00022         STEP = 0, //equivalent to no interpolation
00023         LINEAR,
00024         BEZIER,
00025 
00026         UNKNOWN,
00027         DEFAULT = STEP,
00028     };
00029 
00030     FCOLLADA_EXPORT Interpolation FromString(const string& value);
00031     const char* ToString(const Interpolation& value);
00032 };
00033 
00034 typedef vector<FUDaeInterpolation::Interpolation> FUDaeInterpolationList;
00035 
00036 // COLLADA generic degree function. Used by lights and the profile_COMMON materials.
00037 namespace FUDaeFunction
00038 {
00039     enum Function
00040     {
00041         CONSTANT = 0,
00042         LINEAR,
00043         QUADRATIC,
00044 
00045         UNKNOWN,
00046         DEFAULT = CONSTANT,
00047     };
00048 
00049     FCOLLADA_EXPORT Function FromString(const char* value);
00050     inline Function FromString(const string& value) { return FromString(value.c_str()); }
00051 };
00052 
00053 
00054 // Material texture channels. Used by profile_common materials to assign textures to channels/slots
00055 // Multi-texturing is done by assigning more than one texture per slot.
00056 // Defaults to diffuse texture slot
00057 #undef TRANSPARENT // Win32: GDI stupidely defines this in the global namespace
00058 namespace FUDaeTextureChannel
00059 {
00060     enum Channel
00061     {
00062         AMBIENT = 0,
00063         BUMP,
00064         DIFFUSE,
00065         DISPLACEMENT,
00066         EMISSION,
00067         FILTER,
00068         OPACITY,
00069         REFLECTION,
00070         REFRACTION,
00071         SHININESS,
00072         SPECULAR,
00073         SPECULAR_LEVEL,
00074         TRANSPARENT,
00075 
00076         COUNT,
00077         UNKNOWN,
00078         DEFAULT = DIFFUSE,
00079     };
00080 
00081     FCOLLADA_EXPORT Channel FromString(const string& value);
00082 };
00083 
00084 // Morph controller method
00085 // NORMALIZED implies that the morph targets all have absolute vertex positions
00086 // RELATIVE implies that the morph targets have relative vertex positions
00087 //
00088 // Whether the vertex position is relative or absolute is irrelevant,
00089 // as long as you use the correct weight generation function:
00090 // NORMALIZED: base_weight = 1.0f - SUM(weight[t])
00091 // RELATIVE: base_weight = 1.0f
00092 // and position[k] = SUM(weight[t][k] * position[t][k])
00093 #undef RELATIVE // Win32: GDI stupidely defines this in the global namespace
00094 namespace FUDaeMorphMethod
00095 {
00096     enum Method
00097     {
00098         NORMALIZED = 0,
00099         RELATIVE,
00100 
00101         UNKNOWN,
00102         DEFAULT = NORMALIZED,
00103     };
00104 
00105     FCOLLADA_EXPORT Method FromString(const char* value);
00106     FCOLLADA_EXPORT const char* ToString(Method method);
00107     inline Method FromString(const string& value) { return FromString(value.c_str()); }
00108 };
00109 
00110 // Maya uses the infinity to determine what happens outside an animation curve
00111 // Intentionally matches the MFnAnimCurve::InfinityType enum
00112 namespace FUDaeInfinity
00113 {
00114     enum Infinity
00115     {
00116         CONSTANT = 0,
00117         LINEAR,
00118         CYCLE,
00119         CYCLE_RELATIVE,
00120         OSCILLATE,
00121 
00122         UNKNOWN,
00123         DEFAULT = CONSTANT
00124     };
00125 
00126     FCOLLADA_EXPORT Infinity FromString(const char* value);
00127     FCOLLADA_EXPORT const char* ToString(Infinity infinity);
00128     inline Infinity FromString(const string& value) { return FromString(value.c_str()); }
00129 };
00130 
00131 // Maya uses the blend mode for texturing purposes
00132 // Intentionally matches the equivalent Maya enum
00133 #undef IN
00134 #undef OUT
00135 #undef DIFFERENCE
00136 namespace FUDaeBlendMode
00137 {
00138     enum Mode
00139     {
00140         NONE,
00141         OVER,
00142         IN,
00143         OUT,
00144         ADD,
00145         SUBSTRACT,
00146         MULTIPLY,
00147         DIFFERENCE,
00148         LIGHTEN,
00149         DARKEN,
00150         SATURATE,
00151         DESATURATE,
00152         ILLUMINATE,
00153 
00154         UNKNOWN,
00155         DEFAULT = NONE,
00156     };
00157 
00158     FCOLLADA_EXPORT Mode FromString(const char* value);
00159     FCOLLADA_EXPORT const char* ToString(Mode mode);
00160     inline Mode FromString(const string& value) { return FromString(value.c_str()); }
00161 }
00162 
00163 // Geometry Input Semantics
00164 // Found in the <mesh><vertices>, <mesh><polygons>...
00165 namespace FUDaeGeometryInput
00166 {
00167     enum Semantic
00168     {
00169         POSITION = 0,
00170         VERTEX,
00171         NORMAL,
00172         GEOTANGENT,
00173         GEOBINORMAL,
00174         TEXCOORD,
00175         TEXTANGENT,
00176         TEXBINORMAL,
00177         UV,
00178         COLOR,
00179         EXTRA, // Maya-specific, used for blind data
00180 
00181         UNKNOWN = -1,
00182     };
00183     typedef vector<Semantic> SemanticList;
00184 
00185     FCOLLADA_EXPORT Semantic FromString(const char* value);
00186     FCOLLADA_EXPORT const char* ToString(Semantic semantic);
00187     inline Semantic FromString(const string& value) { return FromString(value.c_str()); }
00188 }
00189 
00191 namespace FUDaeProfileType
00192 {
00194     enum Type
00195     {
00196         CG, 
00197         HLSL, 
00198         GLSL, 
00199         GLES, 
00200         COMMON, 
00202         UNKNOWN 
00203     };
00204 
00209     FCOLLADA_EXPORT Type FromString(const char* value);
00210     inline Type FromString(const string& value) { return FromString(value.c_str()); } 
00216     FCOLLADA_EXPORT const char* ToString(Type type);
00217 }
00218 
00219 #endif // _FU_DAE_ENUM_H_
00220 

Generated on Fri May 12 16:44:39 2006 for FCollada by  doxygen 1.4.6-NO