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
00097 bool IsPointInControlHull( KFbxVector4& pPoint );
00098
00099 KFbxVector4 ComputePointInBoundary();
00100
00101
00102
00103 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00105 //
00106
00107
00108
00109
00110
00112
00113 protected:
00114
00115 KFbxBoundary(KFbxSdkManager& pManager, char const* pName);
00116 virtual ~KFbxBoundary();
00117
00118 virtual void Construct(const KFbxBoundary* pFrom);
00119 virtual void Destruct(bool pRecursive, bool pDependents);
00120
00122 KFbxBoundary& operator = (KFbxBoundary const& pBoundary);
00123
00124 virtual KString GetTypeName() const;
00125 virtual KStringList GetTypeFlags() const;
00126
00127 void Reset();
00128
00129
00130 bool LineSegmentIntersect( KFbxVector4 & pStart1, KFbxVector4 & pEnd1,
00131 KFbxVector4 & pStart2, KFbxVector4 & pEnd2 ) const;
00132
00133
00134 public:
00135
00136 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00137
00138 void ClearCurves();
00139
00140 void CopyCurves( KFbxBoundary const& pOther );
00141
00142 bool IsValid();
00143
00144 bool IsCounterClockwise();
00145
00146 #endif // DOXYGEN_SHOULD_SKIP_THIS
00147 };
00148
00149
00153 class KFBX_DLL KFbxTrimNurbsSurface : public KFbxGeometry
00154 {
00155 KFBXOBJECT_DECLARE(KFbxTrimNurbsSurface,KFbxGeometry);
00156 public:
00158 virtual EAttributeType GetAttributeType() const { return KFbxNodeAttribute::eTRIM_NURBS_SURFACE; }
00159
00160
00165 int GetTrimRegionCount() const;
00166
00170 void BeginTrimRegion();
00171
00176 void EndTrimRegion();
00177
00188 bool AddBoundary( KFbxBoundary* pBoundary );
00189
00197 KFbxBoundary* GetBoundary( int pIndex, int pRegionIndex = 0 );
00198
00206 KFbxBoundary const* GetBoundary( int pIndex, int pRegionIndex = 0 ) const;
00207
00212 int GetBoundaryCount(int pRegionIndex = 0) const;
00213
00217 void SetNurbsSurface( KFbxNurbsSurface const* pNurbs );
00218
00222 KFbxNurbsSurface* GetNurbsSurface();
00223
00227 KFbxNurbsSurface const* GetNurbsSurface() const;
00228
00232 inline void SetFlipNormals( bool pFlip ) { mFlipNormals = pFlip; }
00233
00237 inline bool GetFlipNormals() const { return mFlipNormals; }
00238
00239
00240
00245
00253 virtual int AddShape(KFbxShape* pShape, char const* pShapeName);
00254
00259 virtual void ClearShape();
00260
00265 virtual int GetShapeCount() const;
00266
00272 virtual KFbxShape* GetShape(int pIndex);
00273
00279 virtual KFbxShape const* GetShape(int pIndex) const;
00280
00281
00287 virtual char const* GetShapeName(int pIndex) const;
00288
00289
00297 virtual KFCurve* GetShapeChannel(int pIndex, bool pCreateAsNeeded = false, char const* pTakeName = NULL);
00299
00300
00301 virtual int GetControlPointsCount() const;
00302
00303 virtual void SetControlPointAt(KFbxVector4 &pCtrlPoint, KFbxVector4 &pNormal , int pIndex);
00304
00305 virtual KFbxVector4* GetControlPoints() const;
00306
00307 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00309 //
00310
00311
00312
00313
00314
00316
00317 public:
00318
00319 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00320
00321 bool IsValid();
00322
00323 protected:
00324
00325 KFbxTrimNurbsSurface(KFbxSdkManager& pManager, char const* pName);
00326 virtual ~KFbxTrimNurbsSurface();
00327
00329 KFbxTrimNurbsSurface& operator = (KFbxTrimNurbsSurface const& pTrimmedNurbs);
00330
00331 public:
00332 virtual KString GetTypeName() const;
00333 virtual KStringList GetTypeFlags() const;
00334
00335 protected:
00336 void Destruct(bool pRecursive, bool pDependents);
00337
00338 public:
00339 void ClearBoundaries();
00340
00341 void CopyBoundaries( KFbxTrimNurbsSurface const& pOther );
00342
00343 bool IsValid(int pRegion);
00344
00345 void RebuildRegions();
00346
00347 private:
00348 bool mFlipNormals;
00349
00350 KArrayTemplate<int> mRegionIndices;
00351
00352 bool mNewRegion;
00353
00354 #endif // DOXYGEN_SHOULD_SKIP_THIS
00355 };
00356
00357 typedef KFbxTrimNurbsSurface* HKFbxTrimNurbsSurface;
00358 typedef KFbxBoundary* HKFbxBoundary;
00359
00360 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00361
00362 #endif // FBXFILESDK_KFBXPLUGINS_KFBXTRIMNURBSSURFACE_H
00363