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_TEXTURE_MANAGER_H_ 00026 #define TRANSLATION_TEXTURE_MANAGER_H_ 00027 00028 #include <Core/Container/HashMap.h> 00029 #include <Core/Container/ArrayList.h> 00030 #include <Translator/Texture/TranslationTexture.h> 00031 00032 namespace LampForMaya{ 00033 00034 //------------------------------------------------------------------------------ 00035 /** 00036 * 変換テクスチャマネージャ 00037 */ 00038 class TranslationTextureManager{ 00039 public: 00040 /** 00041 * コンストラクタ 00042 */ 00043 TranslationTextureManager(); 00044 00045 /** 00046 * デストラクタ 00047 */ 00048 virtual ~TranslationTextureManager(); 00049 00050 /** 00051 * テクスチャの収集 00052 * @return 成功すればtrue 00053 */ 00054 virtual bool collectTextures(); 00055 00056 /** 00057 * Lampへの変換 00058 * @param scene 変換先シーン 00059 * @return 成功すればtrue 00060 */ 00061 virtual bool convertToLamp(Scene* scene) const; 00062 00063 /** 00064 * クリア 00065 * @return 削除したオブジェクト数 00066 */ 00067 virtual int clear(); 00068 00069 /** 00070 * テクスチャ数の取得 00071 * @return テクスチャ数 00072 */ 00073 virtual int getCount() const{ return array_.getCount(); } 00074 00075 /** 00076 * テクスチャの取得 00077 * @param index テクスチャのインデクス 00078 * @return テクスチャ 00079 */ 00080 virtual TranslationTexture* get(int index) const{ 00081 return array_.get(index); 00082 } 00083 00084 /** 00085 * テクスチャの検索 00086 * @param name 検索するテクスチャ名 00087 * @return テクスチャ 00088 */ 00089 virtual TranslationTexture* search(String name) const{ 00090 return database_.get(name); 00091 } 00092 00093 protected: 00094 /** 00095 * テクスチャの解析 00096 * @param textureObject テクスチャオブジェクト 00097 */ 00098 virtual bool analysisTexture(const MObject& textureObject); 00099 00100 private: 00101 // コピーコンストラクタの隠蔽 00102 TranslationTextureManager(const TranslationTextureManager& copy); 00103 00104 // 代入コピーの隠蔽 00105 void operator =(const TranslationTextureManager& copy); 00106 00107 // テクスチャデータベース 00108 Lamp::HashMap<String, TranslationTexture*> database_; 00109 // テクスチャ配列 00110 ArrayList<TranslationTexture*> array_; 00111 00112 }; 00113 00114 //------------------------------------------------------------------------------ 00115 } // End of namespace LampForMaya 00116 #endif // End of TRANSLATION_TEXTURE_MANAGER_H_ 00117 //------------------------------------------------------------------------------