#include <string>
#include <sstream>


//---------------------------------------------------------
// interval conversion
interval Localization::str2interval(string chaine)
{
  double binf, bsup;
  MOOSValFromString(binf,chaine, "binf");
  MOOSValFromString(bsup,chaine, "bsup");
  return interval(binf,bsup);
}

box Localization::str2box(string chaine)
{
  double bxi, bxs, byi, bys;
  MOOSValFromString(bxi,chaine, "bxi");
  MOOSValFromString(bxs,chaine, "bxs");
  MOOSValFromString(byi,chaine, "byi");
  MOOSValFromString(bys,chaine, "bys");
  return box(interval(bxi,bxs),interval(byi,bys));
}

//*
string Localization::interval2str(interval I)
{
  ostringstream strs;
  strs << "binf=" << I.inf << ",bsup=" << I.sup;
  return strs.str();
}//*/

string Localization::box2str(box B)
{
  ostringstream strs;
  strs << "bxi=" << B[1].inf << ",bxs=" << B[1].sup << "byi=" << B[2].inf << ",bys=" << B[2].sup;
  return strs.str();
}//*/
