Changeset 18


Ignore:
Timestamp:
03/23/09 16:04:37 (16 years ago)
Author:
qweitzel
Message:
change in pixelmap: file now defined via construtor
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • pixelmap/PixelMap.cc

    r16 r18  
    66#include <cctype>
    77
    8 PixelMap::PixelMap(bool verbose) {
     8PixelMap::PixelMap(std::string file, bool verbose) {
    99
    1010    pixelmap.clear();
    11     ReadPixelMap(pixelmap, verbose);
     11    ReadPixelMap(pixelmap, file, verbose);
    1212
    1313}
     
    2121}
    2222
    23 void PixelMap::ReadPixelMap(std::map<std::string, Pixel*>& pixelmap, bool verbose) {
    24 
    25     std::string filename("PixelMap.txt");
    26     std::ifstream infile(filename.c_str(), std::fstream::in);
     23void 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);
    2727
    2828    if (verbose) {
    29         std::cout<<"Reading mapping file: "<<filename<<std::endl<<std::endl;   
     29        std::cout<<"Reading mapping file: "<<file<<std::endl<<std::endl;   
    3030        if (!infile.good()) {
    31             std::cerr<<"ERROR in PixelMap::ReadPixelMap: File "<<filename<<" cannot be found."<<std::endl;
     31            std::cerr<<"ERROR in PixelMap::ReadPixelMap: File "<<file<<" cannot be found."<<std::endl;
    3232        }
    3333    }
  • pixelmap/PixelMap.h

    r16 r18  
    1313public:
    1414   
    15     PixelMap(bool verbose=false);
     15    PixelMap(std::string file, bool verbose=false);
    1616    ~PixelMap();
    1717   
    1818    std::map<std::string, Pixel*> pixelmap;
    1919
    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);
    2121    void Print();
    2222
  • tools/pixelmap_test/PixelMapTest.cc

    r16 r18  
    1212    std::cout << std::endl;
    1313
    14     PixelMap* pm = new PixelMap(true);
     14    PixelMap* pm = new PixelMap("Test_PixelMap.txt", true);
    1515
    1616    pm->Print();
Note: See TracChangeset for help on using the changeset viewer.