TAPs 0.7.7.3
TAPsOpenGLModelLaparoscopicAdjustableGastricBand.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsOpenGLModelLaparoscopicAdjustableGastricBand.hpp
00003 
00004 Class OpenGLModelLaparoscopicAdjustableGastricBand is for creating an OpenGL 
00005 Laparoscopic Adjustable Gastric Band Model.
00006 
00007 See class ModelLaparoscopicAdjustableGastricBand 
00008 (in "../ModelSpecific/TAPsModelLaparoscopicAdjustableGastricBand.hpp") and
00009 class OpenGLSupport ("../OpenGL/TAPsOpenGLSupport.hpp") for detail.
00010 
00011 SUKITTI PUNAK   (07/02/2008)
00012 ******************************************************************************/
00013 #ifndef TAPs_OPENGL_MODEL_LAPAROSCOPIC_ADJUSTTABLE_GASTRIC_BAND_HPP
00014 #define TAPs_OPENGL_MODEL_LAPAROSCOPIC_ADJUSTTABLE_GASTRIC_BAND_HPP
00015 
00016 #include "TAPsModelLaparoscopicAdjustableGastricBand.hpp"
00017 #include "../OpenGL/TAPsOpenGLUsefulObjs.hpp"
00018 
00019 BEGIN_NAMESPACE_TAPs__OpenGL
00020 //=============================================================================
00021 template <typename T>
00022 class OpenGLModelLaparoscopicAdjustableGastricBand : public /*virtual*/ ModelLaparoscopicAdjustableGastricBand<T> {
00023     //-------------------------------------------------------------------------
00024     // put it through ostream
00025     friend std::ostream & operator<< ( std::ostream &output, 
00026         OpenGLModelLaparoscopicAdjustableGastricBand<T> const &o )
00027     {
00028         output  << "\n======================\n"
00029                 <<   "TAPs::OpenGL::OpenGLModelLaparoscopicAdjustableGastricBand<"
00030                 << typeid(T).name() << "> Class\n"
00031                 <<   "======================\n";
00032         //-----------------------------------------------------------
00033         output  << "\n# of Links " << o.m_iNoLinks
00034                 << "\nEach link has length " << o.m_tLinkLength 
00035                 << " and weight " << o.m_tPointWeight << "\n";
00036         return output;
00037     }
00038 //-----------------------------------------------------------------------------
00039 // Member Functions  ----------------------------------------------------------
00040 public:
00041     //-------------------------------------------------------------------------
00042     // Constructor(s)
00043     OpenGLModelLaparoscopicAdjustableGastricBand ();
00044     OpenGLModelLaparoscopicAdjustableGastricBand (  int iNoLinks, T tLength, T tWeight, 
00045                         Vector3<T> & posOfVertex0 = Vector3<T>(),
00046                         T radius = 0.05, int numSlices = 12, int numStacks = 3 );
00047     OpenGLModelLaparoscopicAdjustableGastricBand (  int iNoLinks, T tLength, T tWeight, 
00048                         Vector3<T> & posOfVertex0, 
00049                         T radius, 
00050                         const char * head,  // Type of Head (read from file)
00051                         int numSlices = 12, int numStacks = 3 );
00052     OpenGLModelLaparoscopicAdjustableGastricBand (  int iNoLinks, T tLength, T tWeight, 
00053                         Vector3<T> & posOfVertex0, 
00054                         T radius, 
00055                         T tKRatioOfStretchingAllowed,
00056                         T tKRatioOfCompressionAllowed,
00057                         T tKStratching,
00058                         T tKBending,
00059                         T tKTwisting,
00060                         T tKFriction,
00061                         T tKContact,
00062                         T tKGravity,
00063                         const char * head,  // Type of Head (read from file)
00064                         int numSlices = 12, int numStacks = 3 );
00065     //-------------------------------------------------------------------------
00066     // Destructor
00067     virtual ~OpenGLModelLaparoscopicAdjustableGastricBand ();
00068     //-------------------------------------------------------------------------
00069     // Abstract Virtual Fn(s) from OpenGLSupport
00070     // void DisplayGL()
00071     virtual void DisplayGL( OpenGL::Enum::DrawMode DM = OpenGL::Enum::LINES );
00072     //-------------------------------------------------------------------------
00073     void DisplayGLWithBVHTrees( OpenGL::Enum::DrawMode DM );
00074     //-------------------------------------------------------------------------
00075     // Abstract Virtual Fn(s) from Model<T>
00076     virtual T GetMaxHalfLength () const { return m_iNoLinks * m_tLinkLength; }
00077     virtual void Initialize () {};
00078     //-------------------------------------------------------------------------
00079     // Abstract Virtual Fn(s) from ColDetSupport<T>
00080     // Collision Detection Fn(s)
00081     virtual void CalBoundingAABB ()         {};
00082     virtual void CalBoundingEllipsoid ()    {};
00083     virtual void CalBoundingSphere ()       {};
00084     //-------------------------------------------------------------------------
00085 //-----------------------------------------------------------------------------
00086 protected:
00087     //-------------------------------------------------------------------------
00088     // Helper Fn
00089     // void DrawGL()
00090     void DrawHead ( OpenGL::Enum::DrawMode );
00091     void DrawHeadWithBVHTrees ( OpenGL::Enum::DrawMode );
00092     virtual void DrawGL ( GLenum );
00093     void SetUpOpenGLDisplayList ();
00094     //---------------------------------------------------------------
00095     // Data Members
00096     GLuint          m_uiDisplayList;    // For drawing Glut Cylinder & Sphere
00097     int             m_iNumSlices;       // around the cylinder radius
00098     int             m_iNumStacks;       // along the cylinder body
00099 //-----------------------------------------------------------------------------
00100 };
00101 //=============================================================================
00102 END_NAMESPACE_TAPs__OpenGL
00103 //-----------------------------------------------------------------------------
00104 // Include definition if TAPs_USE_EXPORT is not defined
00105 #include "TAPsOpenGLModelLaparoscopicAdjustableGastricBand.cpp"
00106 //-----------------------------------------------------------------------------
00107 #endif
00108 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00109 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines