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

WinDraw.h

Go to the documentation of this file.
00001 //     $Header: /nfs/slac/g/glast/ground/cvs/gui/src/WinDraw.h,v 1.2 2001/08/11 15:26:04 burnett Exp $
00002 //
00003 //
00004 // Special Draw2D subclass for Win graphics
00005 // -----------------------------
00006 #ifndef __WinDRAW_H
00007 #define __WinDRAW_H
00008 
00009 #include "gui/Draw2D.h"
00010 #define STRICT
00011 #include <windows.h>
00012 
00013 using namespace gui;
00014 
00015 class WinDraw : public Draw2D {
00016     
00017 public:
00018     WinDraw(HWND win);
00019     ~WinDraw();
00020     
00021     void draw_string(float x, float y, const char * title, int size=0);
00022     // draw a string at given coords
00023     
00024     void draw_string(const char *, int size= 0);
00025     // draw a string at current point
00026     
00027     void move_to(float, float);
00028     // move current point
00029     
00030     void line_to(float, float);
00031     // draw line from current point
00032     
00033     virtual void fill_polygon(const float* xy, int npoints, Shading pattern);
00034     // draw the polygon, fill it according to the shading
00035 
00036     void draw_marker(float,float);
00037     // draw a marker at the point;
00038     
00039     void set_quad(int quad, const char * title = 0, int selected=0);
00040     // define and clear viewport quadrant, optionally draw title and box
00041     
00042     void drawTitle(const char * title, int selected);
00043     // label current view
00044     
00045     void set_defaults();
00046     // set default drawing attributes
00047     
00048     void drawRectangle();
00049     // draw bounding rectangle
00050     
00051     void clearArea();
00052     // clear the display area
00053     
00054     void clearArea(int,int,int,int);
00055     // set viewport and clear it
00056     
00057     void flush(){};
00058     // flush the accumulated drawing commands
00059     
00060     
00061     void set_line_width(float);
00062     // set the line width
00063     
00064     void set_col_index(int in);
00065     // set the color Index
00066     
00067     void set_rgb(float,float,float);
00068     void set_line_style(int);
00069     
00070     void set_marker_size(float);
00071     
00072     void setHDC(HDC _hDC);
00073     // special to WinDraw: must be set before drawing
00074 
00075     float xnorm(int);
00076     float ynorm(int);
00077     // transform from window to 2-coords
00078 
00079     void invalidate();
00080     // force redraw by invalidating
00081 
00082 private:
00083     int maxx, maxy;         // coords of viewport
00084     bool clip(float x, float y,
00085                  int& ix1, int& iy1, int& ix2, int& iy2);
00086     float m_lastx, m_lasty;
00087     HDC m_hdc;
00088     HWND m_win;
00089 };
00090 #endif
00091 

Generated at Mon Nov 26 18:18:11 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000