00001
00002
00014 #ifndef _EpsView_H_
00015 #define _EpsView_H_
00016
00017 #include "ViewBase.h"
00018
00019 #include <fstream>
00020
00021 class Action;
00022
00027 class MDL_HIPPOPLOT_API EpsView : public ViewBase
00028 {
00029
00030 private:
00031
00032 std::ofstream m_outfile;
00033
00034 HippoRectangle m_boundingRect;
00035
00036 HippoRectangle m_draw_rect;
00037
00038 EpsView ( const EpsView & );
00039
00044 void initPlot ( const std::string & filename,
00045 double x, double y, double w, double h );
00046
00047 virtual void draw_Text ( const std::string &s, float x, float y,
00048 float fontsize, float angle,
00049 char xp, char yp, const FontBase * );
00050
00051 public:
00052
00056 EpsView ( const std::string file, double x, double y, double w, double h );
00057
00058 virtual ~EpsView ();
00059
00062 virtual void initPlot ( double aspect );
00063
00064 virtual void endPlot ();
00065
00066 virtual void drawLines ( const std::vector< double > & x,
00067 const std::vector< double > & y,
00068 hippodraw::Line::Style style,
00069 const Color & color,
00070 float size );
00071
00072 virtual void drawColorLines ( const std::vector< double > & x,
00073 const std::vector< double > & y,
00074 hippodraw::Line::Style style,
00075 const std::vector < Color > & color,
00076 float size );
00077
00078 virtual void drawViewLines ( const std::vector< double > & x,
00079 const std::vector< double > & y,
00080 hippodraw::Line::Style style,
00081 bool color,
00082 float size );
00083
00084 virtual void drawViewLines ( const std::vector< double > & x,
00085 const std::vector< double > & y,
00086 hippodraw::Line::Style style,
00087 const Color & color,
00088 float size );
00089
00090 virtual void drawPolyLine ( const std::vector< double > & xpoints,
00091 const std::vector< double > & ypoints,
00092 hippodraw::Line::Style style,
00093 const Color & color,
00094 float size );
00095
00096 virtual void drawSquare ( double x1, double y1, double x2, double y2,
00097 int red, int green, int blue );
00098
00099 virtual void drawViewSquare ( float x1, float y1, float x2, float y2,
00100 int red, int green, int blue );
00101
00102 virtual void drawPoints ( const std::vector<double> & x,
00103 const std::vector<double> & y,
00104 hippodraw::Symbol::Type type,
00105 float sym_size,
00106 const Color & color );
00107
00108 virtual void drawPoints ( const std::vector< double > & x,
00109 const std::vector< double > & y,
00110 const std::vector< Color > & colors,
00111 hippodraw::Symbol::Type type,
00112 float sym_size );
00113
00114 virtual void drawMag ( float x, float y, int mag, float fontsize );
00115
00116 virtual void drawUserText ( const std::string &s, float x, float y,
00117 float fontsize, float angle,
00118 char xp, char yp );
00119
00120 virtual void drawText ( const std::string &s, float x, float y,
00121 float fontsize, float angle,
00122 char xp, char yp, bool resize,
00123 const FontBase * font );
00124
00125 virtual void update ( const Observable * );
00126 virtual HippoRectangle getDrawRect () const;
00127 virtual void setDrawRect ( float x, float y, float w, float h );
00128
00129 float userToDrawX ( double x ) const;
00130 float userToDrawY ( double x ) const;
00131 float userToDrawColor ( double c ) const;
00132 float toViewX ( double datX ) const;
00133 float toViewY ( double datY ) const;
00134 float toX ( double x ) const;
00135 float toY ( double y ) const;
00136
00137 };
00138
00139 #endif // _EpsView_H_