kfbxtrimnurbssurface.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXTRIMNURBSSURFACE_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXTRIMNURBSSURFACE_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/kfbxnurbssurface.h>
00045 #include <fbxfilesdk/kfbxplugins/kfbxnurbscurve.h>
00046 #include <fbxfilesdk/kfbxplugins/kfbxgenericnode.h>
00047 
00048 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00049 
00056 class KFBX_DLL KFbxBoundary : public KFbxGeometry
00057 {
00058     KFBXOBJECT_DECLARE(KFbxBoundary,KFbxGeometry);
00059 
00060 public:
00061 
00063     static const char* sOuterFlag;
00064 
00069     KFbxTypedProperty<fbxBool1> OuterFlag;
00070 
00074     void AddCurve( KFbxNurbsCurve* pCurve );
00075 
00079     int GetCurveCount() const;
00080 
00087     KFbxNurbsCurve* GetCurve( int pIndex );
00088 
00095     KFbxNurbsCurve const* GetCurve( int pIndex ) const;
00096 
00097 
00099     virtual EAttributeType GetAttributeType() const;
00100 
00105     bool IsPointInControlHull(const KFbxVector4& pPoint );
00106 
00110     KFbxVector4 ComputePointInBoundary();
00111 
00112 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00114 //
00115 //  WARNING!
00116 //
00117 //  Anything beyond these lines may not be documented accurately and is
00118 //  subject to change without notice.
00119 //
00121 
00122     virtual KFbxObject& Copy(const KFbxObject& pObject);
00123     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00124 
00125 protected:
00126     KFbxBoundary(KFbxSdkManager& pManager, char const* pName);
00127     virtual void Construct(const KFbxBoundary* pFrom);
00128 
00129     virtual KString GetTypeName() const;
00130     void Reset();
00131 
00132     bool LineSegmentIntersect( const KFbxVector4 & pStart1, const KFbxVector4 & pEnd1,
00133                                const KFbxVector4 & pStart2, const KFbxVector4 & pEnd2 ) const;
00134 
00135 public:
00136     void ClearCurves();
00137     void CopyCurves( KFbxBoundary const& pOther );
00138     bool IsValid(bool mustClosed = true);
00139     bool IsCounterClockwise();
00140 
00141 #endif // DOXYGEN_SHOULD_SKIP_THIS
00142 };
00143 
00144 
00148 class KFBX_DLL KFbxTrimNurbsSurface : public KFbxGeometry
00149 {
00150     KFBXOBJECT_DECLARE(KFbxTrimNurbsSurface,KFbxGeometry);
00151 public:
00153     virtual EAttributeType GetAttributeType() const;
00154 
00155 
00160     int GetTrimRegionCount() const;
00161 
00165     void BeginTrimRegion();
00166 
00171     void EndTrimRegion();
00172 
00182     bool              AddBoundary( KFbxBoundary* pBoundary );
00183 
00191     KFbxBoundary*     GetBoundary( int pIndex, int pRegionIndex = 0 );
00192 
00200     KFbxBoundary const*     GetBoundary( int pIndex, int pRegionIndex = 0 ) const;
00201 
00206     int               GetBoundaryCount(int pRegionIndex = 0) const;
00207 
00211     void       SetNurbsSurface( KFbxNurbsSurface const* pNurbs );
00212 
00216     KFbxNurbsSurface* GetNurbsSurface();
00217 
00221     KFbxNurbsSurface const* GetNurbsSurface() const;
00222 
00227     inline void SetFlipNormals( bool pFlip ) { mFlipNormals = pFlip; }
00228 
00232     inline bool GetFlipNormals() const { return  mFlipNormals; }
00233 
00234 
00235 
00240 
00249     virtual int AddShape(KFbxShape* pShape, char const* pShapeName);
00250 
00256     virtual void ClearShape();
00257 
00264     virtual int GetShapeCount() const;
00265 
00273     virtual KFbxShape* GetShape(int pIndex);
00274 
00282     virtual KFbxShape const* GetShape(int pIndex) const;
00283 
00284 
00292     virtual char const* GetShapeName(int pIndex) const;
00293 
00294 
00295 
00304     virtual KFbxAnimCurve* GetShapeChannel(int pIndex, KFbxAnimLayer* pLayer, bool pCreateAsNeeded = false);
00305 
00312     virtual KFCurve* GetShapeChannel(int pIndex, bool pCreateAsNeeded = false, char const* pTakeName = NULL);
00314 
00318     virtual int GetControlPointsCount() const;
00319 
00325     virtual void SetControlPointAt(KFbxVector4 &pCtrlPoint, KFbxVector4 &pNormal , int pIndex);
00326 
00328     virtual KFbxVector4* GetControlPoints() const;
00329 
00330 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00332 //
00333 //  WARNING!
00334 //
00335 //  Anything beyond these lines may not be documented accurately and is
00336 //  subject to change without notice.
00337 //
00339 
00340     virtual KFbxObject& Copy(const KFbxObject& pObject);
00341     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00342 
00346     bool IsValid(bool mustClosed = true);
00347 
00348 protected:
00349     KFbxTrimNurbsSurface(KFbxSdkManager& pManager, char const* pName);
00350 
00351 public:
00352     virtual KString GetTypeName() const;
00353 
00354     void ClearBoundaries();
00355 
00356     void CopyBoundaries( KFbxTrimNurbsSurface const& pOther );
00357 
00358     bool IsValid(int pRegion, bool mustClosed = true);
00359 
00360     void RebuildRegions();
00361 
00362 private:
00363     bool mFlipNormals;
00364 
00365     KArrayTemplate<int> mRegionIndices;
00366 
00367     bool mNewRegion;
00368 
00369 #endif // DOXYGEN_SHOULD_SKIP_THIS
00370 };
00371 
00372 typedef KFbxTrimNurbsSurface*   HKFbxTrimNurbsSurface;
00373 typedef KFbxBoundary*           HKFbxBoundary;
00374 
00375 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00376 
00377 #endif // FBXFILESDK_KFBXPLUGINS_KFBXTRIMNURBSSURFACE_H
00378