00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "euler.h"
00016 #include "print.h"
00017
00018 namespace euler
00019 {
00020 ostream& operator<<(ostream& os,solid_t const& s)
00021 {
00022 os << "soid " << s.id << endl;
00023 for(face_t *f = s.f; f; f=f->nxt)
00024 {
00025 os << "\tface " << f << endl;
00026 }
00027 return os;
00028 }
00029
00030 ostream& operator<<(ostream& os,face_t const& f)
00031 {
00032 os << "\tface " << f.id << endl;
00033 for(loop_t const* l = f.l; l; l = l->nxt)
00034 {
00035 os << "\t\tloop\n";
00036 os << l << endl;
00037 }
00038 os << endl;
00039 return os;
00040 }
00041
00042 ostream& operator<<(ostream& os,loop_t const& l)
00043 {
00044 edge_t const* e = l.e;
00045 do
00046 {
00047 os << "\n\t\t\t" << *e;
00048 }
00049 while( (e = e->nxt) != l.e );
00050 return os;
00051 }
00052 ostream& operator<<(ostream& os,edge_t const& e)
00053 {
00054 os << "half edge = (" << e.v->id;
00055 if(e.o) os << ", "<< e.o->v->id;
00056 os << ")";
00057 if(e.o && e.v == e.o->v)
00058 os << " [face = " << e.l->f->id << "]";
00059
00060 os << "\t\t\t" << e.v->p;
00061 if(e.o) os << '\t'<< e.o->v->p;
00062
00063 return os;
00064 }
00065 ostream& operator<<(ostream& os,vertex_t const& v)
00066 {
00067 return os << v.id << '\t' << v.p;
00068 }
00069
00070
00071 }