Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Plot::Style Class Reference

#include <Plot.h>

List of all members.

Public Member Functions

 Style ()
 ~Style ()
bool Read (std::string path)
bool Set (std::string name, std::string value)
void Print (std::ostream &o=std::cout) const

Public Attributes

int lwidth
int lstyle
int lcolor
int mstyle
int msize
int mcolor
int stat
int rebin
double xmin
double xmax
double statx
double staty
double statw
double stath
std::string option
std::string xtitle
std::string ytitle


Constructor & Destructor Documentation

Plot::Style::Style  ) 
 

Definition at line 249 of file Plot.cxx.

References option.

00250    :lwidth(2),
00251     lstyle(1),
00252     lcolor(1),
00253     mstyle(-1),
00254     msize(0),
00255     mcolor(0),
00256     stat(1),
00257     rebin(0),
00258     xmin(+1.0),
00259     xmax(-1.0),
00260     statx(0.75),
00261     staty(0.5),
00262     statw(0.25),
00263     stath(0.23),
00264     option(),
00265     xtitle(),
00266     ytitle()
00267 {
00268 }

Plot::Style::~Style  ) 
 

Definition at line 271 of file Plot.cxx.

00272 {
00273 }


Member Function Documentation

void Plot::Style::Print std::ostream &  o = std::cout  )  const
 

Definition at line 276 of file Plot.cxx.

References lcolor, lstyle, lwidth, mcolor, msize, mstyle, option, rebin, stat, stath, statw, statx, staty, xmax, xmin, xtitle, and ytitle.

00277 {
00278    o << "lwidth = " << lwidth << endl;
00279    o << "lstyle = " << lstyle << endl;
00280    o << "lcolor = " << lcolor << endl;
00281    o << "mstyle = " << mstyle << endl;
00282    o << "msize = " << msize  << endl;
00283    o << "mcolor = " << mcolor << endl;
00284    o << "stat = " << stat   << endl;
00285    o << "rebin = " << rebin  << endl;
00286    o << "xmin = " << xmin << endl;
00287    o << "xmax = " << xmax << endl;
00288    o << "statx = " << statx << endl;
00289    o << "staty = " << staty << endl;
00290    o << "statw = " <<  statw << endl;
00291    o << "stath = " << stath << endl;
00292    o << "option = " << option << endl;
00293    o << "xtitle = " << xtitle << endl;
00294    o << "ytitle = " << ytitle << endl;
00295 }

bool Plot::Style::Read std::string  path  ) 
 

Definition at line 298 of file Plot.cxx.

References infile, and Set().

00299 {
00300    std::ifstream infile(path.c_str());
00301    if(!infile || !infile.is_open())
00302    {
00303       cerr << "Style::Read - failed to open file " << path << endl;
00304       return false;
00305    }
00306 
00307    
00308    while(!infile.eof())
00309    {
00310       std::string line;
00311       std::getline(infile, line);
00312 
00313       const string::size_type epos = line.find("=");
00314       
00315       if(line.empty() || line.find("#") != string::npos || epos == string::npos)
00316       {
00317          continue;
00318       }
00319 
00320       Set(line.substr(0, epos), line.substr(epos + 1));
00321    }
00322 
00323    return true;
00324 }

bool Plot::Style::Set std::string  name,
std::string  value
 

Definition at line 327 of file Plot.cxx.

References lcolor, lstyle, lwidth, mcolor, msize, mstyle, option, rebin, stat, stath, statw, statx, staty, xmax, xmin, xtitle, and ytitle.

Referenced by Read().

00328 {
00329    //cout << "(name, value) = (" << name << ", " << value << ")" << endl;
00330 
00331    if(name.find("lwidth") != string::npos) lwidth = atoi(value.c_str());
00332    if(name.find("lstyle") != string::npos) lstyle = atoi(value.c_str());
00333    if(name.find("lcolor") != string::npos) lcolor = atoi(value.c_str());
00334    if(name.find("mstyle") != string::npos) mstyle = atoi(value.c_str());
00335    if(name.find("msize" ) != string::npos) msize  = atoi(value.c_str());
00336    if(name.find("mcolor") != string::npos) mcolor = atoi(value.c_str());
00337    if(name.find("stat"  ) != string::npos) stat   = atoi(value.c_str());
00338    if(name.find("rebin" ) != string::npos) rebin  = atoi(value.c_str());
00339    if(name.find("xmin"  ) != string::npos) xmin   = atof(value.c_str());
00340    if(name.find("xmax"  ) != string::npos) xmax   = atof(value.c_str());
00341    if(name.find("statx" ) != string::npos) statx  = atof(value.c_str());
00342    if(name.find("staty" ) != string::npos) staty  = atof(value.c_str());
00343    if(name.find("statw" ) != string::npos) statw  = atof(value.c_str());
00344    if(name.find("stath" ) != string::npos) stath  = atof(value.c_str());
00345    if(name.find("option") != string::npos) option = value;
00346    if(name.find("xtitle") != string::npos) xtitle = value;
00347    if(name.find("ytitle") != string::npos) ytitle = value;
00348 
00349    return true;
00350 }


Member Data Documentation

int Plot::Style::lcolor
 

Definition at line 39 of file Plot.h.

Referenced by Print(), and Set().

int Plot::Style::lstyle
 

Definition at line 38 of file Plot.h.

Referenced by Print(), and Set().

int Plot::Style::lwidth
 

Definition at line 37 of file Plot.h.

Referenced by Print(), and Set().

int Plot::Style::mcolor
 

Definition at line 43 of file Plot.h.

Referenced by Print(), and Set().

int Plot::Style::msize
 

Definition at line 42 of file Plot.h.

Referenced by Print(), and Set().

int Plot::Style::mstyle
 

Definition at line 41 of file Plot.h.

Referenced by Print(), and Set().

std::string Plot::Style::option
 

Definition at line 56 of file Plot.h.

Referenced by Print(), and Set().

int Plot::Style::rebin
 

Definition at line 46 of file Plot.h.

Referenced by Print(), and Set().

int Plot::Style::stat
 

Definition at line 45 of file Plot.h.

Referenced by Print(), and Set().

double Plot::Style::stath
 

Definition at line 54 of file Plot.h.

Referenced by Print(), and Set().

double Plot::Style::statw
 

Definition at line 53 of file Plot.h.

Referenced by Print(), and Set().

double Plot::Style::statx
 

Definition at line 51 of file Plot.h.

Referenced by Print(), and Set().

double Plot::Style::staty
 

Definition at line 52 of file Plot.h.

Referenced by Print(), and Set().

double Plot::Style::xmax
 

Definition at line 49 of file Plot.h.

Referenced by Print(), and Set().

double Plot::Style::xmin
 

Definition at line 48 of file Plot.h.

Referenced by Print(), and Set().

std::string Plot::Style::xtitle
 

Definition at line 57 of file Plot.h.

Referenced by Print(), and Set().

std::string Plot::Style::ytitle
 

Definition at line 58 of file Plot.h.

Referenced by Print(), and Set().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:40 2010 for loon by  doxygen 1.3.9.1