Inherited by UCdriverEx.
Public Types | |
enum | dashConstants |
enum | colorConstants |
Public Member Functions | |
UCdriver (const char *s=0) | |
virtual | ~UCdriver () |
virtual void | setDriverTypeName (const char *dName) |
virtual const char * | getDriverTypeName () |
virtual void | line (double x1, double y1, double x2, double y2, int dash_pattern, unsigned user_pattern, double width, int color, double *RGB)=0 |
virtual void | lines (double *X, double *Y, long npoints, int dash_pattern, unsigned user_pattern, double width, int color, double *RGB)=0 |
virtual void | point (double x, double y, char c, const char *font, double size, int color, double *RGB)=0 |
virtual void | points (double *X, double *Y, long npoints, char c, const char *font, double size, int color, double *RGB)=0 |
virtual void | text (double x, double y, const char *s, const char *font, double size, double rotation, double horiz_just, double vert_just, int color, double *RGB)=0 |
virtual void | region (double *X, double *Y, long npoints, double *RGB)=0 |
virtual void | frame ()=0 |
Protected Attributes | |
char * | instance |
char * | dTypeName |
This class is extended to support different output devices (e.g. to a display window or PostScript file). Creating higher level graphics classes that utilize UCdriver methods enables the graphics output to be rendered on multiple output devices.
The input coordinates to the graphics routines are assumed to be in the "normalized" drawing range [0,1]x[0,1].
Source: UCdriver.h
Definition at line 46 of file ucdriver.h.
SOLID, DASH, DOUBLE_DASH, DASH_DOT,DASH_DOUBLE_DOT,DOTS, USER_DASH
Definition at line 369 of file ucdriver.h.
BLACK, DARK_GREY, LIGHT_GREY, BLUE, LIGHT_BLUE, GREEN, LIGHT_GREEN, CYAN, LIGHT_CYAN, RED, LIGHT_RED, MAGENTA,LIGHT_MAGENTA, ORANGE, YELLOW, WHITE, USER_RGB.
Definition at line 378 of file ucdriver.h.
UCdriver::UCdriver | ( | const char * | s = 0 |
) | [inline] |
Constructor, implements appropriate low level initialization for the graphics system.
The character string argument allows one to pass a name (such as a file name) to the initialization routines. There is a default definition for this constructor i.e. it is not a virtual function.
s | A character string to be passed to initialization routine (e.g. a file name). |
Definition at line 69 of file ucdriver.h.
virtual UCdriver::~UCdriver | ( | ) | [inline, virtual] |
Destructor, shuts down, or cleans up, the graphics system.
Definition at line 92 of file ucdriver.h.
virtual void UCdriver::setDriverTypeName | ( | const char * | dName | ) | [inline, virtual] |
Sets the name of the graphics driver. The default driver name is "UCdriver".
dName | Character string specifying the driver name. |
Definition at line 103 of file ucdriver.h.
virtual const char* UCdriver::getDriverTypeName | ( | ) | [inline, virtual] |
Returns the name of the graphics driver.
Definition at line 115 of file ucdriver.h.
virtual void UCdriver::line | ( | double | x1, | |
double | y1, | |||
double | x2, | |||
double | y2, | |||
int | dash_pattern, | |||
unsigned | user_pattern, | |||
double | width, | |||
int | color, | |||
double * | RGB | |||
) | [pure virtual] |
Draws a line between the points (x1, y1) and (x2,y2).
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. |
virtual void UCdriver::lines | ( | double * | X, | |
double * | Y, | |||
long | npoints, | |||
int | dash_pattern, | |||
unsigned | user_pattern, | |||
double | width, | |||
int | color, | |||
double * | RGB | |||
) | [pure 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]).
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. |
virtual void UCdriver::point | ( | double | x, | |
double | y, | |||
char | c, | |||
const char * | font, | |||
double | size, | |||
int | color, | |||
double * | RGB | |||
) | [pure virtual] |
Draws the character c at a point.
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. |
Implemented in GLDriverQt.
virtual void UCdriver::points | ( | double * | X, | |
double * | Y, | |||
long | npoints, | |||
char | c, | |||
const char * | font, | |||
double | size, | |||
int | color, | |||
double * | RGB | |||
) | [pure 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]).
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. |
Implemented in GLDriverQt.
virtual void UCdriver::text | ( | double | x, | |
double | y, | |||
const char * | s, | |||
const char * | font, | |||
double | size, | |||
double | rotation, | |||
double | horiz_just, | |||
double | vert_just, | |||
int | color, | |||
double * | RGB | |||
) | [pure virtual] |
Draws the string s at the reference point (x,y).
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. |
Implemented in GLDriverQt.
virtual void UCdriver::region | ( | double * | X, | |
double * | Y, | |||
long | npoints, | |||
double * | RGB | |||
) | [pure 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.
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. |
Implemented in GLDriverQt.
virtual void UCdriver::frame | ( | ) | [pure virtual] |
Clears the screen or advances the page.
Implemented in GLDriverQt.