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_MESH_MANAGER_H_ 00026 #define TRANSLATION_MESH_MANAGER_H_ 00027 00028 #include <Core/Container/HashMap.h> 00029 #include <Core/Container/ArrayList.h> 00030 #include <Translator/Mesh/TranslationRigidMesh.h> 00031 #include <Translator/Mesh/TranslationCharacterMesh.h> 00032 00033 namespace LampForMaya{ 00034 00035 class TranslationMesh; 00036 00037 //------------------------------------------------------------------------------ 00038 /** 00039 * 変換メッシュマネージャ 00040 */ 00041 class TranslationMeshManager{ 00042 public: 00043 /** 00044 * コンストラクタ 00045 */ 00046 TranslationMeshManager(); 00047 00048 /** 00049 * デストラクタ 00050 */ 00051 virtual ~TranslationMeshManager(); 00052 00053 /** 00054 * Lampへの変換 00055 * @param scene 変換先シーン 00056 * @return 成功すればtrue 00057 */ 00058 virtual bool convertToLamp(Scene* scene) const; 00059 00060 /** 00061 * クリア 00062 * @return 削除したオブジェクト数 00063 */ 00064 virtual int clear(); 00065 00066 /** 00067 * 剛体メッシュの作成 00068 * 00069 * すでに同じメッシュ名のメッシュが存在するとエラーになります。 00070 * 空文字列を名前に指定するとエラーになります。 00071 * @param meshName メッシュ名 00072 * @return 作成されたメッシュ 00073 */ 00074 TranslationRigidMesh* createRigidMesh(const String& meshName); 00075 00076 /** 00077 * キャラクタメッシュの作成 00078 * 00079 * すでに同じメッシュ名のメッシュが存在するとエラーになります。 00080 * 空文字列を名前に指定するとエラーになります。 00081 * @param meshName メッシュ名 00082 * @return 作成されたメッシュ 00083 */ 00084 TranslationCharacterMesh* createCharacterMesh(const String& meshName); 00085 00086 /** 00087 * メッシュ数の取得 00088 * @return メッシュ数 00089 */ 00090 virtual int getCount() const{ return array_.getCount(); } 00091 00092 /** 00093 * メッシュの取得 00094 * @param index メッシュのインデクス 00095 * @return メッシュ 00096 */ 00097 virtual TranslationMesh* get(int index) const{ return array_.get(index); } 00098 00099 /** 00100 * メッシュの検索 00101 * @param name 検索するメッシュ名 00102 * @return メッシュ 00103 */ 00104 virtual TranslationMesh* search(String name) const{ 00105 return database_.get(name); 00106 } 00107 00108 protected: 00109 00110 private: 00111 // コピーコンストラクタの隠蔽 00112 TranslationMeshManager(const TranslationMeshManager& copy); 00113 00114 // 代入コピーの隠蔽 00115 void operator =(const TranslationMeshManager& copy); 00116 00117 // メッシュデータベース 00118 Lamp::HashMap<String, TranslationMesh*> database_; 00119 // メッシュ配列 00120 ArrayList<TranslationMesh*> array_; 00121 }; 00122 00123 //------------------------------------------------------------------------------ 00124 } // End of namespace LampForMaya 00125 #endif // End of TRANSLATION_MESH_MANAGER_H_ 00126 //------------------------------------------------------------------------------