Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

PSdraw.h

Go to the documentation of this file.
00001 //     $Id: PSdraw.h,v 1.1.1.1 2001/01/04 01:01:11 burnett Exp $
00002 //  Author: Hardy, 29 Mar 94, T. Burnett after
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     // allow testing that file is open
00021     
00022     void draw_string (float x, float y, const char * title, int size=0);
00023     // draw a string at giveconst char *, int size= 0);
00024     
00025     void draw_string (const char* string, int size);
00026     // draw a string at current point
00027     
00028     void move_to (float, float);
00029     // move current point
00030     
00031     void line_to (float, float);
00032     // draw line from current point
00033     
00034     void draw_marker (float,float);
00035     // draw a marker at the point;
00036     
00037     void flush ();
00038     // flush drawing commands
00039     
00040     void set_quad (int quad, const char * title = 0, int selected=0);
00041     // define and clear viewport quadrant, optionally draw title and box
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         //HRectangle(int _x, int _y, int _dx, int _dy)   { x=_x; y=_y; dx=_dx; dy=_dy; };
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     // private functions that convert to screen coordinates
00072     
00073         
00074 };
00075     
00076 } // namespace gui
00077 #endif
00078 
00079 

Generated at Wed Nov 21 12:20:55 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000