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 * Mayaテクスチャマネージャヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef MAYA_TEXTURE_MANAGER_H_ 00026 #define MAYA_TEXTURE_MANAGER_H_ 00027 00028 #include <Core/Container/HashMap.h> 00029 #include <Core/Container/ArrayList.h> 00030 00031 namespace LampForMaya{ 00032 00033 class MayaTexture; 00034 00035 //------------------------------------------------------------------------------ 00036 /** 00037 * Mayaテクスチャマネージャ 00038 */ 00039 class MayaTextureManager{ 00040 public: 00041 //-------------------------------------------------------------------------- 00042 /** 00043 * 参照の追加 00044 */ 00045 static void addReference(); 00046 00047 /** 00048 * 参照の削除 00049 */ 00050 static void removeReference(); 00051 00052 //-------------------------------------------------------------------------- 00053 /** 00054 * バインド 00055 * @param textureNode テクスチャノード 00056 * @return 成功すればtrue 00057 */ 00058 static bool bind(const MObject& textureNode); 00059 00060 //-------------------------------------------------------------------------- 00061 /** 00062 * 名前変更コールバック 00063 * @param node 名前が変更されたノード 00064 * @param data データ 00065 */ 00066 static void renameCallback(MObject& node, void* data); 00067 00068 /** 00069 * 汚れコールバック 00070 * @param data データ 00071 */ 00072 static void dirtyCallback(void* data); 00073 00074 protected: 00075 //-------------------------------------------------------------------------- 00076 /** 00077 * 初期化 00078 */ 00079 static void initialize(); 00080 00081 /** 00082 * 後始末 00083 */ 00084 static void finalize(); 00085 00086 /** 00087 * データベースに追加 00088 * @param texture テクスチャ 00089 */ 00090 static void addDatabase(MayaTexture* texture); 00091 00092 /** 00093 * データベースから削除 00094 * @param texture テクスチャ 00095 */ 00096 static void removeDatabase(MayaTexture* texture); 00097 00098 /** 00099 * データベースのクリア 00100 */ 00101 static void clearDatabase(); 00102 00103 private: 00104 // コンストラクタの隠蔽 00105 MayaTextureManager(); 00106 00107 // データベース 00108 static HashMap<String, MayaTexture*>* database_; 00109 // 配列 00110 static ArrayList<MayaTexture*>* array_; 00111 // リファレンスカウント 00112 static int referenceCount_; 00113 00114 }; 00115 00116 //------------------------------------------------------------------------------ 00117 } // End of namespace LampForMaya 00118 #endif // End of MAYA_TEXTURE_MANAGER_H_ 00119 //------------------------------------------------------------------------------ 00120