00001 #ifndef IG_G4_VOLUMES_IG_SO_MATERIAL_MAP_H
00002 # define IG_G4_VOLUMES_IG_SO_MATERIAL_MAP_H
00003
00004
00005
00006 # include "Iguana/Controls/interface/config.h"
00007 # include "Inventor/nodes/SoMaterial.h"
00008 # include <map>
00009 # include <string>
00010
00011
00012
00013
00014
00015 class SoMaterial;
00016 class SoInput;
00017
00018
00019
00020
00021
00022 class IG3DMATERIAL_EDITOR_API IgSoMaterialMap
00023 {
00024 public:
00025 typedef std::map<std::string, SoMaterial *> MaterialMap;
00026
00027
00028 IgSoMaterialMap (void);
00029 SoMaterial *operator[] (const std::string &name);
00030 MaterialMap::iterator begin (void);
00031 MaterialMap::iterator end (void);
00032 SoMaterial *getFullInfos (const std::string &name)
00033 {
00034 return m_materialMap [name];
00035 }
00036
00037 void addEntry (const char *name, SoMaterial *entry)
00038 {
00039 entry->ref ();
00040 entry->setName (name);
00041 m_materialMap [name] = entry;
00042 }
00043
00044 void load (SoInput &input);
00045
00046 private:
00047 MaterialMap m_materialMap;
00048 void setDefaultMaterials (void);
00049 };
00050
00051 class IG3DMATERIAL_EDITOR_API IgSoMaterialMapSingleton
00052 {
00053 public:
00054 static IgSoMaterialMap *instance (void)
00055 {
00056 static IgSoMaterialMap *__instance = 0;
00057 if (__instance == 0)
00058 {
00059 __instance = new IgSoMaterialMap ();
00060 }
00061 return __instance;
00062 }
00063 };
00064
00065
00066
00067
00068
00069 #endif // IG_G4_VOLUMES_IG_SO_MATERIAL_MAP_H