kfbxnurb.h

Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_NURB_H_
00005 #define _FBXSDK_NURB_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 #include <kaydaradef.h>
00043 #ifndef KFBX_DLL 
00044     #define KFBX_DLL K_DLLIMPORT
00045 #endif
00046 
00047 #include <kaydara.h>
00048 
00049 #include <kfbxplugins/kfbxgeometry.h>
00050 
00051 #include <fbxfilesdk_nsbegin.h>
00052 
00053 class KFbxPatch;
00054 class KFbxSdkManager;
00055 class KFbxNurb_internal;
00056 
00057 
00067 class KFBX_DLL KFbxNurb : public KFbxGeometry 
00068 {
00069     KFBXOBJECT_DECLARE(KFbxNurb);
00070 public:
00072     virtual EAttributeType GetAttributeType() const;
00073 
00075     void Reset();
00076 
00081 
00085     void SetSurfaceMode(KFbxGeometry::ESurfaceMode pMode);
00086 
00090     inline ESurfaceMode GetSurfaceMode() const {return mSurfaceMode;}
00091 
00097     typedef enum 
00098     {
00099         ePERIODIC, 
00100         eCLOSED, 
00101         eOPEN 
00102     } ENurbType;
00103 
00112     void InitControlPoints(int pUCount, ENurbType pUType, int pVCount, ENurbType pVType);
00113 
00117     inline int GetUCount() const {return mUCount;}
00118     
00122     inline int GetVCount() const {return mVCount;}
00123     
00127     inline ENurbType GetNurbUType() const {return mUType;}
00128     
00132     inline ENurbType GetNurbVType() const {return mVType;}
00133 
00137     int GetUKnotCount() const;
00138 
00142     double* GetUKnotVector() const;
00143     
00147     int GetVKnotCount() const;
00148 
00152     double* GetVKnotVector() const;
00153     
00159     int* GetUMultiplicityVector() const;
00160     
00166     int* GetVMultiplicityVector() const;
00167 
00172     void SetOrder(kUInt pUOrder, kUInt pVOrder);
00173 
00177     inline int GetUOrder() const {return mUOrder;}
00178     
00182     inline int GetVOrder() const {return mVOrder;}
00183 
00189     void SetStep(int pUStep, int pVStep);
00190 
00194     inline int GetUStep() const {return mUStep;}
00195     
00199     inline int GetVStep() const {return mVStep;}
00200 
00205     int GetUSpanCount() const;
00206 
00211     int GetVSpanCount() const; 
00212 
00214 
00219 
00223     void SetApplyFlipUV(bool pFlag);
00224 
00228     bool GetApplyFlipUV() const;
00229 
00233     void SetApplyFlipLinks(bool pFlag);
00234 
00238     bool GetApplyFlipLinks() const;
00239 
00243     bool GetApplyFlip() const { return GetApplyFlipUV() || GetApplyFlipLinks(); }
00244 
00246 
00248 //
00249 //  WARNING!
00250 //
00251 //  Anything beyond these lines may not be documented accurately and is 
00252 //  subject to change without notice.
00253 //
00255 
00256 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00257 
00258 public:
00259 
00260     virtual KObject*  GetFbxObject_internal();
00261     virtual KObject const*  GetFbxObject_internal() const;
00262 
00263     // Clone
00264     virtual KFbxObject* Clone(KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00265 
00266 protected:
00267     static char const* GetNamePrefix() { return 0; }
00268 
00269     KFbxNurb(KFbxSdkManager& pManager, char const* pName);
00270     virtual ~KFbxNurb();
00271 
00272     virtual void Destruct(bool pRecursive, bool pDependents);
00273 
00275     KFbxNurb& operator=(KFbxNurb const& pNurb);
00276 
00277     virtual KString     GetTypeName() const;
00278     virtual KStringList GetTypeFlags() const;
00279 
00280     kUInt mUOrder, mVOrder;
00281     int mUCount, mVCount;
00282     int mUStep, mVStep;
00283     ENurbType mUType, mVType;
00284     
00285     double* mUKnotVector;
00286     double* mVKnotVector;
00287     
00288     int* mUMultiplicityVector;
00289     int* mVMultiplicityVector;
00290 
00291     ESurfaceMode mSurfaceMode;
00292 
00293     // Export flags.
00294     bool mApplyFlipUV;
00295     bool mApplyFlipLinks;
00296 
00297     // Error identifiers, these are only used internally.
00298     typedef enum 
00299     {
00300         eNurbTypeUnknown,
00301         eWrongNumberOfControlPoint,
00302         eWeightTooSmall,
00303         eUMultiplicityVectorError,
00304         eVMultiplicityVectorError,
00305         eUKnotVectorError,
00306         eVKnotVectorError,
00307         eErrorCount
00308     } EError;
00309 
00310     // Internal Property Handler
00311     KFbxNurb_internal* mPH;
00312     
00313     friend class KFbxReaderFbx;
00314     friend class KFbxReaderFbx6;
00315     friend class KFbxWriterFbx;
00316     friend class KFbxWriterFbx6;
00317     friend class KFbxGeometryConverter;
00318 
00319 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00320 
00321 };
00322 
00323 typedef KFbxNurb* HKFbxNurb;
00324 
00325 #include <fbxfilesdk_nsend.h>
00326 
00327 #endif // #ifndef _FBXSDK_NURB_H_
00328 
00329