![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsTrigonalModel.hpp 00003 00004 A Triangulated Model contains: 00005 char * m_pcObjectName; // object name 00006 int m_iNoVertices; // # of vertices 00007 int m_iNoFaces; // # of faces 00008 int m_iNoTexCoords; // # of texture coordinates 00009 Vertex<T> * m_prXVertex; // Vertex pointers 00010 Face<T> * m_prFace; // Face pointers 00011 std::vector<int> * m_pviVertexRing1List; // neighbor vertices in ring 1 00012 00013 Each property should be set explicitly except the following: 00014 - m_pcObjectName (is for identification, not important) 00015 - m_iNoTexCoords (must be set if use with texture) 00016 The normal of each m_prXVertex and m_prFace can be calculated by provided fns. 00017 Each m_pviVertexRing1List can also be calculated by provided fns. 00018 00019 SUKITTI PUNAK (24/03/2005) 00020 UPDATE (24/03/2005) 00021 ******************************************************************************/ 00022 #ifndef TAPs_TRIGONAL_MODEL_HPP 00023 #define TAPs_TRIGONAL_MODEL_HPP 00024 00025 #include "TAPsPolygonalModel.hpp" 00026 00027 BEGIN_NAMESPACE_TAPs__OpenGL 00028 //============================================================================= 00029 template <typename T> 00030 class TrigonalModel : public /*virtual*/ PolygonalModel<T> { 00031 //------------------------------------------------------------------------- 00032 // (Friend Fn) put it through ostream 00033 friend std::ostream & operator<< ( std::ostream &output, TrigonalModel<T> const &o ) 00034 { 00035 output << "\n======================\n" 00036 << "TAPs::TrigonalModel<" 00037 << typeid(T).name() << "> Class:\n" 00038 << "======================\n"; 00039 //---------------------------------------------------------------- 00040 // Vertices Node 00041 output << "\n\nVertices " << o.m_iNoVertices << "\n{"; 00042 for ( int i = 0; i < o.m_iNoVertices; ++i ) { 00043 output << "\n #" << i << "\t" << o.m_prVertex[i]; 00044 } 00045 output << "\n}"; 00046 //---------------------------------------------------------------- 00047 // Faces Node 00048 output << "\n\nFaces " << o.m_iNoFaces << "\n{"; 00049 for ( int i = 0; i < o.m_iNoFaces; ++i ) { 00050 output << "\n #" << i << "\t" << o.m_prFace[i]; 00051 } 00052 output << "\n}"; 00053 return output; 00054 } 00055 //----------------------------------------------------------------------------- 00056 // Member Functions ------------------------------------------------------------ 00057 public: 00058 //------------------------------------------------------------------------- 00059 // default constructor 00060 TrigonalModel (); 00061 //------------------------------------------------------------------------- 00062 // destructor 00063 virtual ~TrigonalModel (); 00064 //----------------------------------------------------------------------------- 00065 }; // CLASS END: TrigonalModel ************************************************* 00066 //============================================================================= 00067 END_NAMESPACE_TAPs__OpenGL 00068 //----------------------------------------------------------------------------- 00069 // Include definition if TAPs_USE_EXPORT is not defined 00070 //#if !defined( TAPs_USE_EXPORT ) 00071 #include "TAPsTrigonalModel.cpp" 00072 //#endif 00073 //----------------------------------------------------------------------------- 00074 #endif 00075 //345678901234567890123456789012345678901234567890123456789012345678901234567890 00076 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8