[wadalabfont-kit] / jis2prim / Assumption.cc  

View of /jis2prim/Assumption.cc

Parent Directory | Revision Log
Revision: 1.1 - (download) (as text) (annotate)
Tue Aug 20 11:10:36 2002 UTC (22 years, 3 months ago) by ktanaka
Branch: MAIN
CVS Tags: SNAP-20040518, SNAP-20030702, SNAP-20030630, SNAP-20030624, HEAD
*** empty log message ***
#include "Assumption.h"

SimpleAssumption::SimpleAssumption(PtypeMask pm, JointType jt,double xx,double yy, int a,int h)
  :pmask(pm), jtype(jt), x(xx), y(yy), angle(a), hint(h){}

AndAssumption& AndAssumption::add(const SimpleAssumption &sa){
  saList.push_back(sa);
  return *this;
}

Assumption& Assumption::add(const AndAssumption &sa){
  aaList.push_back(sa);
  return *this;
}

Assumption& Assumption::add(const SimpleAssumption &sa){
  aaList.push_back(AndAssumption().add(sa));
  return *this;
}

std::ostream& operator<<(std::ostream &os,const SimpleAssumption &sa){
  os << "SimpleAssumption(pmask=" << (int)(sa.pmask) << ",jtype=" << (int)(sa.jtype)
     << ",x=" << sa.x << ",y=" << sa.y << ",angle=" << sa.angle 
     << ",hint=" << sa.hint << ")";
  return os;
}
std::ostream& operator<<(std::ostream &os,const AndAssumption &aa){
  std::vector<SimpleAssumption>::const_iterator it;
  if(aa.saList.size()==1){
    return os << *(aa.saList.begin());
  }
  os << "AndAssumption(";
  for(it=aa.saList.begin(); it!=aa.saList.end(); it++){
    os << *it << ' ';
  }
  os << ")";
  return os;
}
std::ostream& operator<<(std::ostream &os,const Assumption &a){
  std::vector<AndAssumption>::const_iterator it;
  if(a.aaList.size()==1){
    return os << *(a.aaList.begin());
  }
  os << "Assumption(";
  for(it=a.aaList.begin(); it!=a.aaList.end(); it++){
    os << *it << ' ';
  }
  os << ")";
  return os;
}

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help