BioInfWeb - TreeGraph / Version 1 / Show File - tgf-gostream.h

TreeGraph subversion repository

sventon subversion web client - http://www.sventon.org
[show recent changes]
 
  Help
Rev: HEAD (2) - https://secure.bioinfweb.info/Code/svn/TreeGraph / trunk / main / tgf-gostream.h
Show File - tgf-gostream.h  [show properties]
spinner
/*
 tgf-gostream.h, part of
 treegraph
 Tree formatting program
 Generates vector graphics (SVG,EPS) from .tgf-tree description files.
10   Copyright (c) 2003-04 by Joern Mueller
11 
12 
13   This program is free software; you can redistribute it and/or
14   modify it under the terms of the GNU General Public License
15   as published by the Free Software Foundation; either version 2
16   of the License, or (at your option) any later version.
17 
18   This program is distributed in the hope that it will be useful,
19   but WITHOUT ANY WARRANTY; without even the implied warranty of
20   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21   GNU General Public License for more details.
22 
23   You should have received a copy of the GNU General Public License
24   along with this program (GPL.html); if not, write to the Free Software
25   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26   (also: http://www.gnu.org)
27  */
28 
29 
30 
31 
32 
33 
34 
35  #ifndef __TGF_GOSTREAM_H__
36  #define __TGF_GOSTREAM_H__
37 
38  #include <string>
39  #include <iostream>
40  #include "tgf-utils.h"
41 
42  class gostream
43  {
44  protected:
45   std::ostream& s;
46  public:
47   gostream(std::ostream &s1) : s(s1) {};
48 
49   virtual void moveto(float x,float y)=0;
50   virtual void lineto(float x,float y)=0;
51   virtual void curveto(float,float, float,float, float,float)=0;
52 
53   virtual void write_head(const fRect& paper, const fRect& bbox,float)=0;
54   virtual void write_foot(void)=0;
55   virtual void write_text(const fstring& s, const fPoint& p,float rotate=0)=0;
56   virtual void write_rgabel(float,float,float,float,float,float)=0;
57   virtual void write_egabel(float,float,float,float,float)=0;
58   virtual void write_hline(float,float,float)=0;
59   virtual void write_klammer(const fstring&,float,float,float,float,int)=0;
60   virtual void write_rule(const fPoint& pos, float z,float wd)=0;
61   virtual void write_arrow(const fPoint& pos, float angle)=0;
62 
63   virtual void write_nodelabel(const fPoint& pos, const std::string& s);
64 
65 
66  };
67 
68 
69  class svg_ostream : public gostream
70  {
71  public:
72   svg_ostream(std::ostream& s1) : gostream(s1) {}
73 
74   void moveto(float x,float y);
75   void lineto(float x,float y);
76   void curveto(float,float, float,float, float,float);
77 
78   void write_head(const fRect& paper, const fRect& bbox,float);
79   void write_foot(void);
80   void write_text(const fstring& s, const fPoint& p,float rotate=0);
81   void write_rgabel(float,float,float,float,float,float);
82   void write_egabel(float,float,float,float,float);
83   void write_hline(float,float,float);
84   void write_klammer(const fstring&,float,float,float,float,int);
85   void write_rule(const fPoint& pos, float z,float wd);
86   void write_arrow(const fPoint& pos, float angle);
87 
88   void write_nodelabel(const fPoint& pos, const std::string& s);
89  };
90 
91 
92  class ps_ostream : public gostream
93  {
94   float yh;
95   inline float ty(float y) const { return yh-y;}
96   fontstyle laststyle;
97   bool finited;
98   void setfont(const fontstyle& f);
99  public:
100   ps_ostream(std::ostream& s1);
101 
102   void moveto(float x,float y);
103   void lineto(float x,float y);
104   void curveto(float,float, float,float, float,float);
105 
106 
107   void write_head(const fRect& paper, const fRect& bbox,float);
108   void write_foot(void);
109   void write_text(const fstring& s, const fPoint& p,float rotate=0);
110   void write_rgabel(float,float,float,float,float,float);
111   void write_egabel(float,float,float,float,float);
112   void write_hline(float,float,float);
113   void write_klammer(const fstring&,float,float,float,float,int);
114   void write_rule(const fPoint& pos, float z,float wd);
115   void write_arrow(const fPoint& pos, float angle);
116 
117   void write_nodelabel(const fPoint& pos, const std::string& s);
118  };
119 
120 
121  #endif /* __TGF_GOSTREAM_H__ */


feed icon

sventon 2.5.1

Valid XHTML 1.0 Strict   CSS ist valide!
bioinfweb RSS feed bioinfweb on twitter
bioinfweb - Biology & Informatics Website