kfbxnurbscurve.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXNURBSCURVE_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXNURBSCURVE_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/kfbxgeometry.h>
00044 #include <fbxfilesdk/kfbxplugins/kfbxline.h>
00045 
00046 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00047 
00085 class KFBX_DLL KFbxNurbsCurve : public KFbxGeometry 
00086 {
00087     KFBXOBJECT_DECLARE(KFbxNurbsCurve,KFbxGeometry);
00088 public:
00090     virtual KFbxNodeAttribute::EAttributeType GetAttributeType() const;
00091 
00096     enum EDimension
00097     {
00098         e2D = 2,
00099         e3D,
00100         eDIMENSIONS_COUNT = 2
00101     };
00102 
00108     enum EType
00109     {
00110         eOPEN,
00111         eCLOSED,
00112         ePERIODIC,
00113         eTYPE_COUNT
00114     }; 
00115 
00122     void InitControlPoints( int pCount, EType pVType );
00123 
00127     inline double* GetKnotVector() const { return mKnotVector; }
00128 
00132     int GetKnotCount() const;
00133 
00138     inline void SetOrder( int pOrder ) { mOrder = pOrder; }
00139 
00143     inline int GetOrder() const { return mOrder; }
00144 
00149     inline void SetStep( int pStep ) { mStep = pStep; }
00150 
00155     inline int GetStep() const { return mStep; }
00156 
00162     inline void SetDimension( EDimension pDimension ) { mDimension = pDimension; }
00163 
00167     inline EDimension GetDimension() const { return mDimension; }
00168 
00172     bool IsRational(); 
00173 
00186     int GetSpanCount() const;
00187 
00191     inline EType GetType() const { return mNurbType; }
00192 
00198     inline bool IsPolyline() const { return ( GetOrder() == 2 ); }
00199 
00204     bool IsBezier() const;
00205 
00211     int TessellateCurve(KArrayTemplate<KFbxVector4>& pPointArray, int pStep = 16);
00212 
00217     KFbxLine* TessellateCurve(int pStep = 16);
00218 
00220 //
00221 //  WARNING!
00222 //
00223 //  Anything beyond these lines may not be documented accurately and is 
00224 //  subject to change without notice.
00225 //
00227 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00228 
00229     virtual KFbxObject& Copy(const KFbxObject& pObject);
00230 
00231     bool FullMultiplicity() const;
00232 
00233     // Error identifiers, these are only used internally.
00234     typedef enum 
00235     {
00236         eNurbCurveTypeUnknown,
00237         eWeightTooSmall,
00238         eKnotVectorError,
00239         eWrongNumberOfControlPoint,
00240 
00241         /*
00242         
00243         eUMultiplicityVectorError,
00244         eVMultiplicityVectorError,
00245         ,
00246         eVKnotVectorError, */
00247         eErrorCount
00248     } EError;
00249 
00250 protected:
00251     KFbxNurbsCurve(KFbxSdkManager& pManager, char const* pName);
00252     
00253     void Reset();
00254 
00255     virtual void Destruct(bool pRecursive, bool pDependents);
00256 
00257 public:
00258     //To maintain compatibility
00259     bool mIsRational;
00260 
00261 private:
00262     double* mKnotVector;
00263     EType mNurbType;
00264     int mOrder;
00265     EDimension mDimension; 
00266     //To tessellate curve, it denotes the evaluation frequency between two neighbor knots.
00267     int mStep;
00268 #endif
00269 };
00270 
00271 typedef KFbxNurbsCurve* HKFbxNurbsCurve;
00272 typedef class KFBX_DLL KArrayTemplate< KFbxNurbsCurve* > KArrayKFbxNurbsCurve;
00273 
00274 
00275 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00276 
00277 #endif // FBXFILESDK_KFBXPLUGINS_KFBXNURBSCURVE_H
00278