kfbxnurbscurve.h
Go to the documentation of this file.00001 
00004 #ifndef _FBXSDK_NURBS_CURVE_H_
00005 #define _FBXSDK_NURBS_CURVE_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 #include <kaydaradef.h>
00042 #ifndef KFBX_DLL 
00043     #define KFBX_DLL K_DLLIMPORT
00044 #endif
00045 
00046 #include <kaydara.h>
00047 
00048 #include <kfbxplugins/kfbxgeometry.h>
00049 
00050 #include <fbxfilesdk_nsbegin.h>
00051 
00052 class KFbxNurbsCurve_internal;
00053 
00091 class KFBX_DLL KFbxNurbsCurve : public KFbxGeometry 
00092 {
00093     KFBXOBJECT_DECLARE(KFbxNurbsCurve);
00094 public:
00095     
00096     virtual KFbxNodeAttribute::EAttributeType GetAttributeType() const;
00097 
00102     enum EDimension
00103     {
00104         e2D = 2,
00105         e3D,
00106         eDIMENSIONS_COUNT = 2
00107     };
00108 
00114     enum EType
00115     {
00116         eOPEN,
00117         eCLOSED,
00118         ePERIODIC,
00119         eTYPE_COUNT
00120     }; 
00121 
00128     void InitControlPoints( int pCount, EType pVType );
00129 
00133     inline double* GetKnotVector() const { return mKnotVector; }
00134 
00138     int GetKnotCount() const;
00139 
00140     
00141     
00142     inline void SetOrder( int pOrder ) { mOrder = pOrder; }
00143 
00147     inline int GetOrder() const { return mOrder; }
00148 
00154     inline void SetDimension( EDimension dim ) { mDimension = dim; }
00155 
00159     inline EDimension GetDimension() const { return mDimension; }
00160 
00166     inline K_DEPRECATED void SetRational( bool pRational ) { mIsRational = pRational; }
00167 
00171     bool IsRational(); 
00172 
00185     int GetSpanCount();
00186 
00190     inline EType GetType() const { return mNurbType; }
00191 
00197     inline bool IsPolyline() const { return ( GetOrder() == 2 ); }
00198 
00204     bool IsBezier();
00205 
00206     
00207     
00208 
00210 
00211 
00212 
00213 
00214 
00215 
00217 
00218 public:
00219     virtual KObject*  GetFbxObject_internal();
00220     virtual KObject const*  GetFbxObject_internal() const;
00221 
00222     
00223     virtual KFbxObject* Clone(KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00224 
00225     bool FullMultiplicity();
00226 
00227 protected:
00228 
00229     
00230     typedef enum 
00231     {
00232         eNurbCurveTypeUnknown,
00233         eWeightTooSmall,
00234         eKnotVectorError,
00235         eWrongNumberOfControlPoint,
00236 
00237         
00238 
00239 
00240 
00241 
00242 
00243         eErrorCount
00244     } EError;
00245 
00246     static char const* GetNamePrefix() { return 0; }
00247     
00248     KFbxNurbsCurve(KFbxSdkManager& pManager, char const* pName);
00249     virtual ~KFbxNurbsCurve();
00250     
00252     KFbxNurbsCurve& operator=(KFbxNurbsCurve const& pNurb);
00253 
00254     void Reset();
00255 
00256     virtual KString GetTypeName() const;
00257     virtual KStringList GetTypeFlags() const;
00258 
00259     virtual void Destruct(bool pRecursive, bool pDependents);
00260 
00261 private:
00262     bool mIsRational;
00263     double* mKnotVector;
00264     EType mNurbType;
00265     int mOrder;
00266     EDimension mDimension; 
00267 
00268     
00269     KFbxNurbsCurve_internal* mPH;
00270 
00271 
00272 public:
00273     friend class KFbxReaderFbx;
00274     friend class KFbxReaderFbx6;
00275     friend class KFbxWriterFbx;
00276     friend class KFbxWriterFbx6;
00277 };
00278 
00279 typedef KFbxNurbsCurve* HKFbxNurbsCurve;
00280 typedef class KFBX_DLL KArrayTemplate< KFbxNurbsCurve* > KArrayKFbxNurbsCurve;
00281 
00282 
00283 #include <fbxfilesdk_nsend.h>
00284 
00285 #endif //_FBXSDK_NURBS_CURVE_H_
00286 
00287