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 - 2009 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/kfbxgeometry.h>
00046 
00047 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00048 
00086 class KFBX_DLL KFbxNurbsCurve : public KFbxGeometry 
00087 {
00088     KFBXOBJECT_DECLARE(KFbxNurbsCurve,KFbxGeometry);
00089 public:
00090     // inherited from KFbxNodeAttribute
00091     virtual KFbxNodeAttribute::EAttributeType GetAttributeType() const;
00092 
00097     enum EDimension
00098     {
00099         e2D = 2,
00100         e3D,
00101         eDIMENSIONS_COUNT = 2
00102     };
00103 
00109     enum EType
00110     {
00111         eOPEN,
00112         eCLOSED,
00113         ePERIODIC,
00114         eTYPE_COUNT
00115     }; 
00116 
00123     void InitControlPoints( int pCount, EType pVType );
00124 
00128     inline double* GetKnotVector() const { return mKnotVector; }
00129 
00133     int GetKnotCount() const;
00134 
00135     // Sets the order of the curve
00136     // Must be set before InitControlPoints() is called. 
00137     inline void SetOrder( int pOrder ) { mOrder = pOrder; }
00138 
00142     inline int GetOrder() const { return mOrder; }
00143 
00149     inline void SetDimension( EDimension pDimension ) { mDimension = pDimension; }
00150 
00154     inline EDimension GetDimension() const { return mDimension; }
00155 
00159     bool IsRational(); 
00160 
00161     void SetRational(bool pValue);
00162 
00175     int GetSpanCount();
00176 
00180     inline EType GetType() const { return mNurbType; }
00181 
00187     inline bool IsPolyline() const { return ( GetOrder() == 2 ); }
00188 
00194     bool IsBezier();
00195 
00196     // step? 
00197     // Need to know multiplicity?
00198 
00200 //
00201 //  WARNING!
00202 //
00203 //  Anything beyond these lines may not be documented accurately and is 
00204 //  subject to change without notice.
00205 //
00207 
00208 public:
00209     // Clone
00210     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00211 
00212     bool FullMultiplicity();
00213 
00214     // Error identifiers, these are only used internally.
00215     typedef enum 
00216     {
00217         eNurbCurveTypeUnknown,
00218         eWeightTooSmall,
00219         eKnotVectorError,
00220         eWrongNumberOfControlPoint,
00221 
00222         /*
00223         
00224         eUMultiplicityVectorError,
00225         eVMultiplicityVectorError,
00226         ,
00227         eVKnotVectorError, */
00228         eErrorCount
00229     } EError;
00230 
00231 protected:
00232     KFbxNurbsCurve(KFbxSdkManager& pManager, char const* pName);
00233     
00237     KFbxNurbsCurve& operator=(KFbxNurbsCurve const& pNurb);
00238 
00239     void Reset();
00240 
00241     virtual KString GetTypeName() const;
00242     virtual KStringList GetTypeFlags() const;
00243 
00244     virtual void Destruct(bool pRecursive, bool pDependents);
00245 
00246 public:
00247     //To maintain compatibility
00248     bool mIsRational;
00249 
00250 private:
00251     double* mKnotVector;
00252     EType mNurbType;
00253     int mOrder;
00254     EDimension mDimension; 
00255 };
00256 
00257 typedef KFbxNurbsCurve* HKFbxNurbsCurve;
00258 typedef class KFBX_DLL KArrayTemplate< KFbxNurbsCurve* > KArrayKFbxNurbsCurve;
00259 
00260 
00261 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00262 
00263 #endif // FBXFILESDK_KFBXPLUGINS_KFBXNURBSCURVE_H
00264