kfbxgeometry.h
Go to the documentation of this file.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
00074 class KFbxGeometry_internal;
00075
00083 class KFBX_DLL KFbxGeometry : public KFbxGeometryBase
00084 {
00085 KFBXOBJECT_DECLARE(KFbxGeometry);
00086
00087 public:
00091 virtual EAttributeType GetAttributeType() const { return eUNIDENTIFIED; }
00092
00105
00111 K_DEPRECATED int AddLink(KFbxLink* pLink);
00112
00118 K_DEPRECATED void ClearLink();
00119
00124 K_DEPRECATED int GetLinkCount();
00125
00132 K_DEPRECATED KFbxLink* GetLink(int pIndex);
00133
00135
00140
00145 int AddDeformer(KFbxDeformer* pDeformer);
00146
00150 int GetDeformerCount() const;
00151
00157 KFbxDeformer* GetDeformer(int pIndex);
00158
00164 KFbxDeformer const* GetDeformer(int pIndex) const;
00165
00170 int GetDeformerCount(KFbxDeformer::EDeformerType pType) const;
00171
00178 KFbxDeformer* GetDeformer(int pIndex, KFbxDeformer::EDeformerType pType);
00179
00181
00186
00190 KFbxGeometryWeightedMap* GetSourceGeometryWeightedMap();
00191
00195 int GetDestinationGeometryWeightedMapCount();
00196
00201 KFbxGeometryWeightedMap* GetDestinationGeometryWeightedMap(int pIndex);
00202
00204
00209
00223 virtual int AddShape(KFbxShape* pShape, char const* pShapeName);
00224
00229 virtual void ClearShape();
00230
00234 virtual int GetShapeCount() const;
00235
00241 virtual KFbxShape* GetShape(int pIndex);
00242
00248 virtual KFbxShape const* GetShape(int pIndex) const;
00249
00255 virtual char const* GetShapeName(int pIndex) const;
00256
00268 virtual KFCurve* GetShapeChannel(KFbxTakeNode* pTakeNode, int pShapeIndex);
00269
00271
00283 typedef enum
00284 {
00285 eRAW,
00286 eLOW_NO_NORMALS,
00287 eLOW,
00288 eHIGH_NO_NORMALS,
00289 eHIGH
00290 } ESurfaceMode;
00291
00299
00304 KFbxXMatrix& GetPivot(KFbxXMatrix& pXMatrix) const;
00305
00309 void SetPivot(KFbxXMatrix& pXMatrix);
00310
00313 void ApplyPivot();
00314
00316
00326
00334 void SetDefaultShape(int pIndex, double pPercent);
00335
00342 double GetDefaultShape(int pIndex);
00343
00345
00350
00354 KError& GetError ();
00355
00369 typedef enum
00370 {
00371 eINDEX_OUT_OF_RANGE,
00372 eNULL_PARAMETER,
00373 eMATERIAL_NOT_FOUND,
00374 eMATERIAL_ALREADY_ADDED,
00375 eTEXTURE_NOT_FOUND,
00376 eTEXTURE_ALREADY_ADDED,
00377 eSHAPE_ALREADY_ADDED,
00378 eSHAPE_INVALID_NAME,
00379 eSHAPE_NAME_CLASH,
00380 eSHAPE_NO_CURVE_FOUND,
00381 eUNKNOWN_ERROR,
00382 eERROR_COUNT
00383 } EError;
00384
00388 EError GetLastErrorID();
00389
00393 char* GetLastErrorString();
00394
00396
00398
00399
00400
00401
00402
00403
00405
00406 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00407
00408 public:
00409
00410 KFCurveNode* GetShapeCurveNode(KFbxTakeNode* pTakeNode, int pShapeIndex);
00411
00412 protected:
00413 KFbxGeometry(KFbxSdkManager& pManager, char const* pName);
00414 static char const* GetNamePrefix() { return 0; }
00415 virtual ~KFbxGeometry();
00416
00418 KFbxGeometry& operator=(KFbxGeometry const& pGeometry);
00419
00420 virtual void Destruct(bool pRecursive, bool pDependents);
00421
00422 virtual void SetScene(KFbxScene* pScene);
00423
00428 virtual void SetNode(KFbxNode& pNode);
00429
00433 virtual void UnsetNode();
00434
00438 virtual void AddChannels(KFbxTakeNode *pTakeNode);
00439 bool AddShapeChannel(KFbxTakeNode *pTakeNode, int pShapeIndex);
00440
00444 virtual void RemoveChannels(KFbxTakeNode *pTakeNode);
00445 bool RemoveShapeChannel(KFbxTakeNode *pTakeNode, int pShapeIndex);
00446
00447
00448
00449
00450
00451
00452
00453
00454 void CleanShapeChannels(KFbxTakeNode *pTakeNode);
00455 void CleanShapeChannel(KFbxTakeNode *pTakeNode, int pShapeIndex);
00456
00457
00458 KString CreateShapeChannelName(int pShapeIndex);
00459
00460
00461 KString CreateShapeChannelName(KString pShapeName);
00462
00463 void CreateShapeChannelProperties(KString& pShapeName);
00464
00465 void ConvertShapeNamesToV5Format(KFbxTakeNode *pTakeNode);
00466 void ConvertShapeNamesToV5Format(KFbxTakeNode *pTakeNode, int pShapeIndex);
00467 void RevertShapeNamesToV6Format(KFbxTakeNode *pTakeNode);
00468 void RevertShapeNamesToV6Format(KFbxTakeNode *pTakeNode, int pShapeIndex);
00469 void ClearTemporaryShapeNames();
00470
00476 KFbxDeformer* RemoveDeformer(int pIndex);
00477
00483
00484
00485
00486
00487 void CopyDeformers(KFbxGeometry const* pGeometry);
00488 void CopyShapes(KFbxGeometry const* pGeometry);
00489
00490 void PivotInit();
00491 void CopyPivot(KFbxGeometry const* pSource);
00492
00493 KArrayTemplate <KFbxShape*> mShapeArray;
00494
00495 KArrayTemplate <KString*> mShapeNameArray;
00496
00497
00498 KArrayTemplate<KString*> mShapeNameArrayV6;
00499 KArrayTemplate<KString*> mShapeNameArrayV5;
00500 KArrayTemplate<KString*> mShapeChannelNameArrayV5;
00501
00502 KFbxXMatrix mPivot;
00503
00504
00505 mutable KError mError;
00506
00507 friend class KFbxScene;
00508 friend class KFbxWriterFbx;
00509 friend class KFbxWriterFbx6;
00510 friend class KFbxReaderFbx;
00511 friend class KFbxReaderFbx6;
00512
00513 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00514
00515 };
00516
00517 #include <fbxfilesdk_nsend.h>
00518
00519 #endif // #ifndef _FBXSDK_GEOMETRY_H_
00520
00521