![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsReadTAPsMBV.hpp 00003 ******************************************************************************/ 00011 /****************************************************************************** 00012 SUKITTI PUNAK (08/23/2006) 00013 UPDATE (09/03/2010) 00014 ******************************************************************************/ 00015 #ifndef TAPs_READ_TAPs_MBV_HPP 00016 #define TAPs_READ_TAPs_MBV_HPP 00017 00018 //----------------------------------------------------------------------------- 00019 // File Manipulations 00020 #include <iomanip> 00021 #include <cmath> 00022 #include <fstream> 00023 #include <cstring> // for string token strtok 00024 #include <cstdlib> // for converting string to numeric (strtod, strtol, strtoul) 00025 //----------------------------------------------------------------------------- 00026 #include "../CD/TAPsMultiBoundingVolume.hpp" 00027 //----------------------------------------------------------------------------- 00028 00029 BEGIN_NAMESPACE_TAPs 00030 //============================================================================= 00031 template <typename T> 00032 class ReadTAPsMBV { 00033 // Member Functions ---------------------------------------------------------- 00034 public: 00035 //------------------------------------------------------------------------- 00036 // Read an input file 00037 // I/P: fileName with .MBV extension 00038 // O/P: *prMBV with a set of created BoundingVolume<T> objects 00039 // prMBV must already exists before this function call 00040 //------------------------------------------------------------------------- 00041 static bool ReadFile ( 00042 const char * fileName, MultiBoundingVolume<T> * const prMBV ); 00043 //------------------------------------------------------------------------- 00044 private: 00045 //------------------------------------------------------------------------- 00046 // Process Each Node 00047 //------------------------------------------------------------------------- 00067 static void ProcessNodeBOUNDING_VOLUME( 00068 char * line, MultiBoundingVolume<T> * const prMBV ); 00069 //------------------------------------------------------------------------- 00070 // Data Members --------------------------------------------------------------- 00071 private: 00072 static int iCounter; // counter 00073 static int iNumBoundingVolume; // number of bounding volumes 00074 static FILE * fileIn; // file handle 00075 //------------------------------------------------------------------------- 00076 }; 00077 //============================================================================= 00078 END_NAMESPACE_TAPs 00079 //----------------------------------------------------------------------------- 00080 // Include definition if TAPs_USE_EXPORT is not defined 00081 //#if !defined( TAPs_USE_EXPORT ) 00082 #include "TAPsReadTAPsMBV.cpp" 00083 //#endif 00084 //----------------------------------------------------------------------------- 00085 #endif 00086 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00087 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----