![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsOpenGLTrigonalModel.hpp 00003 00004 Class OpenGLTrigonalModel is for creating an OpenGL Triangulated Model. 00005 00006 See class TrigonalModel (in "../Model/TAPsTrigonalModel.hpp") and 00007 class OpenGLSupport ("../OpenGL/TAPsOpenGLSupport.hpp") for detail. 00008 00009 SUKITTI PUNAK (24/03/2005) 00010 UPDATE (24/03/2005) 00011 ******************************************************************************/ 00012 #ifndef TAPs_OPENGL_TRIGONAL_MODEL_HPP 00013 #define TAPs_OPENGL_TRIGONAL_MODEL_HPP 00014 00015 #include "TAPsTrigonalModel.hpp" 00016 00017 BEGIN_NAMESPACE_TAPs__OpenGL 00018 //============================================================================= 00019 template <typename T> 00020 class OpenGLTrigonalModel : public /*virtual*/ TrigonalModel<T> { 00021 //------------------------------------------------------------------------- 00022 // put it through ostream 00023 friend std::ostream & operator<< ( std::ostream &output, OpenGLTrigonalModel<T> const &o ) 00024 { 00025 output << "\n======================\n" 00026 << "TAPs::OpenGL::OpenGLTrigonalModel<" 00027 << typeid(T).name() << "> Class\n" 00028 << "======================\n"; 00029 //---------------------------------------------------------------- 00030 // Material Node from OpenGLSupport 00031 output << "\nMaterial Node" << "\n{\n" << o.material << "\n}"; 00032 //---------------------------------------------------------------- 00033 // Nodes from XPolygonalModel<T> 00034 output << "\n\nVertices " << o.m_iNoVertices << "\n{"; 00035 for ( int i = 0; i < o.m_iNoVertices; ++i ) { 00036 output << "\n #" << i << "\t" << o.m_prVertex[i]; 00037 } 00038 output << "\n}"; 00039 //---------------------------------------------------------------- 00040 // Faces Node 00041 output << "\n\nFaces " << o.m_iNoFaces << "\n{"; 00042 for ( int i = 0; i < o.m_iNoFaces; ++i ) { 00043 output << "\n #" << i << "\t" << o.m_prFace[i]; 00044 } 00045 output << "\n}"; 00046 return output; 00047 } 00048 //----------------------------------------------------------------------------- 00049 // Member Functions ----------------------------------------------------------- 00050 public: 00051 //------------------------------------------------------------------------- 00052 // default constructor 00053 OpenGLTrigonalModel(); 00054 //------------------------------------------------------------------------- 00055 // destructor 00056 virtual ~OpenGLTrigonalModel(); 00057 //------------------------------------------------------------------------- 00058 //void DisplayGL() 00059 //virtual void DisplayGL( OpenGL::Enum::DrawMode DM = OpenGL::Enum::POLYGON ); 00060 protected: 00061 //------------------------------------------------------------------------- 00062 // Helper Fn 00063 // void DrawGL() 00064 virtual void DrawGL( GLenum ); 00065 //----------------------------------------------------------------------------- 00066 }; 00067 //============================================================================= 00068 END_NAMESPACE_TAPs__OpenGL 00069 //----------------------------------------------------------------------------- 00070 // Include definition if TAPs_USE_EXPORT is not defined 00071 //#if !defined( TAPs_USE_EXPORT ) 00072 #include "TAPsOpenGLTrigonalModel.cpp" 00073 //#endif 00074 //----------------------------------------------------------------------------- 00075 #endif 00076 //345678901234567890123456789012345678901234567890123456789012345678901234567890 00077 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8