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