00001
00003 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXSCENE_H
00004 #define FBXFILESDK_KFBXPLUGINS_KFBXSCENE_H
00005
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 #include <fbxfilesdk/fbxfilesdk_def.h>
00041
00042 #include <fbxfilesdk/fbxcore/fbxcollection/kfbxdocument.h>
00043
00044 #include <fbxfilesdk/kfbxplugins/kfbxdeformer.h>
00045 #include <fbxfilesdk/kfbxplugins/kfbxsubdeformer.h>
00046 #include <fbxfilesdk/kfbxplugins/kfbxlayer.h>
00047 #include <fbxfilesdk/kfbxplugins/kfbxnodeattribute.h>
00048 #include <fbxfilesdk/kfbxplugins/kfbxglobalsettings.h>
00049 #include <fbxfilesdk/kfbxplugins/kfbxanimevaluator.h>
00050
00051 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00052 #include <fbxfilesdk/components/kbaselib/klib/kerror.h>
00053 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00054 #include <fbxfilesdk/components/kbaselib/klib/kcharptrset.h>
00055
00056 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00057
00058 class KFbxSdkManager;
00059 class KFbxObject;
00060 class KFbxNode;
00061 class KFbxVideo;
00062 class KFbxTexture;
00063 class KFbxSurfaceMaterial;
00064 class KFbxMarkerSet;
00065 class KFbxActor;
00066 class KFbxCharacter;
00067 class KFbxControlSetPlug;
00068 class KFbxCharacterPose;
00069 class KFbxPose;
00070 class KFbxDocumentInfo;
00071 class KFbxTakeInfo;
00072 class KFbxGlobalSettings;
00073 class KFbxGenericNode;
00074 class KFbxConstraint;
00075 class KFbxGeometry;
00076 class KFbxLayerContainer;
00077 class KSet;
00078
00079 class KFbxGlobalLightSettings;
00080 class KFbxGlobalCameraSettings;
00081 class KFbxGlobalTimeSettings;
00082
00083
00093 class KFBX_DLL KFbxScene : public KFbxDocument
00094 {
00095 KFBXOBJECT_DECLARE(KFbxScene, KFbxDocument);
00096
00097 public:
00099 void Clear();
00100
00105
00112 KFbxNode* GetRootNode() const;
00113
00121 K_DEPRECATED void FillNodeArray(KArrayTemplate<KFbxNode*>& pNodeArray, kFbxClassId classId, bool pDepthFirst=false);
00122
00124
00129
00133 void FillTextureArray(KArrayTemplate<KFbxTexture*>& pTextureArray);
00134
00138 void FillMaterialArray(KArrayTemplate<KFbxSurfaceMaterial*>& pMaterialArray);
00139
00141
00146
00150 int GetGenericNodeCount() const;
00151
00156 KFbxGenericNode* GetGenericNode(int pIndex);
00157
00162 KFbxGenericNode* GetGenericNode(char* pName);
00163
00168 bool AddGenericNode(KFbxGenericNode* pGenericNode);
00169
00175 bool RemoveGenericNode(KFbxGenericNode* pGenericNode);
00176
00178
00179
00184
00188 int GetCharacterCount() const;
00189
00194 KFbxCharacter* GetCharacter(int pIndex);
00195
00200 int CreateCharacter(char* pName);
00201
00206 void DestroyCharacter(int pIndex);
00207
00209
00214
00218 int GetControlSetPlugCount() const;
00219
00224 KFbxControlSetPlug* GetControlSetPlug(int pIndex);
00225
00230 int CreateControlSetPlug(char* pName);
00231
00236 void DestroyControlSetPlug(int pIndex);
00237
00239
00244
00249 int GetCharacterPoseCount() const;
00250
00255 KFbxCharacterPose* GetCharacterPose(int pIndex);
00256
00261 int CreateCharacterPose(char* pName);
00262
00267 void DestroyCharacterPose(int pIndex);
00268
00270
00275
00280 int GetPoseCount() const;
00281
00286 KFbxPose* GetPose(int pIndex);
00287
00293 bool AddPose(KFbxPose* pPose);
00294
00300 bool RemovePose(KFbxPose* pPose);
00301
00307 bool RemovePose(int pIndex);
00308
00309
00311
00315
00319 inline KFbxDocumentInfo* GetSceneInfo() { return GetDocumentInfo(); }
00320
00324 inline void SetSceneInfo(KFbxDocumentInfo* pSceneInfo) { SetDocumentInfo(pSceneInfo); }
00325
00327
00332
00336 KFbxGlobalSettings& GetGlobalSettings();
00337
00341 const KFbxGlobalSettings& GetGlobalSettings() const;
00342
00343
00373 K_DEPRECATED KFbxGlobalLightSettings& GetGlobalLightSettings();
00374
00378 K_DEPRECATED KFbxGlobalCameraSettings& GetGlobalCameraSettings();
00379
00383 K_DEPRECATED KFbxGlobalTimeSettings& GetGlobalTimeSettings();
00385
00387
00392
00396 void SetEvaluator(KFbxAnimEvaluator* pEvaluator);
00397
00403 KFbxAnimEvaluator* GetEvaluator();
00404
00406
00408
00409
00410
00411
00412
00413
00415 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00416
00417 virtual KFbxObject& Copy(const KFbxObject& pObject);
00418
00419 void ConnectMaterials();
00420
00421 void BuildMaterialLayersDirectArray();
00422 void ReindexMaterialConnections();
00423
00427 K_DEPRECATED void FillNodeArray(KArrayTemplate<KFbxNode*>& pNodeArray);
00428
00432 void FillPoseArray(KArrayTemplate<KFbxPose*>& pPoseArray);
00433
00434
00435 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00436
00437
00442
00446 int GetMaterialCount () const;
00447
00453 KFbxSurfaceMaterial* GetMaterial (int pIndex);
00454
00459 KFbxSurfaceMaterial* GetMaterial (char* pName);
00460
00465 bool AddMaterial (KFbxSurfaceMaterial* pMaterial);
00466
00471 bool RemoveMaterial (KFbxSurfaceMaterial* pMaterial);
00472
00474
00479
00483 int GetTextureCount () const;
00484
00490 KFbxTexture* GetTexture (int pIndex);
00491
00496 KFbxTexture* GetTexture (char* pName);
00497
00502 bool AddTexture (KFbxTexture* pTexture);
00503
00508 bool RemoveTexture (KFbxTexture* pTexture);
00509
00511
00516
00520 int GetNodeCount () const;
00521
00527 KFbxNode* GetNode (int pIndex);
00528
00533 bool AddNode (KFbxNode* pNode);
00534
00539 bool RemoveNode (KFbxNode* pNode);
00540
00547 int GetCurveOnSurfaceCount ();
00548
00549 KFbxNode* FindNodeByName ( const KString& pName );
00550
00552
00557
00561 int GetGeometryCount () const;
00562
00568 KFbxGeometry* GetGeometry (int pIndex);
00569
00574 bool AddGeometry (KFbxGeometry* pGeometry);
00575
00580 bool RemoveGeometry (KFbxGeometry* pGeometry);
00581
00583
00588
00592 int GetVideoCount () const;
00593
00599 KFbxVideo* GetVideo (int pIndex);
00600
00605 bool AddVideo (KFbxVideo* pVideo);
00606
00611 bool RemoveVideo (KFbxVideo* pVideo);
00612
00614
00615 KSet* AddTakeTimeWarpSet(char *pTakeName);
00616 KSet* GetTakeTimeWarpSet(char *pTakeName);
00617
00618 private:
00619 KFbxScene(KFbxSdkManager& pManager, char const* pName);
00620
00621 virtual void Construct(const KFbxScene* pFrom);
00622 virtual void Destruct(bool pRecursive, bool pDependents);
00623
00624
00625
00626
00627 void FillNodeArrayRecursive(KArrayTemplate<KFbxNode*>& pNodeArray, kFbxClassId classId, KFbxNode* pNode);
00628
00629 void ConnectTextureLayerElement(KFbxLayerContainer* pLayerContainer,
00630 KFbxLayerElement::ELayerElementType pLayerType,
00631 KFbxNode* pParentNode);
00632
00633 void BuildTextureLayersDirectArrayForLayerType(KFbxLayerContainer* pLayerContainer,
00634 KFbxLayerElement::ELayerElementType pLayerType);
00635
00636 public:
00637 void ConvertNurbsSurfaceToNurb();
00638 void ConvertMeshNormals();
00639 void ConvertNurbCurvesToNulls();
00640 void ConnectTextures();
00641 void BuildTextureLayersDirectArray();
00642 void FixInheritType(KFbxNode *pNode);
00643 kFbxClassId ConvertAttributeTypeToClassID(KFbxNodeAttribute::EAttributeType pAttributeType);
00644
00645 KFbxGlobalLightSettings& GlobalLightSettings() { return *mGlobalLightSettings; }
00646 KFbxGlobalCameraSettings& GlobalCameraSettings() { return *mGlobalCameraSettings; }
00647 KFbxGlobalTimeSettings& GlobalTimeSettings() { return *mGlobalTimeSettings; }
00648
00649 private:
00650 KFbxNode* mRootNode;
00651
00652 KFbxGlobalLightSettings* mGlobalLightSettings;
00653 KFbxGlobalCameraSettings* mGlobalCameraSettings;
00654 KFbxGlobalTimeSettings* mGlobalTimeSettings;
00655
00656 KFbxAnimEvaluator* mEvaluator;
00657
00658 KCharPtrSet mTakeTimeWarpSet;
00659
00660 friend class KFbxLayerContainer;
00661 friend class KFbxNodeFinderDuplicateName;
00662 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00663 };
00664
00665 typedef class KFBX_DLL KArrayTemplate<KFbxTakeInfo *> KArrayKFbxTakeInfo;
00666 typedef KFbxScene* HKFbxScene;
00667
00668 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00669
00670 #endif // FBXFILESDK_KFBXPLUGINS_KFBXSCENE_H
00671