00001
00004 #ifndef _FBXSDK_TRIM_NURBS_SURFACE_H_
00005 #define _FBXSDK_TRIM_NURBS_SURFACE_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 <kaydaradef.h>
00043 #ifndef KFBX_DLL
00044 #define KFBX_DLL K_DLLIMPORT
00045 #endif
00046
00047 #include <kaydara.h>
00048
00049 #include <kfbxplugins/kfbxgeometry.h>
00050 #include <kfbxplugins/kfbxnurbssurface.h>
00051 #include <kfbxplugins/kfbxnurbscurve.h>
00052 #include <kfbxplugins/kfbxgenericnode.h>
00053
00054
00055 #include <fbxfilesdk_nsbegin.h>
00056
00063 class KFBX_DLL KFbxBoundary : public KFbxGeometry
00064 {
00065 KFBXOBJECT_DECLARE(KFbxBoundary,KFbxGeometry);
00066
00067 public:
00068
00069
00070 static const char* sOuterFlag;
00071
00075 void AddCurve( KFbxNurbsCurve* pCurve );
00076
00079 int GetCurveCount() const;
00080
00087 KFbxNurbsCurve* GetCurve( int pIndex );
00088
00095 KFbxNurbsCurve const* GetCurve( int pIndex ) const;
00096
00097 virtual EAttributeType GetAttributeType() const { return KFbxNodeAttribute::eBOUNDARY; }
00098
00099 bool IsPointInControlHull( KFbxVector4& pPoint );
00100
00101 KFbxVector4 ComputePointInBoundary();
00102
00103
00104
00105 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00107 //
00108
00109
00110
00111
00112
00114
00115 protected:
00116
00117 KFbxBoundary(KFbxSdkManager& pManager, char const* pName);
00118 virtual ~KFbxBoundary();
00119
00120 virtual void Construct(const KFbxBoundary* pFrom);
00121 virtual void Destruct(bool pRecursive, bool pDependents);
00122
00124 KFbxBoundary& operator = (KFbxBoundary const& pBoundary);
00125
00126 virtual KString GetTypeName() const;
00127 virtual KStringList GetTypeFlags() const;
00128
00129 void Reset();
00130
00131
00132 bool LineSegmentIntersect( KFbxVector4 & pStart1, KFbxVector4 & pEnd1,
00133 KFbxVector4 & pStart2, KFbxVector4 & pEnd2 ) const;
00134
00135
00136 public:
00137
00138 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00139
00140 void ClearCurves();
00141
00142 void CopyCurves( KFbxBoundary const& pOther );
00143
00144 bool IsValid();
00145
00146 bool IsCounterClockwise();
00147
00148 #endif // DOXYGEN_SHOULD_SKIP_THIS
00149
00150 public:
00151 friend class KFbxReaderFbx;
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
00204 KFbxBoundary const* GetBoundary( int pIndex, int pRegionIndex = 0 ) const;
00205
00209 int GetBoundaryCount(int pRegionIndex = 0) const;
00210
00214 void SetNurbsSurface( KFbxNurbsSurface const* pNurbs );
00215
00219 KFbxNurbsSurface* GetNurbsSurface();
00220
00224 KFbxNurbsSurface const* GetNurbsSurface() const;
00225
00229 inline void SetFlipNormals( bool pFlip ) { mFlipNormals = pFlip; }
00230
00234 inline bool GetFlipNormals() const { return mFlipNormals; }
00235
00236
00237
00242
00247 virtual int AddShape(KFbxShape* pShape, char const* pShapeName);
00248
00253 virtual void ClearShape();
00254
00259 virtual int GetShapeCount() const;
00260
00265 virtual KFbxShape* GetShape(int pIndex);
00266
00271 virtual KFbxShape const* GetShape(int pIndex) const;
00272
00273
00278 virtual char const* GetShapeName(int pIndex) const;
00279
00280
00285 virtual KFCurve* GetShapeChannel(int pIndex, bool pCreateAsNeeded = false, char const* pTakeName = NULL);
00287
00288
00289 virtual int GetControlPointsCount() const;
00290
00291 virtual void SetControlPointAt(KFbxVector4 &pCtrlPoint, KFbxVector4 &pNormal , int pIndex);
00292
00293 virtual KFbxVector4* GetControlPoints() const;
00294
00295 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00297 //
00298
00299
00300
00301
00302
00304
00305 public:
00306
00307 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00308
00309 bool IsValid();
00310
00311 protected:
00312
00313 KFbxTrimNurbsSurface(KFbxSdkManager& pManager, char const* pName);
00314 virtual ~KFbxTrimNurbsSurface();
00315
00317 KFbxTrimNurbsSurface& operator = (KFbxTrimNurbsSurface const& pTrimmedNurbs);
00318
00319 virtual KString GetTypeName() const;
00320 virtual KStringList GetTypeFlags() const;
00321
00322 void Destruct(bool pRecursive, bool pDependents);
00323
00324 void ClearBoundaries();
00325
00326 void CopyBoundaries( KFbxTrimNurbsSurface const& pOther );
00327
00328 bool IsValid(int pRegion);
00329
00330 void RebuildRegions();
00331
00332 private:
00333 bool mFlipNormals;
00334
00335 KArrayTemplate<int> mRegionIndices;
00336
00337 bool mNewRegion;
00338
00339 #endif // DOXYGEN_SHOULD_SKIP_THIS
00340
00341 public:
00342
00343 friend class KFbxReaderFbx6;
00344 friend class KFbxReaderFbx7;
00345 friend struct KFbxReaderFbx7Impl;
00346
00347 };
00348
00349 typedef KFbxTrimNurbsSurface* HKFbxTrimNurbsSurface;
00350 typedef KFbxBoundary* HKFbxBoundary;
00351
00352 #include <fbxfilesdk_nsend.h>
00353
00354 #endif // _FBXSDK_TRIM_NURBS_SURFACE_H_
00355