FBX SDK Reference Guide: kfbxnurbssurface.h Source File
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 © 2001 - 2008 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 <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00043 #include <fbxfilesdk/components/kbaselib/kaydara.h>
00044 
00045 #include <fbxfilesdk/kfbxplugins/kfbxnode.h>
00046 #include <fbxfilesdk/kfbxplugins/kfbxgeometry.h>
00047 
00048 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00049 
00050 class KFbxPatch;
00051 class KFbxSdkManager;
00052 
00062 class KFBX_DLL KFbxNurbsSurface : public KFbxGeometry
00063 {
00064     KFBXOBJECT_DECLARE(KFbxNurbsSurface,KFbxGeometry);
00065 public:
00067     virtual EAttributeType GetAttributeType() const { return KFbxNodeAttribute::eNURBS_SURFACE; }
00068 
00070     void Reset();
00071 
00076 
00080     void SetSurfaceMode(KFbxGeometry::ESurfaceMode pMode);
00081 
00085     inline ESurfaceMode GetSurfaceMode() const {return mSurfaceMode;}
00086 
00092     typedef enum
00093     {
00094         ePERIODIC,
00095         eCLOSED,
00096         eOPEN
00097     } ENurbType;
00098 
00107     void InitControlPoints(int pUCount, ENurbType pUType, int pVCount, ENurbType pVType);
00108 
00112     inline int GetUCount() const {return mUCount;}
00113 
00117     inline int GetVCount() const {return mVCount;}
00118 
00122     inline ENurbType GetNurbUType() const {return mUType;}
00123 
00127     inline ENurbType GetNurbVType() const {return mVType;}
00128 
00132     int GetUKnotCount() const;
00133 
00137     double* GetUKnotVector() const;
00138 
00142     int GetVKnotCount() const;
00143 
00147     double* GetVKnotVector() const;
00148 
00154     //int* GetUMultiplicityVector();
00155 
00161     //int* GetVMultiplicityVector();
00162 
00167     void SetOrder(kUInt pUOrder, kUInt pVOrder);
00168 
00172     inline int GetUOrder() const {return mUOrder;}
00173 
00177     inline int GetVOrder() const {return mVOrder;}
00178 
00184     void SetStep(int pUStep, int pVStep);
00185 
00189     inline int GetUStep() const {return mUStep;}
00190 
00194     inline int GetVStep() const {return mVStep;}
00195 
00196     /* Calculates the number of spans in the surface in the U direction.
00197      * See KFbxNurbsCurve::GetSpanCount() for more information.
00198      * \returns The number of spans in U if the surface has been initialized, -1 otherwise.
00199      */
00200     int GetUSpanCount() const;
00201 
00202     /* Calculates the number of spans in the surface in the V direction.
00203      * See KFbxNurbsCurve::GetSpanCount() for more information.
00204      * \returns The number of spans in V if the surface has been initialized, -1 otherwise.
00205      */
00206     int GetVSpanCount() const;
00207 
00209 
00214 
00218     void SetApplyFlipUV(bool pFlag);
00219 
00223     bool GetApplyFlipUV() const;
00224 
00228     void SetApplyFlipLinks(bool pFlag);
00229 
00233     bool GetApplyFlipLinks() const;
00234 
00238     bool GetApplyFlip() const { return GetApplyFlipUV() || GetApplyFlipLinks(); }
00239 
00244     void AddCurveOnSurface( KFbxNode* pCurve );
00245 
00250     KFbxNode* GetCurveOnSurface( int pIndex );
00251 
00256     KFbxNode const* GetCurveOnSurface( int pIndex ) const;
00257 
00260     int GetCurveOnSurfaceCount() const;
00261 
00266     bool RemoveCurveOnSurface( KFbxNode* pCurve );
00267 
00269 
00273     bool IsRational();
00274 
00275 
00277 //
00278 //  WARNING!
00279 //
00280 //  Anything beyond these lines may not be documented accurately and is
00281 //  subject to change without notice.
00282 //
00284 
00285 
00286 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00287 
00288 public:
00289 
00290     void SetFlipNormals(bool pFlipNormals);
00291 
00292     bool GetFlipNormals() const;
00293 
00294 
00295     // Clone
00296     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00297 
00298 protected:
00299 
00300 
00301     KFbxNurbsSurface(KFbxSdkManager& pManager, char const* pName);
00302     virtual ~KFbxNurbsSurface();
00303 
00304     virtual void Destruct(bool pRecursive, bool pDependents);
00305 
00307     KFbxNurbsSurface& operator=(KFbxNurbsSurface const& pNurb);
00308 
00309     virtual KString     GetTypeName() const;
00310     virtual KStringList GetTypeFlags() const;
00311 
00312     kUInt mUOrder, mVOrder;
00313     int mUCount, mVCount;
00314     int mUStep, mVStep;
00315     ENurbType mUType, mVType;
00316 
00317     double* mUKnotVector;
00318     double* mVKnotVector;
00319 
00320     //int* mUMultiplicityVector;
00321     //int* mVMultiplicityVector;
00322 
00323     ESurfaceMode mSurfaceMode;
00324 
00325     // Export flags.
00326     bool mApplyFlipUV;
00327     bool mApplyFlipLinks;
00328 
00329     bool mFlipNormals;
00330 
00331 public:
00332     // Error identifiers, these are only used internally.
00333     typedef enum
00334     {
00335         eNurbTypeUnknown,
00336         eWrongNumberOfControlPoint,
00337         eWeightTooSmall,
00338         //eUMultiplicityVectorError,
00339         //eVMultiplicityVectorError,
00340         eUKnotVectorError,
00341         eVKnotVectorError,
00342         eErrorCount
00343     } EError;
00344 
00345 protected:
00346     friend class KFbxGeometryConverter;
00347 
00348 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00349 
00350 };
00351 
00352 typedef KFbxNurbsSurface* HKFbxNurbsSurface;
00353 
00354 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00355 
00356 #endif // FBXFILESDK_KFBXPLUGINS_KFBXNURBSSURFACE_H
00357