FBX SDK Reference Guide: kfbxdatatypes.h Source File
00001 #ifndef _KFbxDataTypes_h
00002 #define _KFbxDataTypes_h
00003 
00004 /**************************************************************************************
00005 
00006  Copyright © 2001 - 2008 Autodesk, Inc. and/or its licensors.
00007  All Rights Reserved.
00008 
00009  The coded instructions, statements, computer programs, and/or related material 
00010  (collectively the "Data") in these files contain unpublished information 
00011  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00012  Canada and United States of America federal copyright law and by international 
00013  treaties. 
00014  
00015  The Data may not be disclosed or distributed to third parties, in whole or in
00016  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00017 
00018  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00019  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00020  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00021  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00022  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00023  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00024  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00028  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00029  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00030  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00031  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00032  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00033  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00034  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00035  OR DAMAGE. 
00036 
00037 **************************************************************************************/
00038 
00039 #include <kaydaradef.h>
00040 #ifndef KFBX_DLL
00041     #define KFBX_DLL K_DLLIMPORT
00042 #endif
00043 
00044 #ifndef MB_FBXSDK
00045 #include <kbaselib_nsuse.h>
00046 #endif
00047 #include <kbaselib_forward.h>
00048 #include <klib/kdebug.h>
00049 #include <klib/kstring.h>
00050 
00051 #include <kfbxplugins/kfbxtypes.h>
00052 #include <kfbxplugins/kfbxcolor.h>
00053 #include <kfbxmath/kfbxvector4.h>
00054 
00055 #include <fbxcore/kfbxpropertyhandle.h>
00056 
00057 #include <fbxfilesdk_nsbegin.h>
00058 
00059     class   KFbxSdkManager;
00060     class   KFbxTypeInfo_internal;
00061 
00065     class KFBX_DLL KFbxDataType {
00066 
00067         public:
00068             static KFbxDataType Create(const char *pName,EFbxType pType);
00069             static KFbxDataType Create(const char *pName,KFbxDataType const &pDataType);
00074 
00075             KFbxDataType();
00076 
00078             KFbxDataType( KFbxDataType const &pDataType );
00079 
00081             void Destroy();
00082 
00086             KFbxDataType( KFbxTypeInfoHandle const &pTypeInfoHandle );
00087 
00089             ~KFbxDataType();
00091 
00092 
00093         public:
00098             inline KFbxDataType& operator = (const KFbxDataType &pDataType) { mTypeInfoHandle=pDataType.mTypeInfoHandle; return *this;  }
00099 
00104 
00109             inline bool operator == (const KFbxDataType& pDataType) const   { return mTypeInfoHandle==pDataType.mTypeInfoHandle;        }
00110 
00115             inline bool operator != (const KFbxDataType& pDataType) const   { return mTypeInfoHandle!=pDataType.mTypeInfoHandle;        }
00117         public:
00118 
00122             inline bool     Valid() const { return mTypeInfoHandle.Valid(); }
00123 
00128             inline bool     Is(const KFbxDataType& pDataType) const { return mTypeInfoHandle.Is(pDataType.mTypeInfoHandle); }
00129 
00133             EFbxType        GetType() const;
00134 
00138             const char*     GetName() const;
00139 
00140         private:
00141             KFbxTypeInfoHandle      mTypeInfoHandle;
00142         public:
00146             inline KFbxTypeInfoHandle const &GetTypeInfoHandle() const  { return mTypeInfoHandle; }
00147 
00148         friend class KFbxSdkManager;
00149     };
00150 
00151     // Default Basic Types
00152     extern KFBX_DLL  KFbxDataType   DTNone;
00153     extern KFBX_DLL  KFbxDataType   DTBool;
00154     extern KFBX_DLL  KFbxDataType   DTInteger;
00155     extern KFBX_DLL  KFbxDataType   DTFloat;
00156     extern KFBX_DLL  KFbxDataType   DTDouble;
00157     extern KFBX_DLL  KFbxDataType   DTDouble2;
00158     extern KFBX_DLL  KFbxDataType   DTDouble3;
00159     extern KFBX_DLL  KFbxDataType   DTDouble4;
00160     extern KFBX_DLL  KFbxDataType   DTDouble44;
00161     extern KFBX_DLL  KFbxDataType   DTEnum;
00162     extern KFBX_DLL  KFbxDataType   DTStringList;   // ?
00163     extern KFBX_DLL  KFbxDataType   DTString;
00164     extern KFBX_DLL  KFbxDataType   DTCharPtr;      // ?
00165     extern KFBX_DLL  KFbxDataType   DTTime;
00166     extern KFBX_DLL  KFbxDataType   DTReference;
00167     extern KFBX_DLL  KFbxDataType   DTCompound;
00168     extern KFBX_DLL  KFbxDataType   DTBlob;
00169     extern KFBX_DLL  KFbxDataType   DTDistance;
00170     extern KFBX_DLL  KFbxDataType   DTDateTime;
00171 
00172     // MB Specific datatypes
00173     extern KFBX_DLL  KFbxDataType   DTAction;
00174     extern KFBX_DLL  KFbxDataType   DTEvent;
00175 
00176     // Specialised reference Properties
00177     extern KFBX_DLL  KFbxDataType   DTReferenceObject;
00178     extern KFBX_DLL  KFbxDataType   DTReferenceProperty;
00179 
00180     // Extended sub types
00181     extern KFBX_DLL  KFbxDataType   DTColor3;
00182     extern KFBX_DLL  KFbxDataType   DTColor4;
00183 
00184     // Support for older datatypes
00185     extern KFBX_DLL  KFbxDataType   DTReal;
00186     extern KFBX_DLL  KFbxDataType   DTVector3D;
00187     extern KFBX_DLL  KFbxDataType   DTVector4D;
00188 
00189     // Tranforms Types
00190     extern KFBX_DLL  KFbxDataType   DTTranslation;
00191     extern KFBX_DLL  KFbxDataType   DTRotation;
00192     extern KFBX_DLL  KFbxDataType   DTScaling;
00193     extern KFBX_DLL  KFbxDataType   DTQuaternion;
00194 
00195     extern KFBX_DLL  KFbxDataType   DTLocalTranslation;
00196     extern KFBX_DLL  KFbxDataType   DTLocalRotation;
00197     extern KFBX_DLL  KFbxDataType   DTLocalScaling;
00198     extern KFBX_DLL  KFbxDataType   DTLocalQuaternion;
00199 
00200     extern KFBX_DLL  KFbxDataType   DTTransformMatrix;
00201     extern KFBX_DLL  KFbxDataType   DTTranslationMatrix;
00202     extern KFBX_DLL  KFbxDataType   DTRotationMatrix;
00203     extern KFBX_DLL  KFbxDataType   DTScalingMatrix;
00204 
00205     // Material-related types (also used as DataType for Texture layer elements)
00206     extern KFBX_DLL  KFbxDataType DTMaterialEmissive;
00207     extern KFBX_DLL  KFbxDataType DTMaterialEmissiveFactor;
00208     extern KFBX_DLL  KFbxDataType DTMaterialAmbient;
00209     extern KFBX_DLL  KFbxDataType DTMaterialAmbientFactor;
00210     extern KFBX_DLL  KFbxDataType DTMaterialDiffuse;
00211     extern KFBX_DLL  KFbxDataType DTMaterialDiffuseFactor;
00212     extern KFBX_DLL  KFbxDataType DTMaterialBump;
00213     extern KFBX_DLL  KFbxDataType DTMaterialNormalMap;
00214     extern KFBX_DLL  KFbxDataType DTMaterialTransparentColor;
00215     extern KFBX_DLL  KFbxDataType DTMaterialTransparencyFactor;
00216     extern KFBX_DLL  KFbxDataType DTMaterialSpecular;
00217     extern KFBX_DLL  KFbxDataType DTMaterialSpecularFactor;
00218     extern KFBX_DLL  KFbxDataType DTMaterialShininess;
00219     extern KFBX_DLL  KFbxDataType DTMaterialReflection;
00220     extern KFBX_DLL  KFbxDataType DTMaterialReflectionFactor;
00221 
00222     // LayerElement
00223     extern KFBX_DLL  KFbxDataType DTLayerElementUndefined;
00224     extern KFBX_DLL  KFbxDataType DTLayerElementNormal;
00225     extern KFBX_DLL  KFbxDataType DTLayerElementMaterial;
00226     extern KFBX_DLL  KFbxDataType DTLayerElementTexture;
00227     extern KFBX_DLL  KFbxDataType DTLayerElementPolygonGroup;
00228     extern KFBX_DLL  KFbxDataType DTLayerElementUV;
00229     extern KFBX_DLL  KFbxDataType DTLayerElementVertexColor;
00230     extern KFBX_DLL  KFbxDataType DTLayerElementSmoothing;
00231     extern KFBX_DLL  KFbxDataType DTLayerElementUserData;
00232     extern KFBX_DLL  KFbxDataType DTLayerElementVisibility;
00233 
00234     // File references / External file references
00235     extern KFBX_DLL  KFbxDataType   DTUrl;
00236     extern KFBX_DLL  KFbxDataType   DTXRefUrl;
00237 
00238     // Motion Builder Specialised Types
00239     extern KFBX_DLL  KFbxDataType   DTIntensity;
00240     extern KFBX_DLL  KFbxDataType   DTConeAngle;
00241     extern KFBX_DLL  KFbxDataType   DTFog;
00242     extern KFBX_DLL  KFbxDataType   DTShape;
00243     extern KFBX_DLL  KFbxDataType   DTFieldOfView;
00244     extern KFBX_DLL  KFbxDataType   DTFieldOfViewX;
00245     extern KFBX_DLL  KFbxDataType   DTFieldOfViewY;
00246     extern KFBX_DLL  KFbxDataType   DTOpticalCenterX;
00247     extern KFBX_DLL  KFbxDataType   DTOpticalCenterY;
00248 
00249     extern KFBX_DLL  KFbxDataType   DTRoll;
00250     extern KFBX_DLL  KFbxDataType   DTCameraIndex;
00251     extern KFBX_DLL  KFbxDataType   DTTimeWarp;
00252     extern KFBX_DLL  KFbxDataType   DTVisibility;
00253 
00254     extern KFBX_DLL  KFbxDataType   DTTranslationUV;
00255     extern KFBX_DLL  KFbxDataType   DTScalingUV;
00256     extern KFBX_DLL  KFbxDataType   DTHSB;
00257 
00258     extern KFBX_DLL  KFbxDataType   DTOrientation;
00259     extern KFBX_DLL  KFbxDataType   DTLookAt;
00260 
00261     extern KFBX_DLL  KFbxDataType   DTOcclusion;
00262     extern KFBX_DLL  KFbxDataType   DTWeight;
00263 
00264     extern KFBX_DLL  KFbxDataType   DTIKReachTranslation;
00265     extern KFBX_DLL  KFbxDataType   DTIKReachRotation;
00266 
00267     KFBX_DLL KFbxDataType const & GetFbxDataType(EFbxType pType);
00268 
00269     // Internal use
00270     KFBX_DLL bool               KFbxTypesInit   (KFbxSdkManager *pManager);
00271     KFBX_DLL void               KFbxTypesRelease(KFbxSdkManager *pManager);
00272 
00273     KFBX_DLL char*              FbxDataTypeToFormatPropertyType( KFbxDataType const &pDataType );
00274     KFBX_DLL KFbxDataType const &FormatPropertyTypeToFbxDataType( const char *pDataTypeName );
00275 
00276 
00277 
00278 #include <fbxfilesdk_nsend.h>
00279 
00280 #endif // _KFbxTypes_h
00281 
00282