00001
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXTRIMNURBSSURFACE_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXTRIMNURBSSURFACE_H
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
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 #include <fbxfilesdk/kfbxplugins/kfbxnurbssurface.h>
00047 #include <fbxfilesdk/kfbxplugins/kfbxnurbscurve.h>
00048 #include <fbxfilesdk/kfbxplugins/kfbxgenericnode.h>
00049
00050
00051 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00052
00059 class KFBX_DLL KFbxBoundary : public KFbxGeometry
00060 {
00061 KFBXOBJECT_DECLARE(KFbxBoundary,KFbxGeometry);
00062
00063 public:
00064
00065
00066 static const char* sOuterFlag;
00067
00071 void AddCurve( KFbxNurbsCurve* pCurve );
00072
00075 int GetCurveCount() const;
00076
00083 KFbxNurbsCurve* GetCurve( int pIndex );
00084
00091 KFbxNurbsCurve const* GetCurve( int pIndex ) const;
00092
00093
00095 virtual EAttributeType GetAttributeType() const { return KFbxNodeAttribute::eBOUNDARY; }
00096
00101 bool IsPointInControlHull( KFbxVector4& pPoint );
00102
00106 KFbxVector4 ComputePointInBoundary();
00107
00108
00109
00110 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00112 //
00113
00114
00115
00116
00117
00119
00120 protected:
00121
00122 KFbxBoundary(KFbxSdkManager& pManager, char const* pName);
00123
00124 virtual void Construct(const KFbxBoundary* pFrom);
00125
00127 KFbxBoundary& operator=(KFbxBoundary const& pBoundary);
00128
00129 virtual KString GetTypeName() const;
00130 virtual KStringList GetTypeFlags() const;
00131
00132 void Reset();
00133
00134
00135 bool LineSegmentIntersect( KFbxVector4 & pStart1, KFbxVector4 & pEnd1,
00136 KFbxVector4 & pStart2, KFbxVector4 & pEnd2 ) const;
00137
00138
00139 public:
00140
00141 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00142
00143 void ClearCurves();
00144
00145 void CopyCurves( KFbxBoundary const& pOther );
00146
00147 bool IsValid(bool mustClosed = true);
00148
00149 bool IsCounterClockwise();
00150
00151 #endif // DOXYGEN_SHOULD_SKIP_THIS
00152 };
00153
00154
00158 class KFBX_DLL KFbxTrimNurbsSurface : public KFbxGeometry
00159 {
00160 KFBXOBJECT_DECLARE(KFbxTrimNurbsSurface,KFbxGeometry);
00161 public:
00163 virtual EAttributeType GetAttributeType() const { return KFbxNodeAttribute::eTRIM_NURBS_SURFACE; }
00164
00165
00170 int GetTrimRegionCount() const;
00171
00175 void BeginTrimRegion();
00176
00181 void EndTrimRegion();
00182
00193 bool AddBoundary( KFbxBoundary* pBoundary );
00194
00202 KFbxBoundary* GetBoundary( int pIndex, int pRegionIndex = 0 );
00203
00211 KFbxBoundary const* GetBoundary( int pIndex, int pRegionIndex = 0 ) const;
00212
00217 int GetBoundaryCount(int pRegionIndex = 0) const;
00218
00222 void SetNurbsSurface( KFbxNurbsSurface const* pNurbs );
00223
00227 KFbxNurbsSurface* GetNurbsSurface();
00228
00232 KFbxNurbsSurface const* GetNurbsSurface() const;
00233
00237 inline void SetFlipNormals( bool pFlip ) { mFlipNormals = pFlip; }
00238
00242 inline bool GetFlipNormals() const { return mFlipNormals; }
00243
00244
00245
00250
00258 virtual int AddShape(KFbxShape* pShape, char const* pShapeName);
00259
00264 virtual void ClearShape();
00265
00270 virtual int GetShapeCount() const;
00271
00277 virtual KFbxShape* GetShape(int pIndex);
00278
00284 virtual KFbxShape const* GetShape(int pIndex) const;
00285
00286
00292 virtual char const* GetShapeName(int pIndex) const;
00293
00294
00302 virtual KFCurve* GetShapeChannel(int pIndex, bool pCreateAsNeeded = false, char const* pTakeName = NULL);
00304
00306 virtual int GetControlPointsCount() const;
00307
00313 virtual void SetControlPointAt(KFbxVector4 &pCtrlPoint, KFbxVector4 &pNormal , int pIndex);
00314
00316 virtual KFbxVector4* GetControlPoints() const;
00317
00318 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00320 //
00321
00322
00323
00324
00325
00327
00328 public:
00329
00330 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00331
00335 bool IsValid(bool mustClosed = true);
00336
00337 protected:
00338
00339 KFbxTrimNurbsSurface(KFbxSdkManager& pManager, char const* pName);
00340
00342 KFbxTrimNurbsSurface& operator=(KFbxTrimNurbsSurface const& pTrimmedNurbs);
00343
00344 public:
00345 virtual KString GetTypeName() const;
00346 virtual KStringList GetTypeFlags() const;
00347
00348 void ClearBoundaries();
00349
00350 void CopyBoundaries( KFbxTrimNurbsSurface const& pOther );
00351
00352 bool IsValid(int pRegion, bool mustClosed = true);
00353
00354 void RebuildRegions();
00355
00356 private:
00357 bool mFlipNormals;
00358
00359 KArrayTemplate<int> mRegionIndices;
00360
00361 bool mNewRegion;
00362
00363 #endif // DOXYGEN_SHOULD_SKIP_THIS
00364 };
00365
00366 typedef KFbxTrimNurbsSurface* HKFbxTrimNurbsSurface;
00367 typedef KFbxBoundary* HKFbxBoundary;
00368
00369 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00370
00371 #endif // FBXFILESDK_KFBXPLUGINS_KFBXTRIMNURBSSURFACE_H
00372