Files Classes Functions Hierarchy
00001 #ifndef D4MESHPOINTREADER_H 00002 #define D4MESHPOINTREADER_H 00003 00004 #include <string> 00005 #include <iosfwd> 00006 #include <vector> 00007 using namespace std; 00008 00009 // 00010 // Brief: Read and construct the mesh from points in files. 00011 // 00012 // For timing experiments use constructor for reading the points in. 00013 // Time the eval() function call for the time taken to insert the 00014 // points into the mesh. 00015 class d4meshpointreader 00016 { 00017 d4tess & tess; 00018 public: 00019 00020 // Reads the points into the mesh. 00021 // Expecting a file with two or three columns of points. 00022 d4meshpointreader 00023 ( 00024 bool & res, 00025 d4tess & _tess, 00026 string const &filename 00027 ); 00028 00029 d4meshpointreader 00030 ( 00031 bool & res, 00032 d4tess & _tess, 00033 vector< pt4 > const & vbox, 00034 string const & filename 00035 ); 00036 00037 // Inserts the points into the tessellation. 00038 // The points are already in the d4tess point vector. 00039 void eval(); 00040 00041 // Inserts and times the point insertion. 00042 // Writes the number of points and time on one line. 00043 void eval(ostream & os); 00044 00045 private: 00046 00047 // Gets the number of columns by looking at first line of file. 00048 bool const isfilegood 00049 ( 00050 uint & columns, 00051 string const & filename 00052 ) const; 00053 00054 void readthreecolumns(ifstream & targ); 00055 void readfourcolumns(ifstream & targ); 00056 }; 00057 00058 00059 #endif 00060
1.5.8