Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00024 #ifndef __VR3MATERIALMANAGER_H__
00025 #define __VR3MATERIALMANAGER_H__
00026
00027
00028 #include <map>
00029
00030 #include <VR3Map.h>
00031
00033
00056 class VR3MaterialManager {
00058 struct MapElement {
00060 VR3Material* material;
00062 int count;
00063 };
00064
00066
00067 static std::map<std::string,std::map<int,std::map<int,MapElement>>,VR3Map::Less> ms_materials;
00068
00070 VR3MaterialManager();
00071
00072
00073
00075
00076
00078
00088 static void LoadMatTextureAAM( std::ifstream& is,
00089 const char* file_name,
00090 VR3Material::MatTexture* mattex);
00091
00092 public:
00093
00095
00119 static void LoadMatAAM( const char* file_name,
00120 VR3Material* material,
00121 const char* mat_name = 0,
00122 int matID = -1,
00123 const char* multimat_name = 0,
00124 int submatID = -1 );
00125
00127
00128
00129
00131
00132
00133 private:
00134
00136
00145 static void CreateMaterial(VR3Material* material);
00146
00147 public:
00148
00150
00170 static VR3Material* FindMaterial( const char* file_name,
00171 const char* mat_name = 0,
00172 int matID = -1,
00173 const char* multimat_name = 0,
00174 int submatID = -1 );
00175
00177
00185 static void DeleteReference(VR3Material* material);
00186
00188
00196 static void AddReference(VR3Material* material);
00197
00199
00200
00201
00203
00204
00206
00232 static int ListMaterialsAAM( const char* file_name,
00233 int ids[],
00234 std::string mat_names[],
00235 int subids[],
00236 std::string multimat_names[],
00237 int count );
00238
00240
00241 };
00242
00243 #endif