kfbxvector2.h

Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_VECTOR2_H_
00005 #define _FBXSDK_VECTOR2_H_
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 2001 - 2007 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material
00013  (collectively the "Data") in these files contain unpublished information
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by
00015  Canada and United States of America federal copyright law and by international
00016  treaties.
00017 
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE,
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE.
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE.
00028 
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE.
00039 
00040 **************************************************************************************/
00041 
00042 
00043 #include <kaydaradef.h>
00044 #ifndef KFBX_DLL 
00045     #define KFBX_DLL K_DLLIMPORT
00046 #endif
00047 
00048 #include <kaydara.h>
00049 #include <klib/karrayul.h>
00050 
00051 #ifndef MB_FBXSDK
00052 #include <kbaselib_nsuse.h>
00053 #endif
00054 
00055 #include <fbxfilesdk_nsbegin.h>
00056 
00060 class KFBX_DLL KFbxVector2
00061 {
00062 
00063 public:
00064 
00069 
00071     KFbxVector2();
00072 
00074     KFbxVector2(const KFbxVector2& pVector2);
00075 
00080     KFbxVector2(double pX, double pY);
00081     
00083     ~KFbxVector2();
00084 
00086 
00091     
00093     KFbxVector2& operator=(const KFbxVector2& pVector2);
00094     
00100     double& operator[](int pIndex);
00101 
00107     double GetAt(int pIndex);   
00108 
00114     void SetAt(int pIndex, double pValue);
00115 
00120     void Set(double pX, double pY);
00121     
00123 
00128 
00134     KFbxVector2 operator+(double pValue);
00135 
00141     KFbxVector2 operator-(double pValue);
00142 
00148     KFbxVector2 operator*(double pValue);
00149 
00155     KFbxVector2 operator/(double pValue);
00156 
00162     KFbxVector2& operator+=(double pValue);
00163 
00169     KFbxVector2& operator-=(double pValue);
00170 
00176     KFbxVector2& operator*=(double pValue);
00177 
00183     KFbxVector2& operator/=(double pValue);
00184     
00186 
00191 
00195     KFbxVector2 operator-();
00196     
00202     KFbxVector2 operator+(KFbxVector2& pVector);
00203 
00209     KFbxVector2 operator-(KFbxVector2& pVector);
00210 
00216     KFbxVector2 operator*(KFbxVector2& pVector);
00217 
00223     KFbxVector2 operator/(KFbxVector2& pVector);
00224 
00230     KFbxVector2& operator+=(KFbxVector2& pVector);
00231 
00237     KFbxVector2& operator-=(KFbxVector2& pVector);
00238 
00244     KFbxVector2& operator*=(KFbxVector2& pVector);
00245     
00252     KFbxVector2& operator/=(KFbxVector2& pVector);
00253 
00259     double DotProduct(KFbxVector2& pVector);
00260     
00262 
00267 
00272     bool operator==(KFbxVector2 const& pVector) const;
00273     
00278     bool operator!=(KFbxVector2 const& pVector) const;
00279     
00281 
00286 
00290     double Length();
00291 
00295     double SquareLength();
00296 
00301     double Distance(KFbxVector2& pVector);
00302 
00304     void Normalize();
00305 
00307 
00312 
00314     operator double* ();
00315 
00317     operator const double* ();
00318 
00319     operator const double* const();
00320 
00321     operator const double* () const;
00322 
00323     operator const double* const () const;
00324 
00326 
00327     // Vector data.
00328     double mData[2];
00329 
00330 };
00331 
00332 typedef  class KFBX_DLL KArrayTemplate<KFbxVector2>             KArrayKFbxVector2;
00333 
00334 #include <fbxfilesdk_nsend.h>
00335 
00336 #endif // #ifndef _FBXSDK_VECTOR2_H_
00337 
00338