TAPs 0.7.7.3
TAPsReadTAPs.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsReadTAPs.hpp
00003 
00004 Create an OpenGL Polygonal Model Object from a .TAPs file
00005 
00006 SUKITTI PUNAK   (11/11/2004)
00007 UPDATE          (11/21/2004)
00008 ******************************************************************************/
00009 #ifndef TAPs_READ_TAPs_HPP
00010 #define TAPs_READ_TAPs_HPP
00011 
00012 // The necessary headers are included in TAPsReadModel.hpp which directly uses
00013 // this header.
00014 /*
00015 #include "../OpenGLModel/TAPsPolygonalModel.hpp"
00016 #include "../OpenGLModel/TAPsXPolygonalModel.hpp"
00017 #include <iomanip>
00018 #include <cmath>
00019 #include <fstream>
00020 #include <cstring>  // for string token strtok
00021 #include <cstdlib>  // for converting string to numeric (strtod, strtol, strtoul)
00022 */
00023 
00024 BEGIN_NAMESPACE_TAPs
00025 //=============================================================================
00026 template <typename T> class ReadModels;
00027 //=============================================================================
00028 template <typename T>
00029 class ReadTAPs {
00030     friend class ReadModels<T>;
00031 // Member Functions  -----------------------------------------------------------
00032 public:
00033     //-------------------------------------------------------------------------
00034     // Read an input file
00035     //  I/P: fileName
00036     //  O/P: *prModel
00037     // Two fns per each operation due to the design of Model types;
00038     //   One for PolygonalModel and its derived classes
00039     //   The other for XPolygonalModel and its derived classes
00040     //
00041     //   Each pairs are exactly identical (both declaration and definition) 
00042     //   except the passed prModel pointer.
00043     static bool readFile( const char *fileName, OpenGL::PolygonalModel<T> * const prModel );
00044     static bool readFile( const char *fileName, OpenGL::XPolygonalModel<T> * const prModel );
00045 private:
00046     //-------------------------------------------------------------------------
00047     // Process Format Node
00048     static void ProcessNodeFormat( char *line, OpenGL::PolygonalModel<T> * const prModel );
00049     static void ProcessNodeFormat( char *line, OpenGL::XPolygonalModel<T> * const prModel );
00050     //-------------------------------------------------------------------------
00051     // Process Material Node
00052     static void ProcessNodeMaterial( char *line, OpenGL::PolygonalModel<T> * const prModel );
00053     static void ProcessNodeMaterial( char *line, OpenGL::XPolygonalModel<T> * const prModel );
00054     //-------------------------------------------------------------------------
00055     // Process Vertices Node
00056     static void ProcessNodeVertices( char *line, OpenGL::PolygonalModel<T> * const prModel );
00057     static void ProcessNodeVertices( char *line, OpenGL::XPolygonalModel<T> * const prModel );
00058     //-------------------------------------------------------------------------
00059     // Process Faces Node
00060     static void ProcessNodeFaces( char *line, OpenGL::PolygonalModel<T> * const prModel );
00061     static void ProcessNodeFaces( char *line, OpenGL::XPolygonalModel<T> * const prModel );
00062     //-------------------------------------------------------------------------
00063     // Process TextureCoordinates Node
00064     static void ProcessNodeTextureCoordinates( char *line, OpenGL::PolygonalModel<T> * const prModel );
00065     static void ProcessNodeTextureCoordinates( char *line, OpenGL::XPolygonalModel<T> * const prModel );
00066     //-------------------------------------------------------------------------
00067     // Process ImageTexture Node
00068     //static void ProcessNodeImageTexture( char *line, OpenGL::PolygonalModel<T> * const prModel );
00069     static void ProcessNodeImageTexture( char *line, OpenGL::XPolygonalModel<T> * const prModel );
00070 // Data Members ----------------------------------------------------------------
00071 private:
00072     static FILE *fileIn;
00073 };
00074 //=============================================================================
00075 END_NAMESPACE_TAPs
00076 //-----------------------------------------------------------------------------
00077 // Include definition if TAPs_USE_EXPORT is not defined
00078 //#if !defined( TAPs_USE_EXPORT )
00079     #include "TAPsReadTAPs.cpp"
00080 //#endif
00081 //-----------------------------------------------------------------------------
00082 #endif
00083 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00084 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines