TAPs 0.7.7.3
TAPsOpenGLHalfEdgeTrigonalModel.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsOpenGLHalfEdgeTrigonalModel.hpp
00003 
00004 Class OpenGLHalfEdgeTrigonalModel is for creating an OpenGL Trigonal Model 
00005 using half-edge data structure.
00006 
00007 See class HalfEdgeModel (in "../OpenGLModel/TAPsHalfEdgeTrigonalModel.hpp") and
00008 class OpenGLSupport ("../OpenGL/TAPsOpenGLSupport.hpp") for details.
00009 
00010 SUKITTI PUNAK   (06/15/2006)
00011 UPDATE          (06/15/2006)
00012 ******************************************************************************/
00013 #ifndef TAPs_OPENGL_HALF_EDGE_TRIGONAL_MODEL_HPP
00014 #define TAPs_OPENGL_HALF_EDGE_TRIGONAL_MODEL_HPP
00015 
00016 #include "TAPsHalfEdgeTrigonalModel.hpp"
00017 
00018 BEGIN_NAMESPACE_TAPs__OpenGL
00019 //=============================================================================
00020 template <typename T>
00021 class OpenGLHalfEdgeTrigonalModel : public /*virtual*/ HalfEdgeTrigonalModel<T> {
00022     //-------------------------------------------------------------------------
00023     // put it through ostream
00024     friend std::ostream & operator<< ( std::ostream &output, OpenGLHalfEdgeTrigonalModel<T> const &o )
00025     {
00026         output  << "\n==========================================\n"
00027                 <<   "TAPs::OpenGL::OpenGLHalfEdgeTrigonalModel<"
00028                 << typeid(T).name() << "> Class\n"
00029                 <<   "==========================================\n";
00030         //----------------------------------------------------------------
00031         /*
00032         // Material Node from OpenGLSupport
00033         output  << "\nMaterial Node" << "\n{\n" << o.material << "\n}";
00034         //----------------------------------------------------------------
00035         // Nodes from XPolygonalModel<T>
00036         output  << "\n\nVertices " << o.m_iNoVertices << "\n{";
00037         for ( int i = 0; i < o.m_iNoVertices; ++i ) {
00038             output << "\n  #" << i << "\t" << o.m_prXVertex[i];
00039         }
00040         output  << "\n}";
00041         //----------------------------------------------------------------
00042         // Neighbor vertex ring#1
00043         if ( o.m_pviVertexRing1List ) {
00044             std::vector<int>::const_iterator iterator;
00045             output  << "\n\nVertexRing1 " << o.m_iNoVertices << "\n{";
00046             for ( int i = 0; i < o.m_iNoVertices; ++i ) {
00047                 output << "\n  #" << i;
00048                 for (   iterator = o.m_pviVertexRing1List[i].begin(); 
00049                         iterator != o.m_pviVertexRing1List[i].end();
00050                         ++iterator )
00051                 {
00052                     output << "\t" << *iterator;
00053                 }
00054             }
00055             output  << "\n}";
00056         }
00057         //----------------------------------------------------------------
00058         // Faces Node
00059         output  << "\n\nFaces " << o.m_iNoFaces  << "\n{";
00060         for ( int i = 0; i < o.m_iNoFaces; ++i ) {
00061             output << "\n  #" << i << "\t" << o.m_prFace[i];
00062         }
00063         output  << "\n}";
00064         */
00065         return output;
00066     }
00067 //-----------------------------------------------------------------------------
00068 // Member Functions  -----------------------------------------------------------
00069 public:
00070     //-------------------------------------------------------------------------
00071     // default constructor
00072     OpenGLHalfEdgeTrigonalModel();
00073     //-------------------------------------------------------------------------
00074     // destructor
00075     virtual ~OpenGLHalfEdgeTrigonalModel();
00076     //-------------------------------------------------------------------------
00077     //void DisplayGL()
00078     //virtual void DisplayGL( OpenGL::Enum::DrawMode DM = OpenGL::Enum::POLYGON );
00079     virtual inline void ToggleDisplayVertexNormals ()
00080     { bIsDisplayVertexNormals = !bIsDisplayVertexNormals; }
00081     //-------------------------------------------------------------------------
00082     // Draw by OpenGL
00083     void DrawVertexNormals ();
00084     void DrawHalfEdgeByNextPtrs ();
00085     void DrawHalfEdgeByPrevPtrs ();
00086     void DrawHalfEdgePairs ( const HEHalfEdge<T> * pHalfEdge, Vector3<T> & color1, Vector3<T> & color2 );
00087 protected:
00088     //-------------------------------------------------------------------------
00089     // Helper Fn
00090     // void DrawGL()
00091     virtual void DrawGL( GLenum );
00092 //-----------------------------------------------------------------------------
00093 // Data Members  ---------------------------------------------------------------
00094 protected:
00095     bool bIsDisplayVertexNormals;
00096 }; // CLASS END: OpenGLHalfEdgeTrigonalModel ***********************************
00097 //=============================================================================
00098 END_NAMESPACE_TAPs__OpenGL
00099 //-----------------------------------------------------------------------------
00100 // Include definition if TAPs_USE_EXPORT is not defined
00101 //#if !defined( TAPs_USE_EXPORT )
00102     #include "TAPsOpenGLHalfEdgeTrigonalModel.cpp"
00103 //#endif
00104 //-----------------------------------------------------------------------------
00105 #endif
00106 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00107 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines