00001
00002
00003
00004
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
00023
00024 void draw_string(const char *, int size= 0);
00025
00026
00027 void move_to(float, float);
00028
00029
00030 void line_to(float, float);
00031
00032
00033 virtual void fill_polygon(const float* xy, int npoints, Shading pattern);
00034
00035
00036 void draw_marker(float,float);
00037
00038
00039 void set_quad(int quad, const char * title = 0, int selected=0);
00040
00041
00042 void drawTitle(const char * title, int selected);
00043
00044
00045 void set_defaults();
00046
00047
00048 void drawRectangle();
00049
00050
00051 void clearArea();
00052
00053
00054 void clearArea(int,int,int,int);
00055
00056
00057 void flush(){};
00058
00059
00060
00061 void set_line_width(float);
00062
00063
00064 void set_col_index(int in);
00065
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
00074
00075 float xnorm(int);
00076 float ynorm(int);
00077
00078
00079 void invalidate();
00080
00081
00082 private:
00083 int maxx, maxy;
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