Files Classes Functions Hierarchy
00001 #ifndef D3MESHPOINTREADER_H 00002 #define D3MESHPOINTREADER_H 00003 00004 #include <cassert> 00005 #include <string> 00006 #include <iosfwd> 00007 #include <vector> 00008 using namespace std; 00009 00010 // 00011 // Brief: Read and construct the mesh from points in files. 00012 // 00013 // For timing experiments use constructor for reading the points in. Time the eval() 00014 // function call for the time taken to insert the points into the mesh. 00015 class d3meshpointreader 00016 { 00017 d3tess & tess; 00018 public: 00019 00020 // Reads the points into the mesh. 00021 // Expecting a file with two or three columns of points. 00022 d3meshpointreader 00023 ( 00024 bool & res, 00025 d3tess & tess_, 00026 string const &filename 00027 ); 00028 00029 d3meshpointreader 00030 ( 00031 bool & res, 00032 d3tess & tess_, 00033 vector< pt3 > const & vbox, 00034 string const & filename 00035 ); 00036 00037 // Inserts the points into the tessellation. 00038 // The points are already in the d3tess 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 readtwocolumns(ifstream & targ); 00055 void readthreecolumns(ifstream & targ); 00056 00057 00058 00059 00060 }; 00061 00062 00063 #endif 00064 00065
1.5.8