[wadalabfont-kit] / jis2prim / Assumption.cc  

Annotation of /jis2prim/Assumption.cc

Parent Directory | Revision Log

Revision: 1.1 - (view) (download) (as text)

1 : ktanaka 1.1 #include "Assumption.h"
2 :    
3 :     SimpleAssumption::SimpleAssumption(PtypeMask pm, JointType jt,double xx,double yy, int a,int h)
4 :     :pmask(pm), jtype(jt), x(xx), y(yy), angle(a), hint(h){}
5 :    
6 :     AndAssumption& AndAssumption::add(const SimpleAssumption &sa){
7 :     saList.push_back(sa);
8 :     return *this;
9 :     }
10 :    
11 :     Assumption& Assumption::add(const AndAssumption &sa){
12 :     aaList.push_back(sa);
13 :     return *this;
14 :     }
15 :    
16 :     Assumption& Assumption::add(const SimpleAssumption &sa){
17 :     aaList.push_back(AndAssumption().add(sa));
18 :     return *this;
19 :     }
20 :    
21 :     std::ostream& operator<<(std::ostream &os,const SimpleAssumption &sa){
22 :     os << "SimpleAssumption(pmask=" << (int)(sa.pmask) << ",jtype=" << (int)(sa.jtype)
23 :     << ",x=" << sa.x << ",y=" << sa.y << ",angle=" << sa.angle
24 :     << ",hint=" << sa.hint << ")";
25 :     return os;
26 :     }
27 :     std::ostream& operator<<(std::ostream &os,const AndAssumption &aa){
28 :     std::vector<SimpleAssumption>::const_iterator it;
29 :     if(aa.saList.size()==1){
30 :     return os << *(aa.saList.begin());
31 :     }
32 :     os << "AndAssumption(";
33 :     for(it=aa.saList.begin(); it!=aa.saList.end(); it++){
34 :     os << *it << ' ';
35 :     }
36 :     os << ")";
37 :     return os;
38 :     }
39 :     std::ostream& operator<<(std::ostream &os,const Assumption &a){
40 :     std::vector<AndAssumption>::const_iterator it;
41 :     if(a.aaList.size()==1){
42 :     return os << *(a.aaList.begin());
43 :     }
44 :     os << "Assumption(";
45 :     for(it=a.aaList.begin(); it!=a.aaList.end(); it++){
46 :     os << *it << ' ';
47 :     }
48 :     os << ")";
49 :     return os;
50 :     }

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help