TAPs 0.7.7.3
TAPsXTrigonalModel.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsXTrigonalModel.hpp
00003 
00004 (X <==> Extra)
00005 A Triangulated Model contains:
00006     char *      m_pcObjectName;     // object name
00007     int         m_iNoVertices;  // # of vertices
00008     int         m_iNoFaces;     // # of faces
00009     int         m_iNoTexCoords; // # of texture coordinates
00010     Vertex<T> * m_prXVertex;        // Vertex pointers
00011     Face<T> *   m_prFace;           // Face pointers
00012     std::vector<int> *  m_pviVertexRing1List;   // neighbor vertices in ring 1
00013 
00014 Each property should be set explicitly except the following:
00015   - m_pcObjectName (is for identification, not important)
00016   - m_iNoTexCoords (must be set if use with texture)
00017 The normal of each m_prXVertex and m_prFace can be calculated by provided fns.
00018 Each m_pviVertexRing1List can also be calculated by provided fns.
00019 
00020 SUKITTI PUNAK   (11/02/2004)
00021 UPDATE          (24/03/2004)
00022 ******************************************************************************/
00023 #ifndef TAPs_XTRIGONAL_MODEL_HPP
00024 #define TAPs_XTRIGONAL_MODEL_HPP
00025 
00026 #include "TAPsXPolygonalModel.hpp"
00027 
00028 BEGIN_NAMESPACE_TAPs__OpenGL
00029 //=============================================================================
00030 template <typename T>
00031 class XTrigonalModel : public /*virtual*/ XPolygonalModel<T> {
00032     //-------------------------------------------------------------------------
00033     // (Friend Fn) put it through ostream
00034     friend std::ostream & operator<< ( std::ostream &output, XTrigonalModel<T> const &o )
00035     {
00036         output  << "\n======================\n"
00037                 <<   "TAPs::XTrigonalModel<"
00038                 << typeid(T).name() << "> Class:\n"
00039                 <<   "======================\n";
00040         //----------------------------------------------------------------
00041         // Vertices Node
00042         output  << "\n\nVertices " << o.m_iNoVertices << "\n{";
00043         for ( int i = 0; i < o.m_iNoVertices; ++i ) {
00044             output << "\n  #" << i << "\t" << o.m_prXVertex[i];
00045         }
00046         output  << "\n}";
00047         //----------------------------------------------------------------
00048         // Neighbor vertex ring#1
00049         if ( o.m_pviVertexRing1List ) {
00050             std::vector<int>::const_iterator iterator;
00051             output  << "\n\nVertexRing1 " << o.m_iNoVertices << "\n{";
00052             for ( int i = 0; i < o.m_iNoVertices; ++i ) {
00053                 output << "\n  #" << i;
00054                 for (   iterator = o.m_pviVertexRing1List[i].begin(); 
00055                         iterator != o.m_pviVertexRing1List[i].end();
00056                         ++iterator )
00057                 {
00058                     output << "\t" << *iterator;
00059                 }
00060             }
00061             output  << "\n}";
00062         }
00063         //----------------------------------------------------------------
00064         // Faces Node
00065         output  << "\n\nFaces " << o.m_iNoFaces  << "\n{";
00066         for ( int i = 0; i < o.m_iNoFaces; ++i ) {
00067             output << "\n  #" << i << "\t" << o.m_prFace[i];
00068         }
00069         output  << "\n}";
00070         return output;
00071     }
00072 //-----------------------------------------------------------------------------
00073 // Member Functions ------------------------------------------------------------
00074 public:
00075     //-------------------------------------------------------------------------
00076     // default constructor
00077     XTrigonalModel ();
00078     //-------------------------------------------------------------------------
00079     // destructor
00080     virtual ~XTrigonalModel ();
00081 //-----------------------------------------------------------------------------
00082 }; // CLASS END: XTrigonalModel ************************************************
00083 //=============================================================================
00084 END_NAMESPACE_TAPs__OpenGL
00085 //-----------------------------------------------------------------------------
00086 // Include definition if TAPs_USE_EXPORT is not defined
00087 //#if !defined( TAPs_USE_EXPORT )
00088     #include "TAPsXTrigonalModel.cpp"
00089 //#endif
00090 //-----------------------------------------------------------------------------
00091 #endif
00092 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00093 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines