kfbxtrimnurbssurface.h
Go to the documentation of this file.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
00057 class KFbxTrimNurbsSurface_internal;
00058 class KFbxBoundary_internal;
00059
00066 class KFBX_DLL KFbxBoundary : public KFbxGeometry
00067 {
00068 KFBXOBJECT_DECLARE(KFbxBoundary);
00069
00070 public:
00071
00072
00073 static const char* sOuterFlag;
00074
00078 void AddCurve( KFbxNurbsCurve* pCurve );
00079
00082 int GetCurveCount() const;
00083
00090 KFbxNurbsCurve* GetCurve( int pIndex );
00091
00098 KFbxNurbsCurve const* GetCurve( int pIndex ) const;
00099
00100 virtual EAttributeType GetAttributeType() const { return KFbxNodeAttribute::eBOUNDARY; }
00101
00102 bool IsPointInControlHull( KFbxVector4& pPoint );
00103
00104 KFbxVector4 ComputePointInBoundary();
00105
00106
00107
00108 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00110 //
00111
00112
00113
00114
00115
00117
00118 protected:
00119 static char const* GetNamePrefix() { return 0; }
00120
00121 KFbxBoundary(KFbxSdkManager& pManager, char const* pName);
00122 virtual ~KFbxBoundary();
00123
00124 void Destruct(bool pRecursive, bool pDependents);
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 virtual KObject* GetFbxObject_internal();
00141 virtual KObject const* GetFbxObject_internal() const;
00142
00143
00144 virtual KFbxObject* Clone(KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00145
00146 void ClearCurves();
00147
00148 void CopyCurves( KFbxBoundary const& pOther );
00149
00150 bool IsValid();
00151
00152 bool IsCounterClockwise();
00153
00154 private:
00155 KFbxBoundary_internal* mPH;
00156
00157 #endif // DOXYGEN_SHOULD_SKIP_THIS
00158
00159 public:
00160 friend class KFbxReaderFbx;
00161 };
00162
00163
00167 class KFBX_DLL KFbxTrimNurbsSurface : public KFbxGeometry
00168 {
00169 KFBXOBJECT_DECLARE(KFbxTrimNurbsSurface);
00170 public:
00172 virtual EAttributeType GetAttributeType() const { return KFbxNodeAttribute::eTRIM_NURBS_SURFACE; }
00173
00174
00179 int GetTrimRegionCount() const;
00180
00184 void BeginTrimRegion();
00185
00190 void EndTrimRegion();
00191
00202 bool AddBoundary( KFbxBoundary* pBoundary );
00203
00211 KFbxBoundary* GetBoundary( int pIndex, int pRegionIndex = 0 );
00212
00213 KFbxBoundary const* GetBoundary( int pIndex, int pRegionIndex = 0 ) const;
00214
00218 int GetBoundaryCount(int pRegionIndex = 0) const;
00219
00223 void SetNurbsSurface( KFbxNurbsSurface const* pNurbs );
00224
00228 KFbxNurbsSurface* GetNurbsSurface();
00229
00233 KFbxNurbsSurface const* GetNurbsSurface() const;
00234
00238 inline void SetFlipNormals( bool pFlip ) { mFlipNormals = pFlip; }
00239
00243 inline bool GetFlipNormals() const { return mFlipNormals; }
00244
00245
00246
00251
00256 virtual int AddShape(KFbxShape* pShape, char const* pShapeName);
00257
00262 virtual void ClearShape();
00263
00268 virtual int GetShapeCount() const;
00269
00274 virtual KFbxShape* GetShape(int pIndex);
00275
00280 virtual KFbxShape const* GetShape(int pIndex) const;
00281
00282
00287 virtual char const* GetShapeName(int pIndex) const;
00288
00289
00294 virtual KFCurve* GetShapeChannel(KFbxTakeNode* pTakeNode, int pShapeIndex);
00295
00297
00298
00299 virtual int GetControlPointsCount() const;
00300
00301 virtual void SetControlPointAt(KFbxVector4 &pCtrlPoint, KFbxVector4 &pNormal , int pIndex);
00302
00303 virtual KFbxVector4* GetControlPoints();
00304
00305 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00307 //
00308
00309
00310
00311
00312
00314
00315 public:
00316 virtual KObject* GetFbxObject_internal();
00317 virtual KObject const* GetFbxObject_internal() const;
00318
00319
00320 virtual KFbxObject* Clone(KFbxObject::ECloneType pCloneType = eDEEP_CLONE) const;
00321
00322 bool IsValid();
00323
00324 protected:
00325 static char const* GetNamePrefix() { return 0; }
00326
00327 KFbxTrimNurbsSurface(KFbxSdkManager& pManager, char const* pName);
00328 virtual ~KFbxTrimNurbsSurface();
00329
00331 KFbxTrimNurbsSurface& operator = (KFbxTrimNurbsSurface const& pTrimmedNurbs);
00332
00333 virtual KString GetTypeName() const;
00334 virtual KStringList GetTypeFlags() const;
00335
00336 void Destruct(bool pRecursive, bool pDependents);
00337
00338 void ClearBoundaries();
00339
00340 void CopyBoundaries( KFbxTrimNurbsSurface const& pOther );
00341
00342 bool IsValid(int pRegion);
00343
00344 void RebuildRegions();
00345
00346 private:
00347
00348
00349 KFbxTrimNurbsSurface_internal* mPH;
00350
00351 bool mFlipNormals;
00352
00353 KArrayTemplate<int> mRegionIndices;
00354
00355 bool mNewRegion;
00356
00357 #endif // DOXYGEN_SHOULD_SKIP_THIS
00358
00359 public:
00360
00361 friend class KFbxReaderFbx6;
00362
00363 };
00364
00365 typedef KFbxTrimNurbsSurface* HKFbxTrimNurbsSurface;
00366 typedef KFbxBoundary* HKFbxBoundary;
00367
00368 #include <fbxfilesdk_nsend.h>
00369
00370 #endif // _FBXSDK_TRIM_NURBS_SURFACE_H_
00371