TAPs 0.7.7.3
TAPsMultiMeshModelWithMBV.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsMultiMeshModelWithMBV.hpp
00003 
00004 A collection of mesh models with multi bounding volumes - 
00005 can be any mixing of Polygonal, XPolygonal, and Halfedge Models.
00006 It has a (std::vector) list of model pointers.
00007 
00008 SUKITTI PUNAK   (02/07/2007)
00009 UPDATE          (02/07/2007)
00010 ******************************************************************************/
00011 #ifndef TAPs_MULTI_MESH_MODEL_WITH_MBV_HPP
00012 #define TAPs_MULTI_MESH_MODEL_WITH_MBV_HPP
00013 
00014 // These are included in TAPsMeshModel.hpp.
00015 // Inheritance
00016 //#include "../Support/TAPsColDetSupport.hpp"           // Is A
00017 //#include "../Support/TAPsPhysicsSupport.hpp"          // Is A
00018 // Association
00019 //#include "../Support/TAPsTransformationSupport.hpp"   // Has A
00020 //#include "../OpenGLModelFromFile/TAPsReadModels.hpp"
00021 
00022 #include "../OpenGLModel/TAPsMultiMeshModel.hpp"
00023 #include "../CD/TAPsMultiBoundingVolume.hpp"    // for collision detection by bounding volumes
00024 
00025 BEGIN_NAMESPACE_TAPs__OpenGL
00026 //=============================================================================
00027 template <typename T>
00028 class MultiMeshModelWithMBV {
00029 //-----------------------------------------------------------------------------
00030 // Member Functions ------------------------------------------------------------
00031 public:
00032     //-------------------------------------------------------------------------
00033     // constructors
00034     MultiMeshModelWithMBV ();
00035     MultiMeshModelWithMBV ( char * name );
00036     //-------------------------------------------------------------------------
00037     // destructor
00038     virtual ~MultiMeshModelWithMBV ();
00039     //-------------------------------------------------------------------------
00040 //  // Get Half Length
00041 //  virtual T GetMaxHalfLength () const = 0;    // abstract fn
00042     //-------------------------------------------------------------------------
00043     // Get/Set Fn(s)
00044     inline int  GetID () const;
00045     inline void SetID ( int id );
00046     inline char const * const GetName () const;
00047     inline void SetName ( char * name );
00048     //-------------------------------------------------------------------------
00049     // Get/Set Transformation Fn(s)
00050     TransformationSupport<T> const &    GetTransform () const
00051         { return m_MultiMeshModel->GetTransform(); }
00052     TransformationSupport<T> &          GetTransform ()
00053         { return m_MultiMeshModel->GetTransform(); }
00054     //-------------------------------------------
00055     MultiMeshModel<T> const *   GetMultiMeshModel () const
00056         { return m_MultiMeshModel; }
00057     MultiMeshModel<T> *         GetMultiMeshModel () 
00058         { return m_MultiMeshModel; }
00059     MultiBoundingVolume<T> const *  GetMultiBoundingVolume () const
00060         { return m_MultiBoundingVolume; }
00061     MultiBoundingVolume<T> *        GetMultiBoundingVolume () 
00062         { return m_MultiBoundingVolume; }
00063     //-------------------------------------------------------------------------
00064     // Transformation Fn(s) -- Wrapping Fn(s) from Class Transformation
00065     //void  ApplyScale
00066     //-------------------------------------------------------------------------
00067     // Misc Fn(s)
00068     //virtual void Reset () {};
00069     virtual void Initialize ();
00070     virtual void ApplyAndResetTransform ()
00071         { m_MultiMeshModel->ApplyAndResetTransform(); }
00072     //-------------------------------------------------------------------------
00073     // Display By OpenGL
00074     virtual void DisplayGL ( OpenGL::Enum::DrawMode = OpenGL::Enum::POLYGON );
00075     //virtual void DisplayGLUsingColorMaterial ( OpenGL::Enum::DrawMode = OpenGL::Enum::POLYGON );
00076     virtual void DisplayGLUsingColorMaterial ( 
00077         OpenGL::Enum::DrawMode = OpenGL::Enum::POLYGON, 
00078         OpenGL::Enum::Face = OpenGL::Enum::FRONT );
00079     //-------------------------------------------------------------------------
00080     //virtual void BuildBVHTree ( TAPs::Enum::CD treeType ) {}; // Create BVHTree
00081 //-----------------------------------------------------------------------------
00082 // Data Members  ---------------------------------------------------------------
00083 protected:
00084     //-------------------------------------------------------------------------
00085     // Model Identification
00086     static int  m_iTotal;       // total number of models
00087     int         m_iId;          // identification number
00088     char *      m_pcName;       // model name
00089     //-------------------------------------------------------------------------
00090     // Model List
00091     MultiMeshModel<T> *         m_MultiMeshModel;
00092     MultiBoundingVolume<T> *    m_MultiBoundingVolume;
00093 //-----------------------------------------------------------------------------
00094 };
00095 //=============================================================================
00096 END_NAMESPACE_TAPs__OpenGL
00097 //-----------------------------------------------------------------------------
00098 // Include definition if TAPs_USE_EXPORT is not defined
00099 //#if !defined( TAPs_USE_EXPORT )
00100     #include "TAPsMultiMeshModelWithMBV.cpp"
00101 //#endif
00102 //-----------------------------------------------------------------------------
00103 #endif
00104 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00105 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines