00001
00002
00003
00004 #ifndef __PSDRAW_H
00005 #define __PSDRAW_H
00006
00007
00008 #include <fstream>
00009 #include "gui/Draw2D.h"
00010
00011 namespace gui {
00012
00013 class PSdraw : public Draw2D
00014 {
00015
00016 public:
00017 PSdraw (const char *filename="temp.ps", const char *format="DinA4");
00018 ~PSdraw();
00019 bool operator()(){return psfile.good();}
00020
00021
00022 void draw_string (float x, float y, const char * title, int size=0);
00023
00024
00025 void draw_string (const char* string, int size);
00026
00027
00028 void move_to (float, float);
00029
00030
00031 void line_to (float, float);
00032
00033
00034 void draw_marker (float,float);
00035
00036
00037 void flush ();
00038
00039
00040 void set_quad (int quad, const char * title = 0, int selected=0);
00041
00042
00043 void set_defaults();
00044 void set_line_style(int);
00045 struct PageFormat;
00046
00047 virtual void set_rgb(float r,float g,float b);
00048 virtual void set_col_index(int);
00049
00050 private:
00051 std::ofstream psfile;
00052 unsigned long myforeground, mybackground;
00053 int lastx, lasty;
00054 int screenWidth, screenHeight;
00055 bool isStrokePending;
00056 int flSingle, selected;
00057
00058 struct HRectangle
00059 {
00060 int x, y, dx, dy;
00061
00062 };
00063 HRectangle currentQuad;
00064 HRectangle screen;
00065 HRectangle quadrant[4];
00066
00067 void resize (int xsize, int ysize);
00068
00069 int xwin (float);
00070 int ywin (float);
00071
00072
00073
00074 };
00075
00076 }
00077 #endif
00078
00079