bbq Implementation Documentation
Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

bbq_postscript.h

Go to the documentation of this file.
00001 // bbq - Copyright (C) 2005, Axel Mosig, University of Leipzig. See
00002 // main.cpp for details.
00003 
00004 #include <ostream>
00005 #include "triple.h"
00006 #include <list>
00007 #include <string>
00008 
00009 namespace bbq {
00010         
00016 typedef std::triple<int,int,bool> match_list_triple;
00017 
00019 typedef std::list< match_list_triple > ps_match_list;
00020 
00021 void print_ps_header(std::ostream& o);
00022 
00023 void print_ps_footer(std::ostream& o);
00024 
00025 void print_cluster(int ypos, std::string name, int beg, int end, int L, ps_match_list ml, std::ostream& o);
00026 
00027 void print_label(int xpos, int ypos, int j, std::string name, std::ostream& o);
00028 
00029 int get_col(int j);
00030 
00031 int get_sh(int j);
00032           
00033 template<class w_bit_set>
00034 void print_cluster_members(int ypos, w_bit_set& C, std::ostream& o)
00035 {
00036         o<<"newpath\n";          
00037         o<<"30 "<<ypos<<" moveto\n";
00038         o<<"(common labels: \173) show\n"; // print "{"
00039         o<<"closepath\n";
00040         int j;
00041         int pos = 155;
00042         for (j=0; j<w_bit_set::k; j++)
00043         {
00044                 if (C.contains(j))
00045                 {
00046                         if (pos!=155)
00047                         {
00048                                 o<<"newpath\n";          
00049                                 o<<pos<<" "<<ypos<<" moveto\n";
00050                                 o<<"(\054) show\n"; // print "{"
00051                                 o<<"closepath\n";
00052                                 pos += 18;
00053                         }
00054                         int col = get_col(j);
00055                         int sh = get_sh(j);
00056                         o<<"/sh_fill {col"<<col<<"} def\n";
00057                         o<<pos<<" "<<ypos+3<<" sh"<<sh<<"\n";
00058                         pos += 12;
00059                 }
00060         }
00061         o<<"newpath\n";          
00062         o<<pos<<" "<<ypos<<" moveto\n";
00063         o<<"(\175) show\n"; // print "}"
00064         o<<"closepath\n";
00065         
00066 }
00067 
00068 } // end namespace bbq
bbq Implementation Documentation
Axel Mosig, Bioinformatics, University of Leipzig