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  Copyright © 2002 - 2007 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 
00052 class KFbxNurbsCurve_internal;
00053 
00091 class KFBX_DLL KFbxNurbsCurve : public KFbxGeometry 
00092 {
00093     KFBXOBJECT_DECLARE(KFbxNurbsCurve);
00094 public:
00095     // inhierited from KFbxNodeAttribute
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     // Sets the order of the curve
00141     // Must be set before InitControlPoints() is called. 
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     // step? 
00207     // Need to know multiplicity?
00208 
00210 //
00211 //  WARNING!
00212 //
00213 //  Anything beyond these lines may not be documented accurately and is 
00214 //  subject to change without notice.
00215 //
00217 
00218 public:
00219     virtual KObject*  GetFbxObject_internal();
00220     virtual KObject const*  GetFbxObject_internal() const;
00221 
00222     // Clone
00223     virtual KFbxObject* Clone(KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00224 
00225     bool FullMultiplicity();
00226 
00227 protected:
00228 
00229     // Error identifiers, these are only used internally.
00230     typedef enum 
00231     {
00232         eNurbCurveTypeUnknown,
00233         eWeightTooSmall,
00234         eKnotVectorError,
00235         eWrongNumberOfControlPoint,
00236 
00237         /*
00238         
00239         eUMultiplicityVectorError,
00240         eVMultiplicityVectorError,
00241         ,
00242         eVKnotVectorError, */
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     // Internal Property Handler
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