00001 #ifndef XGRAPH_INCLUDE_H
00002 #define XGRAPH_INCLUDE_H
00003 #include <unistd.h>
00004 #include <iostream>
00005 #include <X11/Xlib.h>
00006 #include <cmath>
00007 #include <cstring>
00008 #include <cstdlib>
00009
00010 #include <unistd.h>
00011
00012
00013 using namespace std;
00014
00015 class CAxesInfo{
00016 public:
00017 double xmin,ymin,xmax,ymax;
00018 double xscale,yscale;
00019 double xintercept;
00020 double yintercept;
00021 int nxtics;
00022 int nytics;
00023 CAxesInfo();
00024 };
00025
00026 class CXGraph{
00027 public:
00028 Display *theDisplay;
00029 Window theWindow;
00030 Screen *theScreen;
00031 Font theFont;
00032 GC theGC;
00033 int window_horizsize,window_vertsize,ixposition,iyposition;
00034 Colormap screen_colormap;
00035 XColor red, brown, blue, yellow, green, orange, black, cyan, violet, lightblue, navy, pink,white;
00036 Status rc;
00037 CAxesInfo axesinfo;
00038 void setcolor(string color);
00039 void setaxes(double xmin,double ymin,double xmax,double ymax);
00040 void drawtext(char *string,double x,double y);
00041 void drawline(double x1,double y1,double x2,double y2);
00042 void drawcircle(double x,double y,double size);
00043 void drawsquare(double x,double y,double size);
00044 void drawdiamond(double x,double y,double size);
00045 void drawuptriangle(double x,double y,double size);
00046 void drawdowntriangle(double x,double y,double size);
00047 void drawpoint(double x,double y);
00048 void drawarrow(double x1,double y1,double x2,double y2,double headsize);
00049 void drawaxes();
00050 void closedisplay();
00051 void getij(double x,double y,int *i,int *j);
00052 void plotline(double *x,double *y,int npts);
00053 void plotpoints(double *x,double *y,int npts);
00054 void clear();
00055 void flush();
00056 CXGraph(int horizsize,int vertsize,int ixposition,int iyposition);
00057 ~CXGraph();
00058 };
00059 #endif