00001
00004 #ifndef _FBXSDK_GEOMETRY_H_
00005 #define _FBXSDK_GEOMETRY_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/kfbxgeometrybase.h>
00050 #include <kfbxplugins/kfbxdeformer.h>
00051
00052 #include <klib/karrayul.h>
00053 #include <klib/kerror.h>
00054
00055 #include <kfcurve/kfcurve_forward.h>
00056 #ifndef MB_FBXSDK
00057 #include <kfcurve/kfcurve_nsuse.h>
00058 #endif
00059
00060 #include <kfbxmath/kfbxxmatrix.h>
00061 #include <fbxfilesdk_nsbegin.h>
00062
00063 class KFbxGeometryWeightedMap;
00064 class KFbxNode;
00065 class KFbxShape;
00066 class KFbxTexture;
00067 class KFbxSdkManager;
00068 class KFbxVector4;
00069 class KFbxTakeNode;
00070 class KFbxScene;
00071 class KFbxCluster;
00072 typedef class KFbxCluster KFbxLink;
00073
00081 class KFBX_DLL KFbxGeometry : public KFbxGeometryBase
00082 {
00083 KFBXOBJECT_DECLARE(KFbxGeometry,KFbxGeometryBase);
00084
00085 public:
00089 virtual EAttributeType GetAttributeType() const;
00090
00095
00100 int AddDeformer(KFbxDeformer* pDeformer);
00101
00105 int GetDeformerCount() const;
00106
00112 KFbxDeformer* GetDeformer(int pIndex) const;
00113
00118 int GetDeformerCount(KFbxDeformer::EDeformerType pType) const;
00119
00126 KFbxDeformer* GetDeformer(int pIndex, KFbxDeformer::EDeformerType pType) const;
00127
00129
00134
00138 KFbxGeometryWeightedMap* GetSourceGeometryWeightedMap();
00139
00143 int GetDestinationGeometryWeightedMapCount();
00144
00149 KFbxGeometryWeightedMap* GetDestinationGeometryWeightedMap(int pIndex);
00150
00152
00157
00171 virtual int AddShape(KFbxShape* pShape, char const* pShapeName);
00172
00177 virtual void ClearShape();
00178
00182 virtual int GetShapeCount() const;
00183
00189 virtual KFbxShape* GetShape(int pIndex);
00190
00196 virtual KFbxShape const* GetShape(int pIndex) const;
00197
00203 virtual char const* GetShapeName(int pIndex) const;
00204
00216 virtual KFCurve* GetShapeChannel(char const* pShapeName, bool pCreateAsNeeded = false, char const* pTakeName = NULL);
00217
00229 virtual KFCurve* GetShapeChannel(int pIndex, bool pCreateAsNeeded = false, char const* pTakeName = NULL);
00230
00232
00244 typedef enum
00245 {
00246 eRAW,
00247 eLOW_NO_NORMALS,
00248 eLOW,
00249 eHIGH_NO_NORMALS,
00250 eHIGH
00251 } ESurfaceMode;
00252
00260
00265 KFbxXMatrix& GetPivot(KFbxXMatrix& pXMatrix) const;
00266
00270 void SetPivot(KFbxXMatrix& pXMatrix);
00271
00274 void ApplyPivot();
00275
00277
00286
00294 void SetDefaultShape(int pIndex, double pPercent);
00302 void SetDefaultShape(char const* pShapeName, double pPercent);
00303
00310 double GetDefaultShape(int pIndex);
00317 double GetDefaultShape(char const* pShapeName);
00318
00320
00325
00329 KError& GetError ();
00330
00344 typedef enum
00345 {
00346 eINDEX_OUT_OF_RANGE,
00347 eNULL_PARAMETER,
00348 eMATERIAL_NOT_FOUND,
00349 eMATERIAL_ALREADY_ADDED,
00350 eTEXTURE_NOT_FOUND,
00351 eTEXTURE_ALREADY_ADDED,
00352 eSHAPE_ALREADY_ADDED,
00353 eSHAPE_INVALID_NAME,
00354 eSHAPE_NAME_CLASH,
00355 eSHAPE_NO_CURVE_FOUND,
00356 eUNKNOWN_ERROR,
00357 eERROR_COUNT
00358 } EError;
00359
00363 EError GetLastErrorID() const;
00364
00368 const char* GetLastErrorString() const;
00369
00371
00372 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00373
00375
00376
00377
00378
00379
00380
00382
00383 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00384
00385 protected:
00386 KFbxGeometry(KFbxSdkManager& pManager, char const* pName);
00387 virtual ~KFbxGeometry();
00388
00390 KFbxGeometry& operator=(KFbxGeometry const& pGeometry);
00391
00392 virtual void Destruct(bool pRecursive, bool pDependents);
00393
00394 virtual void SetDocument(KFbxDocument* pDocument);
00395
00400 virtual void SetNode(KFbxNode& pNode);
00401
00405 virtual void UnsetNode();
00406
00410 bool AddShapeChannel(KString pTakeNodeName, int pShapeIndex);
00411
00415 bool RemoveShapeChannel(KString pTakeNodeName, int pShapeIndex);
00416
00417
00418
00419
00420
00421
00422
00423
00424 void CleanShapeChannels(KString pTakeNodeName);
00425 void CleanShapeChannel(KString pTakeNodeName, int pShapeIndex);
00426
00427
00428 KString CreateShapeChannelName(int pShapeIndex);
00429
00430
00431 KString CreateShapeChannelName(KString pShapeName);
00432
00433 void CreateShapeChannelProperties(KString& pShapeName);
00434
00435 void ConvertShapeNamesToV5Format(KString pTakeNodeName);
00436 void ConvertShapeNamesToV5Format(KString pTakeNodeName, int pShapeIndex);
00437 void RevertShapeNamesToV6Format(KString pTakeNodeName);
00438 void RevertShapeNamesToV6Format(KString pTakeNodeName, int pShapeIndex);
00439 void ClearTemporaryShapeNames();
00440
00446 KFbxDeformer* RemoveDeformer(int pIndex);
00447
00453
00454
00455
00456
00457 void CopyDeformers(KFbxGeometry const* pGeometry);
00458 void CopyShapes(KFbxGeometry const* pGeometry);
00459
00460 void CopyPivot(KFbxGeometry const* pSource);
00461
00462 KArrayTemplate <KFbxShape*> mShapeArray;
00463
00464 KArrayTemplate <KString*> mShapeNameArray;
00465
00466
00467 KArrayTemplate<KString*> mShapeNameArrayV6;
00468 KArrayTemplate<KString*> mShapeNameArrayV5;
00469 KArrayTemplate<KString*> mShapeChannelNameArrayV5;
00470
00471 KFbxXMatrix* mPivot;
00472
00473
00474 mutable KError mError;
00475
00476 friend class KFbxScene;
00477 friend class KFbxWriterFbx;
00478 friend class KFbxWriterFbx6;
00479 friend class KFbxReaderFbx;
00480 friend class KFbxReaderFbx6;
00481
00482 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00483
00484 };
00485
00486 #include <fbxfilesdk_nsend.h>
00487
00488 #endif // #ifndef _FBXSDK_GEOMETRY_H_
00489
00490