00001 //------------------------------------------------------------------------------ 00002 // Lamp : Open source game middleware 00003 // Copyright (C) 2004 Junpei Ohtani ( Email : junpee@users.sourceforge.jp ) 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 //------------------------------------------------------------------------------ 00019 00020 /** @file 00021 * 変換マテリアルマネージャヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef TRANSLATION_MATERIAL_MANAGER_H_ 00026 #define TRANSLATION_MATERIAL_MANAGER_H_ 00027 00028 #include <Core/Container/HashMap.h> 00029 #include <Core/Container/ArrayList.h> 00030 00031 namespace Lamp{ 00032 class Scene; 00033 } 00034 00035 namespace LampForMaya{ 00036 00037 class TranslationMaterial; 00038 00039 //------------------------------------------------------------------------------ 00040 /** 00041 * 変換マテリアルマネージャ 00042 */ 00043 class TranslationMaterialManager{ 00044 public: 00045 /** 00046 * コンストラクタ 00047 */ 00048 TranslationMaterialManager(); 00049 00050 /** 00051 * デストラクタ 00052 */ 00053 virtual ~TranslationMaterialManager(); 00054 00055 /** 00056 * マテリアルの収集 00057 * @return 成功すればtrue 00058 */ 00059 virtual bool collectMaterials(); 00060 00061 /** 00062 * Lampへの変換 00063 * @param scene 変換先シーン 00064 * @return 成功すればtrue 00065 */ 00066 virtual bool convertToLamp(Scene* scene) const; 00067 00068 /** 00069 * クリア 00070 * @return 削除したオブジェクト数 00071 */ 00072 virtual int clear(); 00073 00074 /** 00075 * マテリアル数の取得 00076 * @return マテリアル数 00077 */ 00078 virtual int getCount() const{ return array_.getCount(); } 00079 00080 /** 00081 * マテリアルの取得 00082 * @param index マテリアルのインデクス 00083 * @return マテリアル 00084 */ 00085 virtual TranslationMaterial* get(int index) const{ 00086 return array_.get(index); 00087 } 00088 00089 /** 00090 * マテリアルの検索 00091 * @param name 検索するマテリアル名 00092 * @return マテリアル 00093 */ 00094 virtual TranslationMaterial* search(String name) const{ 00095 return database_.get(name); 00096 } 00097 00098 protected: 00099 /** 00100 * マテリアルの解析 00101 * @param materialObject マテリアルオブジェクト 00102 * @return 成功すればtrue 00103 */ 00104 virtual bool analysisMaterial(const MObject& materialObject); 00105 00106 private: 00107 // コピーコンストラクタの隠蔽 00108 TranslationMaterialManager(const TranslationMaterialManager& copy); 00109 00110 // 代入コピーの隠蔽 00111 void operator =(const TranslationMaterialManager& copy); 00112 00113 // マテリアルデータベース 00114 Lamp::HashMap<String, TranslationMaterial*> database_; 00115 // マテリアル配列 00116 ArrayList<TranslationMaterial*> array_; 00117 00118 }; 00119 00120 //------------------------------------------------------------------------------ 00121 } // End of namespace LampForMaya 00122 #endif // End of TRANSLATION_MATERIAL_MANAGER_H_ 00123 //------------------------------------------------------------------------------