fbtypes.h

Go to the documentation of this file.
00001 #ifndef __FBTYPES_H__
fbtypes.h
00002 #define __FBTYPES_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  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 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00043 #include <kaydaradef.h>
00044 
00045 #ifndef FBSDK_DLL
00046 
00049   #define FBSDK_DLL K_DLLIMPORT
00050 #endif
00051 
00052 #include <fbsdk/fbversion.h>
00053 
00054 #ifdef FBSDKUseNamespace
00055     namespace FBSDKNamespace {
00056 #endif
00057 
00058 
00062 #define FB_FORWARD( ClassName ) class ClassName; typedef ClassName *H##ClassName;
00063 
00064 
00068 #define __FB_FORWARD( ClassName ) \
00069     FB_FORWARD( ClassName ) \
00070     class Data##ClassName; typedef Data##ClassName *HData##ClassName
00071 
00072 
00074 enum kFbxObjectStore   { 
00075     kAttributes=1,  
00076     kRelations=2,   
00077     kAll=3,         
00078     kCleanup=8,     
00079     kData=16,       
00080     kMerge=32       
00081 };
00082 
00084 // New classes
00087 template <class tType> class FBSDK_DLL FBVector2
00088 { 
00089   private:
00090   public:
00091     tType mValue[2]; 
00092 
00093   public:
00094 
00096     FBVector2();
00097 
00099     FBVector2( const FBVector2& pVector );
00100 
00104     FBVector2( tType *pValue );
00105 
00110     FBVector2( tType p1,tType p2 );
00111 
00115     void Init();
00116 
00121     tType &operator[](int pIndex);
00122 
00126     void Set( tType *pValue );
00127 
00131     operator tType *() const;
00132 
00137     const FBVector2& operator = ( const FBVector2& pVector );
00138 };
00139 
00141 template <class tType> class FBSDK_DLL FBVector3
00142 { 
00143   private:
00144   public:
00145     tType mValue[3];    
00146 
00147   public:
00148 
00150     FBVector3();
00151 
00153     FBVector3( const FBVector3& pVector );
00154 
00158     FBVector3( tType *pValue );
00159 
00165     FBVector3( tType p1,tType p2, tType p3 = 0);
00166 
00170     void Init();
00171 
00176     tType &operator[](int pIndex);
00177 
00181     void Set( tType *pValue );
00182 
00186     operator tType *() const;
00187 
00192     const FBVector3& operator = ( const FBVector3& pVector );
00193 };
00194 
00196 template <class tType> class FBSDK_DLL FBVector4
00197 { 
00198   private:
00199   public:
00200 
00201     tType mValue[4];                
00202 
00204     FBVector4();
00205 
00207     FBVector4( const FBVector4& pVector );
00208 
00212     FBVector4( tType *pValue );
00213 
00220     FBVector4( tType p1,tType p2, tType p3, tType p4 = 1);
00221 
00225     void Init();
00226 
00231     tType &operator[](int pIndex);
00232 
00236     void Set( tType *pValue );
00237 
00241     operator tType *() const;
00242 
00247     const FBVector4& operator = ( const FBVector4& pVector );
00248 };
00249 
00251 class FBSDK_DLL FBMatrix
00252 { 
00253   private:
00254     double mValue[4][4];            
00255 
00256   public:
00260     FBMatrix();
00261 
00265     FBMatrix( const double *pValue );
00266 
00270     FBMatrix( const FBMatrix& pMatrix );
00271 
00273     void Identity();
00274 
00278     void Set( const double *pValue );
00279 
00283     operator double *() const;
00284 
00288     double **  GetData() const;
00289 
00293     double& operator () ( int i, int j );
00294 
00299     const FBMatrix& operator = ( const FBMatrix& pMatrix );
00300 };
00301 
00302 
00304 typedef class FBSDK_DLL FBVector2<double>   FBVector2d;  
00305 
00307 typedef class FBSDK_DLL FBVector3<double>   FBVector3d;  
00308 
00310 typedef class FBSDK_DLL FBVector4<double>   FBVector4d;
00311 
00312 
00314 class FBSDK_DLL FBColor : public FBVector3< double >
00315 {
00316   public:
00318     FBColor();
00319 
00323     FBColor( double *pValue );
00324 
00330     FBColor( double pRed, double pGreen, double pBlue);
00331 
00333     FBColor( const FBColor& pVector );
00334 
00339     double &operator[](int pIndex);
00340 
00344     operator double *() const;
00345 
00350     const FBColor& operator = ( const FBColor& pVector );
00351     void operator=(double *pValue);
00352     const FBVector3< double >& operator = ( const FBVector3< double >& pVector );
00353 };
00354 
00356 class FBSDK_DLL FBColorAndAlpha : public FBVector4< double >
00357 {
00358   public:
00360     FBColorAndAlpha();
00361 
00365     FBColorAndAlpha( double *pValue );
00366 
00373     FBColorAndAlpha( double pRed, double pGreen, double pBlue, double pAlpha=1.0);
00374 
00378     FBColorAndAlpha( const FBColor &pValue );
00379 
00381     FBColorAndAlpha( const FBColorAndAlpha& pVector );
00382 
00387     double &operator[](int pIndex);
00388 
00392     operator double *() const;
00393 
00398     const FBColorAndAlpha& operator = ( const FBColorAndAlpha& pVector );
00399     const FBColorAndAlpha& operator = ( const FBColor& pVector );
00400     void operator=(double *pValue);
00401     const FBVector4< double >& operator = ( const FBVector4< double >& pVector );
00402 };
00403 
00404 
00406 typedef FBColor*    HFBColor;
00407 
00409 typedef FBVector4<float>  FBColorF;  
00410 
00412 typedef FBColorF         *HFBColorF;  
00413 
00415 typedef FBVector2<double> FBVector2d;  
00416 
00418 typedef FBVector3<double> FBVector3d;  
00419 
00421 typedef FBVector4<double> FBVector4d;
00422 
00424 typedef FBVector3<double> FBRVector;
00425 
00427 typedef FBRVector        *HFBRVector; 
00428 
00430 typedef FBVector4<double> FBTVector;  
00431 
00433 typedef FBTVector        *HFBTVector; 
00434 
00436 typedef class FBSDK_DLL FBVector3< double > FBVector3Double;
00437 
00439 typedef class FBSDK_DLL FBVector4< double > FBVector4Double;
00440 
00442 class FBSDK_DLL FBSVector : public FBVector3< double >
00443 { 
00444   private:
00445   public:
00447     FBSVector();
00448 
00452     FBSVector( double *pValue );
00453 
00459     FBSVector( double p1,double p2, double p3=1.0 );
00460 
00465     void Init();
00466 };
00467 
00468 //typedef FBVector3<double> FBSVector; 
00470 
00471 typedef FBSVector*                          HFBSVector; 
00473 typedef class FBSDK_DLL FBVector4<double>   FBQuaternion;  
00475 typedef FBQuaternion*                       HFBQuaternion; 
00477 typedef class FBSDK_DLL FBVector2<float>    FBUV;
00479 typedef FBUV*                               HFBUV; 
00481 typedef class FBSDK_DLL FBVector4<float>    FBVertex;
00483 typedef FBVertex*                           HFBVertex; 
00485 typedef class FBSDK_DLL FBVector4<float>    FBNormal;  
00487 typedef FBNormal*                           HFBNormal; 
00488 
00490 // Global
00492 #ifdef FBSDKUseNamespace
00493     }
00494 #endif
00495 
00496 #endif
00497 

Please send us your comments about this page.