Qdriver.h

00001 #ifndef QDRIVER_H_
00002 #define QDRIVER_H_
00003 #include "ucdriver.h"
00004 
00005 #ifndef QDISPLAYDIALOG_H_
00006 class QDisplayDialog;
00007 class QPicture;
00008 class QPen;
00009 class QFont;
00010 class QPainter;
00011 class QBrush;
00012 class QFontMetrics;
00013 class QApplication;
00014 #endif 
00015 /**
00016    \class Qdriver
00017    \brief A driver implementing the methods specified by the UCdriver base class. 
00018   
00019     This driver writes to a QPicture graphics metafile. The frame() call of this
00020     class invokes a modal dialog QDisplayDialog that "plays" the metafile 
00021     in the display window. 
00022         
00023     <p>Usage: 
00024     
00025      <p>A program that uses this driver is required to include the two
00026      header files QTsupport.h and Qdriver.h
00027      
00028      <p>The program must be linked to the EclipseConsoleGraphics library.
00029   
00030      @author Chris Anderson (C) UCLA 2007-09
00031      @version 1/31/09
00032     
00033 */
00034     
00035 class Qdriver : public UCdriver
00036 {
00037     public :
00038     
00039     Qdriver();
00040     ~Qdriver();
00041     
00042     //  Base Class UCdriver Implementations
00043 
00044     public : 
00045     
00046     virtual void lines(double *x, double *y, long npoints, int dash_pattern,
00047              unsigned user_pattern, double width, int color, double *rgb);
00048  
00049     virtual void line(double x1, double y1, double x2, double y2, int dash_pattern, 
00050              unsigned user_pattern, double width, int color, double *rgb); 
00051 
00052     virtual void point(double x, double y, char p, char *font, double size,
00053              int color, double *rgb);
00054     virtual void points(double *X, double *Y, long np, char p, char *font,
00055               double size, int color, double *rgb);
00056 
00057     virtual void text(double x, double y, char *s, char *font, double size,
00058             double rotation, double horiz_just, double vert_just,
00059             int color, double *rgb);
00060 
00061     virtual void region(double *X, double *Y, long npoints, double *RGB);
00062     
00063     virtual void frame();
00064     
00065     //
00066     // Public utility routines
00067     //
00068     /**
00069      Sets the image quility for .jpg output. Higher quality means less compression 
00070      and larger file sizes. 
00071      @param quality 
00072      Output quality (-1 = default,  0 = lowest quality 100 = highest quality).
00073      
00074      */
00075     void setImageOutputQuality(int quality);
00076     
00077     protected :
00078     
00079     void setMaxLogicalCoordinate(long maxCoord);
00080     
00081     void setPenDashAndColor(int dash_pattern, 
00082     unsigned user_pattern, int color, double *rgb);
00083     
00084     void setBrushColor(int color, double *rgb);
00085     
00086     void setFont(char* font, double size);
00087     
00088     long maxLogicalCoordinate;        // maximum logical coordinate
00089     
00090     QDisplayDialog*   qDisplayDialog; // dialog window for displaying and printing
00091                                       // results.                     
00092     QPicture*       graphicsMetaData; // graphics meta data file. 
00093     QPainter*       qPainter;         // graphics painter
00094     QPen*           qPen;             // pen
00095     QFont*          qFont;            // font
00096     QBrush*         qBrush;           // brush
00097     QFontMetrics*   qFontMetrics;     // font metrics
00098 };
00099 
00100 #endif /*QDRIVER_H_*/

Generated on Thu Jan 29 19:34:56 2009 for Qdriver by  doxygen 1.5.1-p1