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
00041 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00042 #include <fbxfilesdk/components/kbaselib/kaydara.h>
00043
00044 #include <fbxfilesdk/fbxcore/fbxcollection/kfbxdocument.h>
00045
00046 #include <fbxfilesdk/kfbxplugins/kfbxdeformer.h>
00047 #include <fbxfilesdk/kfbxplugins/kfbxsubdeformer.h>
00048 #include <fbxfilesdk/kfbxplugins/kfbxlayer.h>
00049 #include <fbxfilesdk/kfbxplugins/kfbxnodeattribute.h>
00050 #include <fbxfilesdk/kfbxplugins/kfbxglobalsettings.h>
00051
00052 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00053 #include <fbxfilesdk/components/kbaselib/klib/kerror.h>
00054 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00055 #include <fbxfilesdk/components/kbaselib/klib/kcharptrset.h>
00056
00057 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00058
00059 class KFbxSdkManager;
00060 class KFbxObject;
00061 class KFbxNode;
00062 class KFbxVideo;
00063 class KFbxTexture;
00064 class KFbxSurfaceMaterial;
00065 class KFbxMarkerSet;
00066 class KFbxActor;
00067 class KFbxCharacter;
00068 class KFbxControlSetPlug;
00069 class KFbxCharacterPose;
00070 class KFbxPose;
00071 class KFbxDocumentInfo;
00072 class KFbxTakeInfo;
00073 class KFbxGlobalLightSettings;
00074 class KFbxGlobalCameraSettings;
00075 class KFbxGlobalTimeSettings;
00076 class KFbxGlobalSettings;
00077 class KFbxGenericNode;
00078 class KFbxConstraint;
00079 class KFbxGeometry;
00080 class KFbxTakeNodeContainer;
00081 class KFbxLayerContainer;
00082
00092 class KFBX_DLL KFbxScene : public KFbxDocument
00093 {
00094 KFBXOBJECT_DECLARE(KFbxScene,KFbxDocument);
00095
00096 public:
00098 void Clear();
00099
00104
00111 KFbxNode* GetRootNode() const;
00112
00113
00121 K_DEPRECATED void FillNodeArray(KArrayTemplate<KFbxNode*>& pNodeArray,
00122 KFbxNodeAttribute::EAttributeType pAttributeType,
00123 bool pDepthFirst = false);
00124
00132 void FillNodeArray(KArrayTemplate<KFbxNode*>& pNodeArray,
00133 kFbxClassId classId,
00134 bool pDepthFirst = false);
00135
00137
00142
00146 void FillTextureArray(KArrayTemplate<KFbxTexture*>& pTextureArray);
00147
00151 void FillMaterialArray(KArrayTemplate<KFbxSurfaceMaterial*>& pMaterialArray);
00152
00154
00159
00163 int GetGenericNodeCount();
00164
00169 KFbxGenericNode* GetGenericNode(int pIndex);
00170
00175 KFbxGenericNode* GetGenericNode(char* pName);
00176
00181 bool AddGenericNode(KFbxGenericNode* pGenericNode);
00182
00188 bool RemoveGenericNode(KFbxGenericNode* pGenericNode);
00189
00191
00192
00197
00201 int GetCharacterCount();
00202
00207 KFbxCharacter* GetCharacter(int pIndex);
00208
00213 int CreateCharacter(char* pName);
00214
00219 void DestroyCharacter(int pIndex);
00220
00222
00227
00231 int GetControlSetPlugCount();
00232
00237 KFbxControlSetPlug* GetControlSetPlug(int pIndex);
00238
00243 int CreateControlSetPlug(char* pName);
00244
00249 void DestroyControlSetPlug(int pIndex);
00250
00252
00257
00262 int GetCharacterPoseCount();
00263
00268 KFbxCharacterPose* GetCharacterPose(int pIndex);
00269
00274 int CreateCharacterPose(char* pName);
00275
00280 void DestroyCharacterPose(int pIndex);
00281
00283
00288
00293 int GetPoseCount();
00294
00299 KFbxPose* GetPose(int pIndex);
00300
00306 bool AddPose(KFbxPose* pPose);
00307
00313 bool RemovePose(KFbxPose* pPose);
00314
00320 bool RemovePose(int pIndex);
00321
00322
00324
00328
00332 inline KFbxDocumentInfo* GetSceneInfo() { return GetDocumentInfo(); }
00333
00337 inline void SetSceneInfo(KFbxDocumentInfo* pSceneInfo) { SetDocumentInfo(pSceneInfo); }
00338
00340
00345
00349 KFbxGlobalLightSettings& GetGlobalLightSettings();
00350
00354 KFbxGlobalCameraSettings& GetGlobalCameraSettings();
00355
00359 KFbxGlobalTimeSettings& GetGlobalTimeSettings();
00360
00364 KFbxGlobalSettings& GetGlobalSettings();
00365
00369 const KFbxGlobalSettings& GetGlobalSettings() const;
00370
00372
00374
00375
00376
00377
00378
00379
00381
00382 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00383
00384 void ConnectMaterials();
00385
00386 void BuildMaterialLayersDirectArray();
00387 void ReindexMaterialConnections();
00388
00392 void FillNodeArray(KArrayTemplate<KFbxNode*>& pNodeArray);
00393
00397 void FillPoseArray(KArrayTemplate<KFbxPose*>& pPoseArray);
00398
00399
00400 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00401
00402
00407
00411 int GetMaterialCount ();
00412
00418 KFbxSurfaceMaterial* GetMaterial (int pIndex);
00419
00424 KFbxSurfaceMaterial* GetMaterial (char* pName);
00425
00430 bool AddMaterial (KFbxSurfaceMaterial* pMaterial);
00431
00436 bool RemoveMaterial (KFbxSurfaceMaterial* pMaterial);
00437
00439
00444
00448 int GetTextureCount ();
00449
00455 KFbxTexture* GetTexture (int pIndex);
00456
00461 KFbxTexture* GetTexture (char* pName);
00462
00467 bool AddTexture (KFbxTexture* pTexture);
00468
00473 bool RemoveTexture (KFbxTexture* pTexture);
00474
00476
00481
00485 int GetNodeCount ();
00486
00492 KFbxNode* GetNode (int pIndex);
00493
00498 bool AddNode (KFbxNode* pNode);
00499
00504 bool RemoveNode (KFbxNode* pNode);
00505
00512 int GetCurveOnSurfaceCount ();
00513
00514 KFbxNode* FindNodeByName ( const KString& pName );
00515
00517
00522
00526 int GetGeometryCount ();
00527
00533 KFbxGeometry* GetGeometry (int pIndex);
00534
00539 bool AddGeometry (KFbxGeometry* pGeometry);
00540
00545 bool RemoveGeometry (KFbxGeometry* pGeometry);
00546
00548
00553
00557 int GetVideoCount ();
00558
00564 KFbxVideo* GetVideo (int pIndex);
00565
00570 bool AddVideo (KFbxVideo* pVideo);
00571
00576 bool RemoveVideo (KFbxVideo* pVideo);
00577
00579
00580 int GetTakeNodeContainerCount ();
00581 KFbxTakeNodeContainer* GetTakeNodeContainer (int pIndex);
00582 bool AddTakeNodeContainer (KFbxTakeNodeContainer* pTakeNodeContainer);
00583 bool RemoveTakeNodeContainer (KFbxTakeNodeContainer* pTakeNodeContainer);
00584
00585 KSet* AddTakeTimeWarpSet(char *pTakeName);
00586 KSet* GetTakeTimeWarpSet(char *pTakeName);
00587
00588 private:
00589 KFbxScene(KFbxSdkManager& pManager, char const* pName);
00590 ~KFbxScene();
00591
00592 virtual void Construct(const KFbxScene* pFrom);
00593 virtual void Destruct(bool pRecursive, bool pDependents);
00594
00595 KFbxScene& operator=(KFbxScene const& pScene);
00596
00597 K_DEPRECATED void FillNodeArrayRecursive(KArrayTemplate<KFbxNode*>& pNodeArray,
00598
00599 KFbxNodeAttribute::EAttributeType pAttributeType,
00600
00601 KFbxNode* pNode);
00602
00603 void FillNodeArrayRecursive(KArrayTemplate<KFbxNode*>& pNodeArray,
00604 kFbxClassId classId,
00605 KFbxNode* pNode);
00606
00607 void ConnectTextureLayerElement(KFbxLayerContainer* pLayerContainer,
00608 KFbxLayerElement::ELayerElementType pLayerType,
00609 KFbxNode* pParentNode);
00610
00611 void BuildTextureLayersDirectArrayForLayerType(KFbxLayerContainer* pLayerContainer,
00612 KFbxLayerElement::ELayerElementType pLayerType);
00613
00614 public:
00615 void ConvertNurbsSurfaceToNurb();
00616 void ConvertMeshNormals();
00617 void ConvertNurbCurvesToNulls();
00618 void ConnectTextures();
00619 void BuildTextureLayersDirectArray();
00620 void FixInheritType(KFbxNode *pNode);
00621 kFbxClassId ConvertAttributeTypeToClassID(KFbxNodeAttribute::EAttributeType pAttributeType);
00622
00623 private:
00624 KFbxNode* mRootNode;
00625
00626 KFbxGlobalLightSettings* mGlobalLightSettings;
00627 KFbxGlobalCameraSettings* mGlobalCameraSettings;
00628 KFbxGlobalTimeSettings* mGlobalTimeSettings;
00629
00630 KCharPtrSet mTakeTimeWarpSet;
00631
00632 friend class KFbxLayerContainer;
00633 friend class KFbxNodeFinderDuplicateName;
00634 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00635 };
00636
00637 typedef class KFBX_DLL KArrayTemplate<KFbxTakeInfo *> KArrayKFbxTakeInfo;
00638 typedef KFbxScene* HKFbxScene;
00639
00640 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00641
00642 #endif // FBXFILESDK_KFBXPLUGINS_KFBXSCENE_H
00643