00001
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRY_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRY_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/kfbxgeometrybase.h>
00046 #include <fbxfilesdk/kfbxplugins/kfbxdeformer.h>
00047
00048 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00049 #include <fbxfilesdk/components/kbaselib/klib/kerror.h>
00050
00051 #include <fbxfilesdk/components/kfcurve/kfcurve_forward.h>
00052
00053 #include <fbxfilesdk/kfbxmath/kfbxxmatrix.h>
00054 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00055
00056 class KFbxGeometryWeightedMap;
00057 class KFbxNode;
00058 class KFbxShape;
00059 class KFbxTexture;
00060 class KFbxSdkManager;
00061 class KFbxVector4;
00062 class KFbxTakeNode;
00063 class KFbxScene;
00064 class KFbxCluster;
00065 typedef class KFbxCluster KFbxLink;
00066
00074 class KFBX_DLL KFbxGeometry : public KFbxGeometryBase
00075 {
00076 KFBXOBJECT_DECLARE(KFbxGeometry,KFbxGeometryBase);
00077
00078 public:
00082 virtual EAttributeType GetAttributeType() const;
00083
00088
00093 int AddDeformer(KFbxDeformer* pDeformer);
00094
00098 int GetDeformerCount() const;
00099
00105 KFbxDeformer* GetDeformer(int pIndex) const;
00106
00111 int GetDeformerCount(KFbxDeformer::EDeformerType pType) const;
00112
00119 KFbxDeformer* GetDeformer(int pIndex, KFbxDeformer::EDeformerType pType) const;
00120
00122
00127
00131 KFbxGeometryWeightedMap* GetSourceGeometryWeightedMap();
00132
00136 int GetDestinationGeometryWeightedMapCount();
00137
00142 KFbxGeometryWeightedMap* GetDestinationGeometryWeightedMap(int pIndex);
00143
00145
00150
00164 virtual int AddShape(KFbxShape* pShape, char const* pShapeName);
00165
00170 virtual void ClearShape();
00171
00175 virtual int GetShapeCount() const;
00176
00182 virtual KFbxShape* GetShape(int pIndex);
00183
00189 virtual KFbxShape const* GetShape(int pIndex) const;
00190
00196 virtual char const* GetShapeName(int pIndex) const;
00197
00209 virtual KFCurve* GetShapeChannel(char const* pShapeName, bool pCreateAsNeeded = false, char const* pTakeName = NULL);
00210
00222 virtual KFCurve* GetShapeChannel(int pIndex, bool pCreateAsNeeded = false, char const* pTakeName = NULL);
00223
00225
00237 typedef enum
00238 {
00239 eRAW,
00240 eLOW_NO_NORMALS,
00241 eLOW,
00242 eHIGH_NO_NORMALS,
00243 eHIGH
00244 } ESurfaceMode;
00245
00253
00258 KFbxXMatrix& GetPivot(KFbxXMatrix& pXMatrix) const;
00259
00263 void SetPivot(KFbxXMatrix& pXMatrix);
00264
00267 void ApplyPivot();
00268
00270
00279
00287 void SetDefaultShape(int pIndex, double pPercent);
00295 void SetDefaultShape(char const* pShapeName, double pPercent);
00296
00303 double GetDefaultShape(int pIndex);
00310 double GetDefaultShape(char const* pShapeName);
00311
00313
00318
00322 KError& GetError ();
00323
00337 typedef enum
00338 {
00339 eINDEX_OUT_OF_RANGE,
00340 eNULL_PARAMETER,
00341 eMATERIAL_NOT_FOUND,
00342 eMATERIAL_ALREADY_ADDED,
00343 eTEXTURE_NOT_FOUND,
00344 eTEXTURE_ALREADY_ADDED,
00345 eSHAPE_ALREADY_ADDED,
00346 eSHAPE_INVALID_NAME,
00347 eSHAPE_NAME_CLASH,
00348 eSHAPE_NO_CURVE_FOUND,
00349 eUNKNOWN_ERROR,
00350 eERROR_COUNT
00351 } EError;
00352
00356 EError GetLastErrorID() const;
00357
00361 const char* GetLastErrorString() const;
00362
00364
00365 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00366
00368
00369
00370
00371
00372
00373
00375
00376 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00377
00378 protected:
00379 KFbxGeometry(KFbxSdkManager& pManager, char const* pName);
00380 virtual ~KFbxGeometry();
00381
00383 KFbxGeometry& operator=(KFbxGeometry const& pGeometry);
00384
00385 virtual void Destruct(bool pRecursive, bool pDependents);
00386
00387 virtual void SetDocument(KFbxDocument* pDocument);
00388
00393 virtual void SetNode(KFbxNode& pNode);
00394
00398 virtual void UnsetNode();
00399
00403 bool AddShapeChannel(KString pTakeNodeName, int pShapeIndex);
00404
00408 bool RemoveShapeChannel(KString pTakeNodeName, int pShapeIndex);
00409
00410 public:
00411
00412
00413
00414
00415
00416
00417
00418 void CleanShapeChannels(KString pTakeNodeName);
00419 void CleanShapeChannel(KString pTakeNodeName, int pShapeIndex);
00420
00421 protected:
00422
00423 KString CreateShapeChannelName(int pShapeIndex);
00424
00425
00426 KString CreateShapeChannelName(KString pShapeName);
00427
00428 void CreateShapeChannelProperties(KString& pShapeName);
00429
00430 public:
00431 void ConvertShapeNamesToV5Format(KString pTakeNodeName);
00432 void ConvertShapeNamesToV5Format(KString pTakeNodeName, int pShapeIndex);
00433 void RevertShapeNamesToV6Format(KString pTakeNodeName);
00434 void RevertShapeNamesToV6Format(KString pTakeNodeName, int pShapeIndex);
00435 void ClearTemporaryShapeNames();
00436
00437 protected:
00443 KFbxDeformer* RemoveDeformer(int pIndex);
00444
00450
00451
00452
00453
00454 void CopyDeformers(KFbxGeometry const* pGeometry);
00455 void CopyShapes(KFbxGeometry const* pGeometry);
00456
00457 void CopyPivot(KFbxGeometry const* pSource);
00458
00459 KArrayTemplate <KFbxShape*> mShapeArray;
00460
00461 KArrayTemplate <KString*> mShapeNameArray;
00462
00463
00464 KArrayTemplate<KString*> mShapeNameArrayV6;
00465 KArrayTemplate<KString*> mShapeNameArrayV5;
00466 KArrayTemplate<KString*> mShapeChannelNameArrayV5;
00467
00468 KFbxXMatrix* mPivot;
00469
00470
00471 mutable KError mError;
00472
00473 friend class KFbxScene;
00474
00475 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00476
00477 };
00478
00479 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00480
00481 #endif // FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRY_H
00482