TAPs 0.7.7.3
TAPsModel.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsModel.hpp
00003 
00004 A Base (Abstract) Model
00005 
00006 SUKITTI PUNAK   (11/02/2004)
00007 UPDATE          (03/15/2006)
00008 ******************************************************************************/
00009 #ifndef TAPs_MODEL_HPP
00010 #define TAPs_MODEL_HPP
00011 
00012 // Inheritance
00013 #include "../Support/TAPsColDetSupport.hpp"             // Is A
00014 #include "../Support/TAPsPhysicsSupport.hpp"            // Is A
00015 // Association
00016 #include "../Support/TAPsTransformationSupport.hpp"     // Has A
00017 
00018 BEGIN_NAMESPACE_TAPs__OpenGL
00019 //=============================================================================
00020 template <typename T>
00021 class Model : public /*virtual*/ ColDetSupport<T>, 
00022               public /*virtual*/ PhysicsSupport<T> {
00023 //-----------------------------------------------------------------------------
00024 // Member Functions ------------------------------------------------------------
00025 public:
00026     //-------------------------------------------------------------------------
00028     friend std::ostream & operator<< ( std::ostream &output, Model<T> const &obj )
00029     {
00030         output << obj.StrInfo();
00031         return output;
00032     }
00033     //-------------------------------------------------------------------------
00035     virtual std::string StrInfo () const;
00036     //-------------------------------------------------------------------------
00037     // constructors
00038     Model ();
00039     Model ( char * name );
00040     //-------------------------------------------------------------------------
00041     // destructor
00042     virtual ~Model ();
00043     //-------------------------------------------------------------------------
00046     virtual void CalAndSetPhysicsCenterOfMass ()
00047     {
00048         std::cout << "Model::CalAndSetPhysicsCenterOfMass() need to be coded!!!\n";
00049         SetPhyPropCenterOfMass( 0, 0, 0 );
00050     }
00051     //-------------------------------------------------------------------------
00052     // Get Half Length
00053     virtual T GetMaxHalfLength () const = 0;    // abstract fn
00054     //-------------------------------------------------------------------------
00055     // Get/Set Fn(s)
00056     inline int  GetID () const;
00057     inline void SetID ( int id );
00058     inline char const * const GetName () const;
00059     inline void SetName ( char *name );
00060     //-------------------------------------------------------------------------
00061     // Misc Fn(s)
00062     virtual void Reset () {};
00063     virtual void Initialize () = 0;
00064     //-------------------------------------------------------------------------
00066     inline TransformationSupport<T> const & GetTransform () const   { return m_Transform; }
00068     inline TransformationSupport<T> &       GetTransform ()         { return m_Transform; }
00070     inline TransformationSupport<T> const & RefToTransformationSupport () const { return m_Transform; }
00072     inline TransformationSupport<T> &       RefToTransformationSupport ()       { return m_Transform; }
00074     inline void SetTransform ( TransformationSupport<T> const & trx )   { m_Transform = trx; }
00075     //-------------------------------------------------------------------------
00081     virtual void ApplyAndResetTransform () {}
00082 //-----------------------------------------------------------------------------
00083 // Data Members  ---------------------------------------------------------------
00084 protected:
00085     //-------------------------------------------------------------------------
00086     // Model Identification
00087     static int  m_iTotal;       // total number of models
00088     int         m_iId;          // identification number
00089     char *      m_pcName;       // model name
00090 //-----------------------------------------------------------------------------
00091     TransformationSupport<T>    m_Transform;    
00092 //-----------------------------------------------------------------------------
00093 };
00094 //=============================================================================
00095 END_NAMESPACE_TAPs__OpenGL
00096 //-----------------------------------------------------------------------------
00097 // Include definition if TAPs_USE_EXPORT is not defined
00098 //#if !defined( TAPs_USE_EXPORT )
00099     #include "TAPsModel.cpp"
00100 //#endif
00101 //-----------------------------------------------------------------------------
00102 #endif
00103 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00104 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines