Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

TranslationModel.h

Go to the documentation of this file.
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_H_
00026 #define TRANSLATION_MODEL_H_
00027 
00028 namespace Lamp{
00029     class Scene;
00030     class AnimationManager;
00031     class AnimationSet;
00032 }
00033 
00034 #include <Core/Container/ArrayList.h>
00035 
00036 namespace LampForMaya{
00037 
00038 class TranslationMeshManager;
00039 class TranslationMesh;
00040 class TranslationStandardModel;
00041 class TranslationCharacterModel;
00042 
00043 //------------------------------------------------------------------------------
00044 /**
00045  * 変換モデル
00046  */
00047 class TranslationModel{
00048 friend class TranslationModelManager;
00049 public:
00050     /**
00051      * デストラクタ
00052      */
00053     virtual ~TranslationModel();
00054 
00055     //--------------------------------------------------------------------------
00056     /**
00057      * 分析
00058      * @param meshManager メッシュマネージャ
00059      * @return 成功すればtrue
00060      */
00061     virtual bool analyze(TranslationMeshManager* meshManager) = 0;
00062 
00063     /**
00064      * ピボットのコンパイル
00065      * @param pivot ピボット位置
00066      */
00067     virtual void compilePivot(const Vector3& pivot);
00068 
00069     /**
00070      * アニメーションの分析
00071      * @return 成功すればtrue
00072      */
00073     virtual bool analyzeAnimation(){ return true; }
00074 
00075     //--------------------------------------------------------------------------
00076     /**
00077      * Lampへの変換
00078      * @param scene シーン
00079      * @return 成功すればtrue
00080      */
00081     virtual bool convertToLamp(Scene* scene) = 0;
00082 
00083     /**
00084      * アニメーションの変換
00085      * @param animationManager アニメーションマネージャ
00086      * @param animationSet アニメーションセット
00087      * @return 成功すればtrue
00088      */
00089     virtual bool convertAnimation(
00090         AnimationManager* animationManager, AnimationSet* animationSet){
00091         return true;
00092     }
00093 
00094     //--------------------------------------------------------------------------
00095     /**
00096      * オブジェクトの取得
00097      * @return オブジェクト
00098      */
00099     virtual MObject getObject() const{ return object_; }
00100 
00101     /**
00102      * 名前の取得
00103      * @return 名前
00104      */
00105     virtual String getName() const{ return name_; }
00106 
00107     //--------------------------------------------------------------------------
00108     // RTTI
00109     //--------------------------------------------------------------------------
00110     /**
00111      * 標準モデルかどうか
00112      * @return 標準モデルならtrue
00113      */
00114     virtual bool isStandardModel() const{ return false; }
00115 
00116     /**
00117      * 標準モデルへのキャスト
00118      * @return 標準モデル。型が違えばNULLを返す。
00119      */
00120     virtual TranslationStandardModel* castStandardModel() const{
00121         if(isStandardModel()){
00122             return (TranslationStandardModel*)this;
00123         }
00124         return NULL;
00125     }
00126 
00127     //--------------------------------------------------------------------------
00128     /**
00129      * キャラクタモデルかどうか
00130      * @return キャラクタモデルならtrue
00131      */
00132     virtual bool isCharacterModel() const{ return false; }
00133 
00134     /**
00135      * キャラクタモデルへのキャスト
00136      * @return キャラクタモデル。型が違えばNULLを返す。
00137      */
00138     virtual TranslationCharacterModel* castCharacterModel() const{
00139         if(isCharacterModel()){
00140             return (TranslationCharacterModel*)this;
00141         }
00142         return NULL;
00143     }
00144 
00145     //--------------------------------------------------------------------------
00146 
00147 protected:
00148     /**
00149      * コンストラクタ
00150      * @param initializeObject 初期化するオブジェクト
00151      * @param initializeName 初期化する名前
00152      */
00153     TranslationModel(
00154         const MObject& initializeObject, const String& initializeName);
00155 
00156     /**
00157      * モデルの解析
00158      */
00159     virtual bool analyzeModel();
00160 
00161     /**
00162      * シェーダ名の取得
00163      * @param shadingEngine シェーディングエンジン
00164      * @return シェーダ名
00165      */
00166     virtual String getShaderName(const MObject& shadingEngine);
00167 
00168     /// メッシュ配列
00169     ArrayList<TranslationMesh*> meshes_;
00170     /// オブジェクト
00171     MObject object_;
00172     /// 名前
00173     String name_;
00174     /// 表示フラグ
00175     bool visibility_;
00176 
00177 private:
00178     // コピーコンストラクタの隠蔽
00179     TranslationModel(const TranslationModel& copy);
00180 
00181     // 代入コピーの隠蔽
00182     void operator =(const TranslationModel& copy);
00183 
00184 
00185 };
00186 
00187 //------------------------------------------------------------------------------
00188 } // End of namespace LampForMaya
00189 #endif // End of TRANSLATION_MODEL_H_
00190 //------------------------------------------------------------------------------
00191 

Generated on Wed Mar 16 10:29:56 2005 for LampForMaya by doxygen 1.3.2