[wadalabfont-kit] / jis2prim / Assumption.h  

View of /jis2prim/Assumption.h

Parent Directory | Revision Log
Revision: 1.1 - (download) (as text) (annotate)
Thu Feb 21 11:57:39 2002 UTC (22 years, 9 months ago) by ktanaka
Branch: MAIN
*** empty log message ***
#ifndef _ASSUMPTION_H
#define _ASSUMPTION_H

enum PtypeMask{
  TenMask=1<<0,
  YokoMask=1<<1,
  TateMask=1<<2,
};
enum JointType{
  Start,
  JointStart,
  Mid,
  End,
  JointEnd,
};

class SimpleAssumption{
  friend ostream& operator<<(ostream &os,const SimpleAssumption &sa);
 protected:
  PtypeMask pmask;
  JointType jtype;
  int x, y;
  int angle;
 public:
  SimpleAssumption(PtypeMask pm, JointType jt,int xx,int yy, int a)
    :pmask(pm), jtype(jt), x(xx), y(yy), angle(a){}
};
class AndAssumption{
  friend ostream& operator<<(ostream &os,const AndAssumption &aa);
 protected:
  vector<SimpleAssumption> saList;
 public:
  AndAssumption& add(const SimpleAssumption &sa){
    saList.push_back(sa);
    return *this;
  }
};
class Assumption{
  friend ostream& operator<<(ostream &os,const Assumption &as);
 private:
  vector<AndAssumption> aaList;
 public:
  Assumption& add(const AndAssumption &sa){
    aaList.push_back(sa);
    return *this;
  }
};
ostream& operator<<(ostream &os,const SimpleAssumption &sa){
  os << "SimpleAssumption(pmask=" << (int)(sa.pmask) << ",jtype=" << (int)(sa.jtype)
     << ",x=" << sa.x << ",y=" << sa.y << ",angle=" << sa.angle << ")";
  return os;
}
ostream& operator<<(ostream &os,const AndAssumption &aa){
  vector<SimpleAssumption>::const_iterator it;
  os << "AndAssumption(";
  for(it=aa.saList.begin(); it!=aa.saList.end(); it++){
    os << *it << ' ';
  }
  os << ")";
  return os;
}
ostream& operator<<(ostream &os,const Assumption &a){
  vector<AndAssumption>::const_iterator it;
  os << "Assumption(";
  for(it=a.aaList.begin(); it!=a.aaList.end(); it++){
    os << *it << ' ';
  }
  os << ")";
  return os;
}

#endif /* _ASSUMPTION_H */

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help