FBX SDK Reference Guide: kfbxnurbscurve.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_NURBS_CURVE_H_
00005 #define _FBXSDK_NURBS_CURVE_H_
00006 /**************************************************************************************
00007 
00008  Copyright  2001 - 2008 Autodesk, Inc. and/or its licensors.
00009  All Rights Reserved.
00010 
00011  The coded instructions, statements, computer programs, and/or related material 
00012  (collectively the "Data") in these files contain unpublished information 
00013  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00014  Canada and United States of America federal copyright law and by international 
00015  treaties. 
00016  
00017  The Data may not be disclosed or distributed to third parties, in whole or in
00018  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00019 
00020  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00021  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00022  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00023  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00024  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00025  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00026  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00027  
00028  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00029  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00030  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00031  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00032  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00033  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00034  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00035  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00036  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00037  OR DAMAGE. 
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 
00089 class KFBX_DLL KFbxNurbsCurve : public KFbxGeometry 
00090 {
00091     KFBXOBJECT_DECLARE(KFbxNurbsCurve,KFbxGeometry);
00092 public:
00093     // inhierited from KFbxNodeAttribute
00094     virtual KFbxNodeAttribute::EAttributeType GetAttributeType() const;
00095 
00100     enum EDimension
00101     {
00102         e2D = 2,
00103         e3D,
00104         eDIMENSIONS_COUNT = 2
00105     };
00106 
00112     enum EType
00113     {
00114         eOPEN,
00115         eCLOSED,
00116         ePERIODIC,
00117         eTYPE_COUNT
00118     }; 
00119 
00126     void InitControlPoints( int pCount, EType pVType );
00127 
00131     inline double* GetKnotVector() const { return mKnotVector; }
00132 
00136     int GetKnotCount() const;
00137 
00138     // Sets the order of the curve
00139     // Must be set before InitControlPoints() is called. 
00140     inline void SetOrder( int pOrder ) { mOrder = pOrder; }
00141 
00145     inline int GetOrder() const { return mOrder; }
00146 
00152     inline void SetDimension( EDimension pDimension ) { mDimension = pDimension; }
00153 
00157     inline EDimension GetDimension() const { return mDimension; }
00158 
00162     bool IsRational(); 
00163 
00176     int GetSpanCount();
00177 
00181     inline EType GetType() const { return mNurbType; }
00182 
00188     inline bool IsPolyline() const { return ( GetOrder() == 2 ); }
00189 
00195     bool IsBezier();
00196 
00197     // step? 
00198     // Need to know multiplicity?
00199 
00201 //
00202 //  WARNING!
00203 //
00204 //  Anything beyond these lines may not be documented accurately and is 
00205 //  subject to change without notice.
00206 //
00208 
00209 public:
00210     // Clone
00211     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00212 
00213     bool FullMultiplicity();
00214 
00215 protected:
00216 
00217     // Error identifiers, these are only used internally.
00218     typedef enum 
00219     {
00220         eNurbCurveTypeUnknown,
00221         eWeightTooSmall,
00222         eKnotVectorError,
00223         eWrongNumberOfControlPoint,
00224 
00225         /*
00226         
00227         eUMultiplicityVectorError,
00228         eVMultiplicityVectorError,
00229         ,
00230         eVKnotVectorError, */
00231         eErrorCount
00232     } EError;
00233 
00234     
00235     KFbxNurbsCurve(KFbxSdkManager& pManager, char const* pName);
00236     virtual ~KFbxNurbsCurve();
00237     
00239     KFbxNurbsCurve& operator=(KFbxNurbsCurve const& pNurb);
00240 
00241     void Reset();
00242 
00243     virtual KString GetTypeName() const;
00244     virtual KStringList GetTypeFlags() const;
00245 
00246     virtual void Destruct(bool pRecursive, bool pDependents);
00247 
00248 private:
00249     bool mIsRational;
00250     double* mKnotVector;
00251     EType mNurbType;
00252     int mOrder;
00253     EDimension mDimension; 
00254 
00255 public:
00256     friend class KFbxReaderFbx;
00257     friend class KFbxReaderFbx6;
00258     friend class KFbxWriterFbx;
00259     friend class KFbxWriterFbx6;
00260     friend class KFbxReaderFbx7;
00261     friend struct KFbxReaderFbx7Impl;
00262 };
00263 
00264 typedef KFbxNurbsCurve* HKFbxNurbsCurve;
00265 typedef class KFBX_DLL KArrayTemplate< KFbxNurbsCurve* > KArrayKFbxNurbsCurve;
00266 
00267 
00268 #include <fbxfilesdk_nsend.h>
00269 
00270 #endif //_FBXSDK_NURBS_CURVE_H_
00271 
00272