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_MODEL_MANAGER_H_ 00026 #define TRANSLATION_MODEL_MANAGER_H_ 00027 00028 #include <Core/Container/HashMap.h> 00029 #include <Core/Container/ArrayList.h> 00030 #include <Translator/Model/TranslationStandardModel.h> 00031 00032 namespace LampForMaya{ 00033 00034 //------------------------------------------------------------------------------ 00035 /** 00036 * 変換モデルマネージャ 00037 */ 00038 class TranslationModelManager{ 00039 public: 00040 /** 00041 * コンストラクタ 00042 */ 00043 TranslationModelManager(); 00044 00045 /** 00046 * デストラクタ 00047 */ 00048 virtual ~TranslationModelManager(); 00049 00050 //-------------------------------------------------------------------------- 00051 /** 00052 * モデルの収集 00053 * @param meshManager メッシュマネージャ 00054 * @return 成功すればtrue 00055 */ 00056 virtual bool collectModels(TranslationMeshManager* meshManager); 00057 00058 /** 00059 * アニメーションの収集 00060 * @return 成功すればtrue 00061 */ 00062 virtual bool collectAnimations(); 00063 00064 //-------------------------------------------------------------------------- 00065 /** 00066 * Lampへの変換 00067 * @param scene 変換先シーン 00068 * @return 成功すればtrue 00069 */ 00070 virtual bool convertToLamp(Scene* scene) const; 00071 00072 /** 00073 * アニメーションの変換 00074 * @param animationManager アニメーションマネージャ 00075 * @param animationSet アニメーションセット 00076 * @return 成功すればtrue 00077 */ 00078 virtual bool convertAnimation( 00079 AnimationManager* animationManager, AnimationSet* animationSet); 00080 00081 //-------------------------------------------------------------------------- 00082 /** 00083 * クリア 00084 * @return 削除したオブジェクト数 00085 */ 00086 virtual int clear(); 00087 00088 /** 00089 * モデル数の取得 00090 * @return モデル数 00091 */ 00092 virtual int getCount() const{ return array_.getCount(); } 00093 00094 /** 00095 * モデルの取得 00096 * @param index モデルのインデクス 00097 * @return モデル 00098 */ 00099 virtual TranslationModel* get(int index) const{ return array_.get(index); } 00100 00101 /** 00102 * モデルの検索 00103 * @param name 検索するモデル名 00104 * @return モデル 00105 */ 00106 virtual TranslationModel* search(String name) const{ 00107 return database_.get(name); 00108 } 00109 00110 protected: 00111 /** 00112 * モデルの解析 00113 * @param dagPath DAGパス 00114 */ 00115 virtual bool analysisModel(MDagPath dagPath); 00116 00117 private: 00118 // コピーコンストラクタの隠蔽 00119 TranslationModelManager(const TranslationModelManager& copy); 00120 00121 // 代入コピーの隠蔽 00122 void operator =(const TranslationModelManager& copy); 00123 00124 // モデルデータベース 00125 Lamp::HashMap<String, TranslationModel*> database_; 00126 // モデル配列 00127 ArrayList<TranslationModel*> array_; 00128 // メッシュマネージャ 00129 TranslationMeshManager* meshManager_; 00130 00131 }; 00132 00133 //------------------------------------------------------------------------------ 00134 } // End of namespace LampForMaya 00135 #endif // End of TRANSLATION_MODEL_MANAGER_H_ 00136 //------------------------------------------------------------------------------