00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef NL_ASYNC_FILE_MANAGER_3D_H
00027 #define NL_ASYNC_FILE_MANAGER_3D_H
00028
00029 #include "nel/misc/types_nl.h"
00030 #include "nel/misc/thread.h"
00031 #include "nel/misc/async_file_manager.h"
00032
00033
00034 namespace NL3D
00035 {
00036
00037 class IShape;
00038 class IDriver;
00039 class CInstanceGroup;
00040 class UInstanceGroup;
00041 class CTextureFile;
00042
00049 class CAsyncFileManager3D
00050 {
00051
00052 public:
00053
00054 static CAsyncFileManager3D &getInstance ();
00055 static void terminate ();
00056
00057 void loadMesh (const std::string &sMeshName, IShape **ppShp, IDriver *pDriver);
00058 bool cancelLoadMesh (const std::string& sMeshName);
00059
00060 void loadIG (const std::string &igName, CInstanceGroup **ppIG);
00061 void loadIGUser (const std::string &igName, UInstanceGroup **ppIG);
00062
00063 void loadTexture (CTextureFile *textureFile, bool *pSgn);
00064 bool cancelLoadTexture (CTextureFile *textFile);
00065
00066
00067
00068 void loadFile (const std::string &fileName, uint8 **pPtr);
00069 void loadFiles (const std::vector<std::string> &vFileNames, const std::vector<uint8**> &vPtrs);
00070
00071
00072 void signal (bool *pSgn);
00073 void cancelSignal (bool *pSgn);
00074
00075 private:
00076
00077
00078 CAsyncFileManager3D ();
00079
00080 static CAsyncFileManager3D *_Singleton;
00081
00082
00083 friend class CLoadMeshCancel;
00084 friend class CLoadTextureCancel;
00085
00086
00087
00088
00089
00090 class CMeshLoad : public NLMISC::IRunnable
00091 {
00092 IShape **_ppShp;
00093 IDriver *_pDriver;
00094 public:
00095 std::string MeshName;
00096 public:
00097 CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver);
00098 void run (void);
00099 };
00100
00101
00102 class CIGLoad : public NLMISC::IRunnable
00103 {
00104 std::string _IGName;
00105 CInstanceGroup **_ppIG;
00106 public:
00107 CIGLoad (const std::string& meshName, CInstanceGroup **ppIG);
00108 void run (void);
00109 };
00110
00111
00112 class CIGLoadUser : public NLMISC::IRunnable
00113 {
00114 std::string _IGName;
00115 UInstanceGroup **_ppIG;
00116 public:
00117 CIGLoadUser (const std::string& meshName, UInstanceGroup **ppIG);
00118 void run (void);
00119 };
00120
00121
00122 class CTextureLoad : public NLMISC::IRunnable
00123 {
00124 public:
00125 CTextureFile *TextureFile;
00126 bool *Signal;
00127 public:
00128 CTextureLoad(CTextureFile *textureFile, bool *psgn)
00129 : TextureFile(textureFile), Signal(psgn)
00130 {}
00131
00132 virtual void run();
00133 };
00134
00135 };
00136
00137
00138 }
00139
00140
00141 #endif // NL_ASYNC_FILE_MANAGER_3D_H
00142
00143