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
00113 
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 
00124 protected:
00125     KFbxBoundary(KFbxSdkManager& pManager, char const* pName);
00126     virtual void Construct(const KFbxBoundary* pFrom);
00127 
00128     void Reset();
00129 
00130     bool LineSegmentIntersect( const KFbxVector4 & pStart1, const KFbxVector4 & pEnd1,
00131                                const KFbxVector4 & pStart2, const KFbxVector4 & pEnd2 ) const;
00132 
00133 public:
00134     void ClearCurves();
00135     void CopyCurves( KFbxBoundary const& pOther );
00136     bool IsValid(bool mustClosed = true);
00137     bool IsCounterClockwise();
00138 
00139 #endif // DOXYGEN_SHOULD_SKIP_THIS
00140 };
00141 
00142 
00146 class KFBX_DLL KFbxTrimNurbsSurface : public KFbxGeometry
00147 {
00148     KFBXOBJECT_DECLARE(KFbxTrimNurbsSurface,KFbxGeometry);
00149 public:
00151     virtual EAttributeType GetAttributeType() const;
00152 
00153 
00158     int GetTrimRegionCount() const;
00159 
00163     void BeginTrimRegion();
00164 
00169     void EndTrimRegion();
00170 
00180     bool              AddBoundary( KFbxBoundary* pBoundary );
00181 
00189     KFbxBoundary*     GetBoundary( int pIndex, int pRegionIndex = 0 );
00190 
00198     KFbxBoundary const*     GetBoundary( int pIndex, int pRegionIndex = 0 ) const;
00199 
00204     int               GetBoundaryCount(int pRegionIndex = 0) const;
00205 
00209     void       SetNurbsSurface( KFbxNurbsSurface const* pNurbs );
00210 
00214     KFbxNurbsSurface* GetNurbsSurface();
00215 
00219     KFbxNurbsSurface const* GetNurbsSurface() const;
00220 
00225     inline void SetFlipNormals( bool pFlip ) { mFlipNormals = pFlip; }
00226 
00230     inline bool GetFlipNormals() const { return  mFlipNormals; }
00231 
00232     virtual int GetControlPointsCount() const;
00233 
00239     virtual void SetControlPointAt(KFbxVector4 &pCtrlPoint, KFbxVector4 &pNormal , int pIndex);
00240 
00242     virtual KFbxVector4* GetControlPoints() const;
00243 
00244 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00245 
00246 //
00247 //  WARNING!
00248 //
00249 //  Anything beyond these lines may not be documented accurately and is
00250 //  subject to change without notice.
00251 //
00253 
00254     virtual KFbxObject& Copy(const KFbxObject& pObject);
00255 
00259     bool IsValid(bool mustClosed = true);
00260 
00261 protected:
00262     KFbxTrimNurbsSurface(KFbxSdkManager& pManager, char const* pName);
00263 
00264 public:
00265     void ClearBoundaries();
00266 
00267     void CopyBoundaries( KFbxTrimNurbsSurface const& pOther );
00268 
00269     bool IsValid(int pRegion, bool mustClosed = true);
00270 
00271     void RebuildRegions();
00272 
00273 private:
00274     bool mFlipNormals;
00275 
00276     KArrayTemplate<int> mRegionIndices;
00277 
00278     bool mNewRegion;
00279 
00280 #endif // DOXYGEN_SHOULD_SKIP_THIS
00281 };
00282 
00283 typedef KFbxTrimNurbsSurface*   HKFbxTrimNurbsSurface;
00284 typedef KFbxBoundary*           HKFbxBoundary;
00285 
00286 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00287 
00288 #endif // FBXFILESDK_KFBXPLUGINS_KFBXTRIMNURBSSURFACE_H
00289