Beispiel #1
0
 void NRichFrame::DrawFore(NRender* render, const Base::NRect& rect) const
 {
     if(foreDraw_ == NULL)
         return;
     int horzIndex, vertIndex;
     GetDrawIndex(horzIndex, vertIndex);
     foreDraw_->Draw(render, horzIndex, vertIndex, rect);
 }
Beispiel #2
0
vector <TString> OnlineConfig::GetDrawCommand(UInt_t page, UInt_t nCommand)
{
  // Returns the vector of strings pertaining to a specific page, and 
  //   draw command from the config.
  // Return vector of TStrings:
  //  0: variable
  //  1: cut
  //  2: type
  //  3: title
  //  4: treename

  vector <TString> out_command(5);
  vector <UInt_t> command_vector = GetDrawIndex(page);
  UInt_t index = command_vector[nCommand];

#ifdef DEBUG
  cout << "OnlineConfig::GetDrawCommand(" << page << "," 
       << nCommand << ")" << endl;
#endif
  for(UInt_t i=0; i<out_command.size(); i++) {
    out_command[i] = "";
  }


  // First line is the variable
  if(sConfFile[index].size()>=1) {
    out_command[0] = sConfFile[index][0];
  }
  if(sConfFile[index].size()>=2) {
    if((sConfFile[index][1] != "-type") &&
       (sConfFile[index][1] != "-title") &&
       (sConfFile[index][1] != "-tree"))
      out_command[1] = sConfFile[index][1];
  }

  // Now go through the rest of that line..
  for (UInt_t i=1; i<sConfFile[index].size(); i++) {
    if(sConfFile[index][i]=="-type") {
      out_command[2] = sConfFile[index][i+1];
      i = i+1;
    } else if(sConfFile[index][i]=="-title") {
      // Put the entire title, surrounded by quotes, as one TString
      TString title;
      UInt_t j=0;
      for(j=i+1; j<sConfFile[index].size(); j++) {
	TString word = sConfFile[index][j];
	if( (word.BeginsWith("\"")) && (word.EndsWith("\"")) ) {
	  title = word.ReplaceAll("\"","");
	  out_command[3] = title;
	  i = j;
	  break;
	} else if(word.BeginsWith("\"")) {
	  title = word.ReplaceAll("\"","");
	} else if(word.EndsWith("\"")) {
	  title += " " + word.ReplaceAll("\"","");
	  out_command[3] = title;
	  i = j;
	  break;
	} else {
	  title += " " + word;
	}
      }
    } else if(sConfFile[index][i]=="-tree") {
      out_command[4] = sConfFile[index][i+1];
      i = i+1;
    }

#ifdef DEBUG
    cout << endl;
#endif
  }
#ifdef DEBUG
  cout << sConfFile[index].size() << ": ";
  for(UInt_t i=0; i<sConfFile[index].size(); i++) {
    cout << sConfFile[index][i] << " ";
  }
  cout << endl;
  for(UInt_t i=0; i<out_command.size(); i++) {
    cout << i << ": " << out_command[i] << endl;
  }
#endif
  return out_command;
}