Changeset 18
- Timestamp:
- 03/23/09 16:04:37 (16 years ago)
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
pixelmap/PixelMap.cc
r16 r18 6 6 #include <cctype> 7 7 8 PixelMap::PixelMap( bool verbose) {8 PixelMap::PixelMap(std::string file, bool verbose) { 9 9 10 10 pixelmap.clear(); 11 ReadPixelMap(pixelmap, verbose);11 ReadPixelMap(pixelmap, file, verbose); 12 12 13 13 } … … 21 21 } 22 22 23 void PixelMap::ReadPixelMap(std::map<std::string, Pixel*>& pixelmap, bool verbose) {24 25 std::string filename("PixelMap.txt");26 std::ifstream infile(file name.c_str(), std::fstream::in);23 void PixelMap::ReadPixelMap(std::map<std::string, Pixel*>& pixelmap, std::string file, bool verbose) { 24 25 //std::string filename("PixelMap.txt"); 26 std::ifstream infile(file.c_str(), std::fstream::in); 27 27 28 28 if (verbose) { 29 std::cout<<"Reading mapping file: "<<file name<<std::endl<<std::endl;29 std::cout<<"Reading mapping file: "<<file<<std::endl<<std::endl; 30 30 if (!infile.good()) { 31 std::cerr<<"ERROR in PixelMap::ReadPixelMap: File "<<file name<<" cannot be found."<<std::endl;31 std::cerr<<"ERROR in PixelMap::ReadPixelMap: File "<<file<<" cannot be found."<<std::endl; 32 32 } 33 33 } -
pixelmap/PixelMap.h
r16 r18 13 13 public: 14 14 15 PixelMap( bool verbose=false);15 PixelMap(std::string file, bool verbose=false); 16 16 ~PixelMap(); 17 17 18 18 std::map<std::string, Pixel*> pixelmap; 19 19 20 void ReadPixelMap(std::map<std::string, Pixel*>& pixelmap, bool verbose=false);20 void ReadPixelMap(std::map<std::string, Pixel*>& pixelmap, std::string file, bool verbose=false); 21 21 void Print(); 22 22 -
tools/pixelmap_test/PixelMapTest.cc
r16 r18 12 12 std::cout << std::endl; 13 13 14 PixelMap* pm = new PixelMap( true);14 PixelMap* pm = new PixelMap("Test_PixelMap.txt", true); 15 15 16 16 pm->Print();
Note:
See TracChangeset
for help on using the changeset viewer.