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 #include <fbxfilesdk/fbxfilesdk_def.h>
00042
00043 #include <fbxfilesdk/kfbxplugins/kfbxgeometrybase.h>
00044 #include <fbxfilesdk/kfbxplugins/kfbxdeformer.h>
00045
00046 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00047 #include <fbxfilesdk/components/kbaselib/klib/kerror.h>
00048
00049 #include <fbxfilesdk/kfbxmath/kfbxxmatrix.h>
00050 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00051
00052 class KFbxGeometryWeightedMap;
00053 class KFbxNode;
00054 class KFbxShape;
00055 class KFbxTexture;
00056 class KFbxSdkManager;
00057 class KFbxVector4;
00058 class KFbxAnimCurve;
00059 class KFbxAnimLayer;
00060 class KFbxScene;
00061 class KFbxCluster;
00062 typedef class KFbxCluster KFbxLink;
00063
00083 class KFBX_DLL KFbxGeometry : public KFbxGeometryBase
00084 {
00085 KFBXOBJECT_DECLARE(KFbxGeometry,KFbxGeometryBase);
00086
00087 public:
00094 virtual EAttributeType GetAttributeType() const;
00095
00100
00106 int AddDeformer(KFbxDeformer* pDeformer);
00107
00113 KFbxDeformer* RemoveDeformer(int pIndex);
00114
00118 int GetDeformerCount() const;
00119
00125 KFbxDeformer* GetDeformer(int pIndex) const;
00126
00131 int GetDeformerCount(KFbxDeformer::EDeformerType pType) const;
00132
00139 KFbxDeformer* GetDeformer(int pIndex, KFbxDeformer::EDeformerType pType) const;
00140
00142
00147
00151 KFbxGeometryWeightedMap* GetSourceGeometryWeightedMap();
00152
00156 int GetDestinationGeometryWeightedMapCount() const;
00157
00162 KFbxGeometryWeightedMap* GetDestinationGeometryWeightedMap(int pIndex);
00163
00165
00170
00184 virtual int AddShape(KFbxShape* pShape, char const* pShapeName);
00185
00190 virtual void ClearShape();
00191
00195 virtual int GetShapeCount() const;
00196
00202 virtual KFbxShape* GetShape(int pIndex);
00203
00209 virtual KFbxShape const* GetShape(int pIndex) const;
00210
00216 virtual char const* GetShapeName(int pIndex) const;
00217
00224 K_DEPRECATED virtual KFCurve* GetShapeChannel(char const* pShapeName, bool pCreateAsNeeded = false, char const* pTakeName = NULL);
00225
00238 virtual KFbxAnimCurve* GetShapeChannel(char const* pShapeName, KFbxAnimLayer* pLayer, bool pCreateAsNeeded = false);
00239
00246 virtual KFCurve* GetShapeChannel(int pIndex, bool pCreateAsNeeded=false, char const* pTakeName = NULL);
00247
00260 virtual KFbxAnimCurve* GetShapeChannel(int pIndex, KFbxAnimLayer* pLayer, bool pCreateAsNeeded = false);
00261
00263
00270 typedef enum
00271 {
00272 eRAW,
00273 eLOW_NO_NORMALS,
00274 eLOW,
00275 eHIGH_NO_NORMALS,
00276 eHIGH
00277 } ESurfaceMode;
00278
00286
00291 KFbxXMatrix& GetPivot(KFbxXMatrix& pXMatrix) const;
00292
00296 void SetPivot(KFbxXMatrix& pXMatrix);
00297
00300 void ApplyPivot();
00301
00303
00310
00318 void SetDefaultShape(int pIndex, double pPercent);
00319
00327 void SetDefaultShape(char const* pShapeName, double pPercent);
00328
00335 double GetDefaultShape(int pIndex) const;
00336
00343 double GetDefaultShape(char const* pShapeName) const;
00344
00346
00351
00355 KError& GetError ();
00356
00359 typedef enum
00360 {
00361 eINDEX_OUT_OF_RANGE,
00362 eNULL_PARAMETER,
00363 eSHAPE_ALREADY_ADDED,
00364 eSHAPE_INVALID_NAME,
00365 eSHAPE_NAME_CLASH,
00366 eSHAPE_NO_CURVE_FOUND,
00367 eUNKNOWN_ERROR,
00368 eERROR_COUNT
00369 } EError;
00370
00374 EError GetLastErrorID() const;
00375
00379 const char* GetLastErrorString() const;
00380
00382
00383 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00384
00386
00387
00388
00389
00390
00391
00393 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00394
00395 virtual KFbxObject& Copy(const KFbxObject& pObject);
00396
00397 protected:
00398 KFbxGeometry(KFbxSdkManager& pManager, char const* pName);
00399 virtual void Destruct(bool pRecursive, bool pDependents);
00400
00401 virtual void SetDocument(KFbxDocument* pDocument);
00402
00413 bool AddShapeChannel(KString pAnimStackName, int pShapeIndex);
00414
00420 bool AddShapeChannel(KFbxAnimLayer* pLayer, int pShapeIndex);
00421
00431 bool RemoveShapeChannel(KString pAnimStackName, int pShapeIndex);
00432
00438 bool RemoveShapeChannel(KFbxAnimLayer* pLayer, int pShapeIndex);
00439
00440 public:
00441
00442
00443
00444
00445
00446
00447
00448 K_DEPRECATED void CleanShapeChannels(KString pTakeNodeName);
00449 K_DEPRECATED void CleanShapeChannel(KString pTakeNodeName, int pShapeIndex);
00450
00452 void CleanShapeChannels(KFbxAnimLayer* pAnimLayer);
00454 void CleanShapeChannel(KFbxAnimLayer* pAnimLayer, int pShapeIndex);
00455
00456 protected:
00457
00458 KString CreateShapeChannelName(int pShapeIndex);
00459
00460
00461 KString CreateShapeChannelName(KString pShapeName);
00462
00463 void CreateShapeChannelProperties(KString& pShapeName);
00464
00465 public:
00466 void ConvertShapeNamesToV5Format(KString pTakeNodeName);
00467 void ConvertShapeNamesToV5Format(KString pTakeNodeName, int pShapeIndex);
00468 void RevertShapeNamesToV6Format(KString pTakeNodeName);
00469 void RevertShapeNamesToV6Format(KString pTakeNodeName, int pShapeIndex);
00470 void ClearTemporaryShapeNames();
00471
00472 protected:
00473 void CopyDeformers(KFbxGeometry const* pGeometry);
00474 void CopyShapes(KFbxGeometry const* pGeometry);
00475
00476 void CopyPivot(KFbxGeometry const* pSource);
00477
00478 KArrayTemplate <KFbxShape*> mShapeArray;
00479
00480 KArrayTemplate <KString*> mShapeNameArray;
00481
00482
00483 KArrayTemplate<KString*> mShapeNameArrayV6;
00484 KArrayTemplate<KString*> mShapeNameArrayV5;
00485 KArrayTemplate<KString*> mShapeChannelNameArrayV5;
00486
00487 KFbxXMatrix* mPivot;
00488
00489
00490 mutable KError mError;
00491
00492 friend class KFbxScene;
00493
00494 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00495
00496 };
00497
00498 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00499
00500 #endif // FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRY_H
00501