Qdriver Class Reference

A driver implementing the methods specified by the UCdriver base class. More...

Inherits UCdriver.

List of all members.

Public Member Functions

 Qdriver ()
 ~Qdriver ()
virtual void lines (double *x, double *y, long npoints, int dash_pattern, unsigned user_pattern, double width, int color, double *rgb)
virtual void line (double x1, double y1, double x2, double y2, int dash_pattern, unsigned user_pattern, double width, int color, double *rgb)
virtual void point (double x, double y, char p, char *font, double size, int color, double *rgb)
virtual void points (double *X, double *Y, long np, char p, char *font, double size, int color, double *rgb)
virtual void text (double x, double y, char *s, char *font, double size, double rotation, double horiz_just, double vert_just, int color, double *rgb)
virtual void region (double *X, double *Y, long npoints, double *RGB)
virtual void frame ()
void setImageOutputQuality (int quality)

Protected Member Functions

void setMaxLogicalCoordinate (long maxCoord)
void setPenDashAndColor (int dash_pattern, unsigned user_pattern, int color, double *rgb)
void setBrushColor (int color, double *rgb)
void setFont (char *font, double size)

Protected Attributes

long maxLogicalCoordinate
QDisplayDialog * qDisplayDialog
QPicture * graphicsMetaData
QPainter * qPainter
QPen * qPen
QFont * qFont
QBrush * qBrush
QFontMetrics * qFontMetrics


Detailed Description

A driver implementing the methods specified by the UCdriver base class.

This driver writes to a QPicture graphics metafile. The frame() call of this class invokes a modal dialog QDisplayDialog that "plays" the metafile in the display window.

Usage:

A program that uses this driver is required to include the two header files QTsupport.h and Qdriver.h

The program must be linked to the EclipseConsoleGraphics library.

Author:
Chris Anderson (C) UCLA 2007-09
Version:
1/31/09

Definition at line 35 of file Qdriver.h.


Member Function Documentation

void Qdriver::lines ( double *  x,
double *  y,
long  npoints,
int  dash_pattern,
unsigned  user_pattern,
double  width,
int  color,
double *  rgb 
) [virtual]

Draws a connected set of line segments. The segment endpoints are specified by (X[0],Y[0]), (X[1],Y[1]), ..., (X[npoints-1],Y[npoint-1]).

Parameters:
X A double array of the x-coordinates of the segment endpoints (values in [0,1])
Y A double array of the y-coordinates of the segment endpoints (values in [0,1])
npoints The number of segment endpoints (typically the size of the X and Y arrays).
dash_pattern One of the enumerated dash constants. A value of 0 (default) for dash_pattern corresponds to a solid line. If equal to USER_DASH then the parameter user_pattern sets the dash pattern.
user_pattern The last two bytes of this parameter are used to represent the dash pattern if dash_pattern = USER_DASH.
width The width of the line as a fraction of the drawing window width. For example, in the PostScript representation the default is 0.001. Passing a value of 0 for width causes the default to be used.
color One of the enumerated color constants values specifying the color of the line. If color == 0 the default color is used. If color == USER_RGB then the parameter RGB is used to set the color.
RGB A three element double array with values between 0 and 255 specifying the red, green and blue components of the color.

Implements UCdriver.

Definition at line 158 of file Qdriver.cpp.

void Qdriver::line ( double  x1,
double  y1,
double  x2,
double  y2,
int  dash_pattern,
unsigned  user_pattern,
double  width,
int  color,
double *  rgb 
) [virtual]

Draws a line between the points (x1, y1) and (x2,y2).

Parameters:
x1 The x-coordinate of 1st point (a value in [0,1])
y1 The y-coordinate of 1st point (a value in [0,1])
x2 The x-coordinate of 2nd point (a value in [0,1])
y2 The y-coordinate of 2nd point (a value in [0,1])
dash_pattern One of the enumerated dash constants. A value of 0 (default) for dash_pattern corresponds to a solid line. If equal to USER_DASH then the parameter user_pattern sets the dash pattern.
user_pattern The last two bytes of this parameter are used to represent the dash pattern if dash_pattern = USER_DASH.
width The width of the line as a fraction of the drawing window width. For example, in the PostScript representation the default is 0.001. Passing a value of 0 for width causes the default to be used.
color One of the enumerated color constants values specifying the color of the line. If color == 0 the default color is used. If color == USER_RGB then the parameter RGB is used to set the color.
RGB a three element double array with values between 0 and 255 specifying the red, green and blue components of the color. This parameter is only used if color == USER_RGB.

Implements UCdriver.

Definition at line 177 of file Qdriver.cpp.

void Qdriver::point ( double  x,
double  y,
char  p,
char *  font,
double  size,
int  color,
double *  rgb 
) [virtual]

Draws the character c at a point.

Parameters:
x The x-coordinate of the point (a value in [0,1])
y The y-coordinate of the point (a value in [0,1])
c The character to be drawn
font A character string specifying the font to be used. If font == 0 the default font is used.
size The relative size of the character with respect to the drawing window. If size == 0, the default size value is used.
color One of the enumerated color constants values specifying the color of the line. If color == 0 the default color is used. If color == USER_RGB then the parameter RGB is used to set the color.
RGB A three element double array with values between 0 and 255 specifying the red, green and blue components of the color.

Implements UCdriver.

Definition at line 187 of file Qdriver.cpp.

void Qdriver::points ( double *  X,
double *  Y,
long  np,
char  p,
char *  font,
double  size,
int  color,
double *  rgb 
) [virtual]

Draws the character c at a collection of points. The coordinates of the points are specfied by the values in the X and Y arrays; e.g. (X[0],y[0]), (X[1],Y[1]), ..., (X[npoint-1],Y[npoints-1]).

Parameters:
X A double array of the x-coordinates of point locations (values in [0,1])
Y A double array of the y-coordinates of point locations (values in [0,1])
npoints The number of points (typically the size of the X and Y arrays).
c The character to be drawn
font A character string specifying the font to be used. If font == 0 the default font is used.
size The relative size of the character with respect to the drawing window. If size == 0, the default size value is used.
color One of the enumerated color constants values specifying the color of the line. If color == 0 the default color is used. If color == USER_RGB then the parameter RGB is used to set the color.
RGB a three element double array with values between 0 and 255 specifying the red, green and blue components of the color.

Implements UCdriver.

Definition at line 193 of file Qdriver.cpp.

void Qdriver::text ( double  x,
double  y,
char *  s,
char *  font,
double  size,
double  rotation,
double  horiz_just,
double  vert_just,
int  color,
double *  rgb 
) [virtual]

Draws the string s at the reference point (x,y).

Parameters:
x The x-coordinate of the point (a value in [0,1])
y The y-coordinate of the point (a value in [0,1])
s A character string containing the characters to be drawn.
font A character string specifying the font to be used. If font == 0 the default font is used.
size The relative size of the characters with respect to the drawing window. If size == 0, the default size value is used.
rotation The rotation of the string about the reference point in a counterclockwise direction. The angle is specified in degrees.
horiz_just The horizontal alignment of the string about the reference point. A values of 0 causes the string to be horizontally centered about the reference point. A value of -1 causes the left edge of the string to be lined up with the reference point, a value of 1 lines up the right edge, and any other value the interpolation of these. For example, -0.5 causes the reference point to be located a forth of the string from the left edge of the string. Alignment is performed before any rotation.
vert_just The vertical alignment of the string about the reference point. A values of 0 causes the string to be vertically centered about the reference point. A value of -1 causes the top edge of the string to be lined up with the reference point, a value of 1 lines up the bottom edge, and any other value the interpolation of these. For example, -0.5 causes the reference point to be located a forth of the string from the top edge of the string. Alignment is performed before any rotation.
color One of the enumerated color constants values specifying the color of the line. If color == 0 the default color is used. If color == USER_RGB then the parameter RGB is used to set the color.
RGB A three element double array with values between 0 and 255 specifying the red, green and blue components of the color.

Implements UCdriver.

Definition at line 219 of file Qdriver.cpp.

void Qdriver::region ( double *  X,
double *  Y,
long  npoints,
double *  RGB 
) [virtual]

Draws a filled polygonal region whose vertices are are specified by (X[0],Y[0]), (X[1],Y[1]), ..., (X[npoints-1],Y[npoint-1]),(X[0],Y[0])

Note : The first point is not repeated in the polygonal list.

Parameters:
X A double array of the x-coordinates of the polygon vertices (values in [0,1])
Y A double array of the y-coordinates of the polygon vertices (values in [0,1])
npoints The number of segment endpoints (typically the size of the X and Y arrays).
RGB A three element double array with values between 0 and 255 specifying the red, green and blue components of the color.

Implements UCdriver.

Definition at line 243 of file Qdriver.cpp.

void Qdriver::frame (  )  [virtual]

Clears the screen or advances the page.

Implements UCdriver.

Definition at line 257 of file Qdriver.cpp.

void Qdriver::setImageOutputQuality ( int  quality  ) 

Sets the image quility for .jpg output. Higher quality means less compression and larger file sizes.

Parameters:
quality Output quality (-1 = default, 0 = lowest quality 100 = highest quality).

Definition at line 153 of file Qdriver.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Jan 29 19:34:56 2009 for Qdriver by  doxygen 1.5.1-p1