Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

void Impala::Visualization::Plot::ReadPlotFile ( const std::string &  filename,
const std::string &  filedir,
Plot *  plot 
)

Definition at line 18 of file PlotFile.h.

References info(), Impala::Core::Array::ReadRaw(), and Impala::Visualization::Plot::Plottable::SetData().

00019     {
00020         std::string name = filedir + filename;
00021         File info(name.c_str(), "r");
00022         if(!info.Valid())
00023         {
00024             std::cout << "[ReadPlotFile] couldn't open file " << name << std::endl;
00025             return;
00026         }
00027 
00028         Plottable* plottable = 0;
00029         while(!info.Eof())
00030         {
00031             std::string line = info.ReadLine();
00032             if(line[0] != '#')
00033             {
00034                 std::istringstream iss(line);
00035                 std::string cmd;
00036                 iss >> cmd;
00037                 if(cmd == "axis")
00038                 {
00039                     // read axis;
00040                 }
00041                 else if(cmd == "landscape")
00042                 {
00043                     plottable = new HeightMap;
00044                     plot->Add(plottable);
00045                 }
00046                 else if(cmd == "data:")
00047                 {
00048                     if(plottable)
00049                     {
00050                         std::string datafilename;
00051                         iss >> datafilename;
00052                         datafilename = filedir + datafilename;
00053                         Core::Array::Array2dScalarReal64* data=0;
00054                         std::cout << "reading data from \"" << datafilename << "\"\n";
00055                         ReadRaw(data, datafilename);
00056                         plottable->SetData(data);
00057                     }
00058                     else
00059                         std::cout << "[ReadPlotFile] syntax error, dataset before plottable is defined in \""
00060                                   << filename << "\"\n";
00061                 }
00062             }
00063         }
00064 
00065         info.Close();
00066     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:52:34 2010 for ImpalaSrc by  doxygen 1.5.1