EpsView.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _EpsView_H_
15 #define _EpsView_H_
16 
17 #include "DataView.h"
18 
19 #include <fstream>
20 
21 namespace hippodraw {
22 
28 {
29 
30 private:
31 
32  std::ofstream m_outfile;
33 
35 
37 
38  EpsView ( const EpsView & );
39 
44  void initPlot ( const std::string & filename,
45  double x, double y, double w, double h );
46 
49  void lineTo ( double x, double y );
50 
53  void moveTo ( double x, double y );
54 
57  void setDash ( hippodraw::Line::Style style );
58 
61  void setLineWidth ( double size );
62 
67  void setRgbColor ( const Color & color );
68 
73  void setRgbColor ( int red, int green, int blue );
74 
78  void drawSymbol ( hippodraw::Symbol::Type type,
79  double x, double y,
80  float size );
81 
82  virtual void draw_Text ( const std::string &s, float x, float y,
83  float fontsize, float angle,
84  char xp, char yp, const FontBase * );
85 
86 public:
87 
91  EpsView ( const std::string file, double x, double y, double w, double h );
92 
93  virtual ~EpsView ();
94 
97  virtual void closeFile ();
98 
99  virtual void drawLines ( const std::vector< double > & x,
100  const std::vector< double > & y,
102  const Color & color,
103  float size );
104 
105  virtual void drawColorLines ( const std::vector< double > & x,
106  const std::vector< double > & y,
108  const std::vector < Color > & color,
109  float size );
110 
111  virtual void drawViewLines ( const std::vector< double > & x,
112  const std::vector< double > & y,
114  bool color,
115  float size );
116 
117  virtual void drawViewLines ( const std::vector< double > & x,
118  const std::vector< double > & y,
120  const Color & color,
121  float size );
122 
123  virtual void drawPolyLine ( const std::vector< double > & xpoints,
124  const std::vector< double > & ypoints,
126  const Color & color,
127  float size );
128 
129  virtual void drawSquare ( double x1, double y1, double x2, double y2,
130  int red, int green, int blue );
131 
132  virtual void drawViewSquare ( float x1, float y1, float x2, float y2,
133  int red, int green, int blue );
134 
135  virtual void drawPoints ( const std::vector<double> & x,
136  const std::vector<double> & y,
138  float sym_size,
139  const Color & color );
140 
141  virtual void drawPoints ( const std::vector< double > & x,
142  const std::vector< double > & y,
143  const std::vector< Color > & colors,
145  float sym_size );
146 
147  virtual void drawText ( const std::string &s, float x, float y,
148  float fontsize, float angle,
149  char xp, char yp, bool resize,
150  const FontBase * font,
151  const Color * color );
152 
153  virtual void update ( const Observable * );
154  virtual Rect getDrawRect () const;
155  virtual void setDrawRect ( float x, float y, float w, float h );
156 
157  float userToDrawX ( double x ) const;
158  float userToDrawXAutoInv ( double x ) const;
159  float userToDrawY ( double x ) const;
160  float userToDrawColor ( double c ) const;
161  float toViewX ( double datX ) const;
162  float toViewY ( double datY ) const;
163  float toX ( double x ) const;
164  float toY ( double y ) const;
165 
166 };
167 
168 } // namespace hippodraw
169 
170 #endif // _EpsView_H_

Generated for HippoDraw Class Library by doxygen