kfbxnurbssurface.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXNURBSSURFACE_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXNURBSSURFACE_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2010 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 #include <fbxfilesdk/fbxfilesdk_def.h>
00042 
00043 #include <fbxfilesdk/kfbxplugins/kfbxnode.h>
00044 #include <fbxfilesdk/kfbxplugins/kfbxgeometry.h>
00045 
00046 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00047 
00048 class KFbxPatch;
00049 class KFbxSdkManager;
00050 
00060 class KFBX_DLL KFbxNurbsSurface : public KFbxGeometry
00061 {
00062     KFBXOBJECT_DECLARE(KFbxNurbsSurface,KFbxGeometry);
00063 public:
00065     virtual EAttributeType GetAttributeType() const;
00066 
00068     void Reset();
00069 
00074 
00078     void SetSurfaceMode(KFbxGeometry::ESurfaceMode pMode);
00079 
00083     inline ESurfaceMode GetSurfaceMode() const {return mSurfaceMode;}
00084 
00090     typedef enum
00091     {
00092         ePERIODIC,
00093         eCLOSED,
00094         eOPEN
00095     } ENurbType;
00096 
00105     void InitControlPoints(int pUCount, ENurbType pUType, int pVCount, ENurbType pVType);
00106 
00110     inline int GetUCount() const {return mUCount;}
00111 
00115     inline int GetVCount() const {return mVCount;}
00116 
00120     inline ENurbType GetNurbUType() const {return mUType;}
00121 
00125     inline ENurbType GetNurbVType() const {return mVType;}
00126 
00130     int GetUKnotCount() const;
00131 
00135     double* GetUKnotVector() const;
00136 
00140     int GetVKnotCount() const;
00141 
00145     double* GetVKnotVector() const;
00146 
00151     void SetOrder(kUInt pUOrder, kUInt pVOrder);
00152 
00156     inline int GetUOrder() const {return mUOrder;}
00157 
00161     inline int GetVOrder() const {return mVOrder;}
00162 
00168     void SetStep(int pUStep, int pVStep);
00169 
00173     inline int GetUStep() const {return mUStep;}
00174 
00178     inline int GetVStep() const {return mVStep;}
00179 
00185     int GetUSpanCount() const;
00186 
00192     int GetVSpanCount() const;
00193 
00195 
00200 
00204     void SetApplyFlipUV(bool pFlag);
00205 
00209     bool GetApplyFlipUV() const;
00210 
00214     void SetApplyFlipLinks(bool pFlag);
00215 
00219     bool GetApplyFlipLinks() const;
00220 
00224     bool GetApplyFlip() const { return GetApplyFlipUV() || GetApplyFlipLinks(); }
00225 
00230     void AddCurveOnSurface( KFbxNode* pCurve );
00231 
00236     KFbxNode* GetCurveOnSurface( int pIndex );
00237 
00242     KFbxNode const* GetCurveOnSurface( int pIndex ) const;
00243 
00247     int GetCurveOnSurfaceCount() const;
00248 
00253     bool RemoveCurveOnSurface( KFbxNode* pCurve );
00254 
00256 
00260     bool IsRational() const;
00261 
00262 
00264 //
00265 //  WARNING!
00266 //
00267 //  Anything beyond these lines may not be documented accurately and is
00268 //  subject to change without notice.
00269 //
00271 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00272 
00273     virtual KFbxObject& Copy(const KFbxObject& pObject);
00274     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00275 
00276     void SetFlipNormals(bool pFlipNormals);
00277     bool GetFlipNormals() const;
00278 
00279     bool IsValidKnots() const;
00280 protected:
00281     KFbxNurbsSurface(KFbxSdkManager& pManager, char const* pName);
00282     virtual void Destruct(bool pRecursive, bool pDependents);
00283 
00284     virtual KString     GetTypeName() const;
00285 
00286     kUInt mUOrder, mVOrder;
00287     int mUCount, mVCount;
00288     int mUStep, mVStep;
00289     ENurbType mUType, mVType;
00290 
00291     double* mUKnotVector;
00292     double* mVKnotVector;
00293 
00294     //int* mUMultiplicityVector;
00295     //int* mVMultiplicityVector;
00296 
00297     ESurfaceMode mSurfaceMode;
00298 
00299     // Export flags.
00300     bool mApplyFlipUV;
00301     bool mApplyFlipLinks;
00302 
00303     bool mFlipNormals;
00304 
00305 public:
00306     // Error identifiers, these are only used internally.
00307     typedef enum
00308     {
00309         eNurbTypeUnknown,
00310         eWrongNumberOfControlPoint,
00311         eWeightTooSmall,
00312         //eUMultiplicityVectorError,
00313         //eVMultiplicityVectorError,
00314         eUKnotVectorError,
00315         eVKnotVectorError,
00316         eErrorCount
00317     } EError;
00318 
00319 protected:
00320     friend class KFbxGeometryConverter;
00321 
00322 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00323 
00324 };
00325 
00326 typedef KFbxNurbsSurface* HKFbxNurbsSurface;
00327 
00328 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00329 
00330 #endif // FBXFILESDK_KFBXPLUGINS_KFBXNURBSSURFACE_H
00331