00001 
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXNURBSSURFACE_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXNURBSSURFACE_H
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
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     
00155 
00161     
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     
00197 
00198 
00199 
00200     int GetUSpanCount() const;
00201 
00202     
00203 
00204 
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 
00279 
00280 
00281 
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     
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 
00303     virtual void Destruct(bool pRecursive, bool pDependents);
00304 
00306     KFbxNurbsSurface& operator=(KFbxNurbsSurface const& pNurb);
00307 
00308     virtual KString     GetTypeName() const;
00309     virtual KStringList GetTypeFlags() const;
00310 
00311     kUInt mUOrder, mVOrder;
00312     int mUCount, mVCount;
00313     int mUStep, mVStep;
00314     ENurbType mUType, mVType;
00315 
00316     double* mUKnotVector;
00317     double* mVKnotVector;
00318 
00319     
00320     
00321 
00322     ESurfaceMode mSurfaceMode;
00323 
00324     
00325     bool mApplyFlipUV;
00326     bool mApplyFlipLinks;
00327 
00328     bool mFlipNormals;
00329 
00330 public:
00331     
00332     typedef enum
00333     {
00334         eNurbTypeUnknown,
00335         eWrongNumberOfControlPoint,
00336         eWeightTooSmall,
00337         
00338         
00339         eUKnotVectorError,
00340         eVKnotVectorError,
00341         eErrorCount
00342     } EError;
00343 
00344 protected:
00345     friend class KFbxGeometryConverter;
00346 
00347 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00348 
00349 };
00350 
00351 typedef KFbxNurbsSurface* HKFbxNurbsSurface;
00352 
00353 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00354 
00355 #endif // FBXFILESDK_KFBXPLUGINS_KFBXNURBSSURFACE_H
00356