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 TEXT_COLLISION_SAVER_H_ 00026 #define TEXT_COLLISION_SAVER_H_ 00027 00028 namespace Lamp{ 00029 00030 class TextWriter; 00031 class CollisionScene; 00032 class CollisionNode; 00033 class CollisionLeaf; 00034 class StaticSphereCollision; 00035 class StaticDeformedMeshCollision; 00036 00037 //------------------------------------------------------------------------------ 00038 /** 00039 * テキストコリジョンセーバ 00040 */ 00041 class TextCollisionSaver{ 00042 public: 00043 /** 00044 * コンストラクタ 00045 */ 00046 TextCollisionSaver(); 00047 00048 /** 00049 * デストラクタ 00050 */ 00051 virtual ~TextCollisionSaver(); 00052 00053 /** 00054 * セーブ 00055 * @param filePath ファイルパス 00056 * @param scene セーブするシーン 00057 */ 00058 virtual void save(const String& filePath, CollisionScene* scene); 00059 00060 /** 00061 * セーブ 00062 * @param textWriter テキストライタ 00063 * @param scene セーブするシーン 00064 * @param basePath ベースパス 00065 */ 00066 virtual void save(TextWriter* textWriter, CollisionScene* scene); 00067 00068 protected: 00069 //-------------------------------------------------------------------------- 00070 /** 00071 * ヘッダの書き出し 00072 */ 00073 virtual void writeHeader(); 00074 00075 /** 00076 * コリジョンノードの書き出し 00077 * @param node 書き出すコリジョンノード 00078 */ 00079 virtual void writeCollisionNode(CollisionNode* node); 00080 00081 //-------------------------------------------------------------------------- 00082 // リーフ 00083 //-------------------------------------------------------------------------- 00084 /** 00085 * コリジョンリーフの書き出し 00086 * @param leaf 書き出すコリジョンリーフ 00087 * @param type リーフタイプ 00088 */ 00089 virtual void writeCollisionLeaf(CollisionLeaf* leaf, const String& type); 00090 00091 /** 00092 * 静的球コリジョンの書き出し 00093 * @param sphere 書き出す静的球コリジョン 00094 */ 00095 virtual void writeStaticSphereCollision(StaticSphereCollision* sphere); 00096 00097 /** 00098 * 静的変形メッシュコリジョンの書き出し 00099 * @param mesh 書き出す静的変形メッシュコリジョン 00100 */ 00101 virtual void writeStaticDeformedMeshCollision( 00102 StaticDeformedMeshCollision* mesh); 00103 00104 //-------------------------------------------------------------------------- 00105 // リンク 00106 //-------------------------------------------------------------------------- 00107 /** 00108 * コリジョンノードリンクの書き出し 00109 * @param node 書き出すコリジョンノード 00110 */ 00111 virtual void writeCollisionNodeLink(CollisionNode* node); 00112 00113 //-------------------------------------------------------------------------- 00114 // ユーティリティ 00115 //-------------------------------------------------------------------------- 00116 /** 00117 * boolの書き出し 00118 */ 00119 virtual void writeBool(bool); 00120 00121 /** 00122 * 線コメントの書き出し 00123 */ 00124 virtual void writeLineComment(); 00125 00126 /** 00127 * ブロックコメントの書き出し 00128 * @param blockName ブロック名 00129 */ 00130 virtual void writeBlockComment(const String& blockName); 00131 00132 //-------------------------------------------------------------------------- 00133 // メンバ 00134 //-------------------------------------------------------------------------- 00135 /// ライタ 00136 TextWriter* writer_; 00137 /// シーン 00138 CollisionScene* scene_; 00139 00140 private: 00141 //-------------------------------------------------------------------------- 00142 // コピーコンストラクタの隠蔽 00143 TextCollisionSaver(const TextCollisionSaver& copy); 00144 00145 // 代入コピーの隠蔽 00146 void operator =(const TextCollisionSaver& copy); 00147 00148 }; 00149 00150 //------------------------------------------------------------------------------ 00151 } // End of namespace Lamp 00152 #endif // End of TEXT_COLLISION_SAVER_H_ 00153 //------------------------------------------------------------------------------