GLDriverQt Class Reference

This class is implements a UCdriver (and UCdriverEx) interface to a GLDisplayListWidget class instance. It manages an openGL display list (this is a GL thing) that is then displayed on each repaint pass by the associated GLDisplayListWidget. More...

Inherits UCdriverEx.

List of all members.

Public Member Functions

 GLDriverQt (int DisplayList)
 GLDriverQt ()
GLuint getDisplayList ()
virtual ~GLDriverQt ()
void start ()
void clearFrame ()
virtual void line (double x1, double y1, double x2, double y2, int dash_pattern, unsigned int user_pattern, double width, int color, double *RGB)
virtual void lines (double *X, double *Y, long npoints, int dash_pattern, unsigned int user_pattern, double width, int color, double *RGB)
virtual void point (double x, double y, char chr, const char *font, double size, int color, double *RGB)
virtual void points (double *X, double *Y, long npoints, char chr, const char *font, double dsize, int color, double *RGB)
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)
virtual void region (double *X, double *Y, long npoints, double *RGB)
virtual void frame ()
virtual double alphaEx (double alpha=1.0)
virtual void lineEx (double x1, double y1, double x2, double y2, int dash_pattern, unsigned int user_pattern, double width, int color, double *RGB)
virtual void lineEx (double x1, double y1, double z1, double x2, double y2, double z2, int dash_pattern, unsigned int user_pattern, double width, int color, double *RGB)
virtual void linesEx (double *X, double *Y, long npoints, int dash_pattern, unsigned int user_pattern, double width, int color, double *RGB)
virtual void linesEx (double *X, double *Y, double *Z, long npoints, int dash_pattern, unsigned int user_pattern, double width, int color, double *RGB)
virtual void textEx (double x, double y, double z, double nx, double ny, double nz, const char *s, const char *font, double size, double rotation, double horiz_just, double vert_just, int color, double *RGB)
virtual void pointEx (double x, double y, char chr, const char *font, double size, int color, double *RGB)
virtual void pointEx (double x, double y, double z, char chr, const char *font, double size, int color, double *RGB)
void SetGLDisplayListWidget (GLDisplayListWidget *a)

Protected Member Functions

void plotHText (double x, double y, const char *s, const char *font, double size, double rotation, double horiz_just, double vert_just, int color, double *rgb)
void plotHText (double x, double y, double z, double nx, double ny, double nz, const char *s, const char *font, double size, double rotation, double horiz_just, double vert_just, int color, double *rgb)


Detailed Description

This class is implements a UCdriver (and UCdriverEx) interface to a GLDisplayListWidget class instance. It manages an openGL display list (this is a GL thing) that is then displayed on each repaint pass by the associated GLDisplayListWidget.

A GLDriverQt class instance is contained within an GLDisplayListWidget and therefore access to the UCdriver (UCdriverEx) interface is made through a pointer to this instance. Since GLdriverQt is derived from UCdriverEx (and hence UCdriver) the pointer to the contained GLDriverQt can be passed to any routines written in terms of UCdriverEx (or UCdriver) and the results of those routines will be displayed in the GLDisplayListWidget child window.

Sample Code Fragment:

//   Instantiate a GLDisplayListWidget in the containing window constructor 

     glWidget = new GLDisplayListWidget;     

//
//   Elsewhere in containing window class (typically in a response function)
//   capture the GLDriverQt pointer. 
//
     GLDriverQt* Gldriver = glWidget->getGLDriverQtPtr(); 

//   Use the  start() to open up a GL display list and then create
//   graphics by calling UCdriver or UCdriverEx methods. Close
//   the list and induce a repaint of glWidget by calling frame(). 

     Gldriver->start();
     
     Gldriver->point(...);          //           
     Gldriver->lines(...);          // UCdriver or UCdriverEx calls
     Gldriver->pointEx(...);        //

     Gldriver->frame();

Source: GLDriverQt.h, GLDriverQt.cpp

Author:
Chris Anderson (C) UCLA 2007-09
Version:
2/16/09

Definition at line 75 of file GLDriverQt.h.


Member Function Documentation

void GLDriverQt::start (  ) 

Starts a new frame (or plot).

Definition at line 77 of file GLDriverQt.cpp.

void GLDriverQt::clearFrame (  ) 

Clears the current plot.

Definition at line 68 of file GLDriverQt.cpp.

void GLDriverQt::point ( double  x,
double  y,
char  chr,
const 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 145 of file GLDriverQt.cpp.

void GLDriverQt::points ( double *  X,
double *  Y,
long  npoints,
char  chr,
const char *  font,
double  dsize,
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 158 of file GLDriverQt.cpp.

void GLDriverQt::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 
) [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 177 of file GLDriverQt.cpp.

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

Not implemented for GLDriverQt

Implements UCdriver.

Definition at line 184 of file GLDriverQt.h.

void GLDriverQt::frame (  )  [virtual]

Clears the screen or advances the page.

Implements UCdriver.

Definition at line 83 of file GLDriverQt.cpp.

virtual double GLDriverQt::alphaEx ( double  alpha = 1.0  )  [inline, virtual]

Sets the alpha value of any command executed in the current driver instance. This is to avoid collision with the original UCdriver calls while still allowing for transparency in your graphics

Parameters:
alpha the new alpha value (between 0.0 and 1.0)
Returns:
the old alpha value

Implements UCdriverEx.

Definition at line 201 of file GLDriverQt.h.

void GLDriverQt::lineEx ( double  x1,
double  y1,
double  z1,
double  x2,
double  y2,
double  z2,
int  dash_pattern,
unsigned int  user_pattern,
double  width,
int  color,
double *  RGB 
) [virtual]

Draw a line between two points with a given pattern and color in three dimensions

Parameters:
x1 the x location of an end point
y1 the y location of an end point
z1 the z location of an end point
x2 the x location of the other end point
y2 the y location of the other end point z2 the z location of the other end point
dash_pattern a predefined dash pattern
user_pattern the user defined pattern used when dash pattern is set to USER_DASH
width the width of the line
color the predefined color or USER_RGB
RGB an array of 3 doubles [0,255] that define an RGB color

Implements UCdriverEx.

Definition at line 192 of file GLDriverQt.cpp.

void GLDriverQt::linesEx ( double *  X,
double *  Y,
double *  Z,
long  npoints,
int  dash_pattern,
unsigned int  user_pattern,
double  width,
int  color,
double *  RGB 
) [virtual]

Draw a line between a set of points in three dimensions

Parameters:
X an array of x locations
Y an array of y locations
Z an array of z locations
npoints the number of elements in the X,Y and Z arrays
dash_pattern a predefined dash pattern
user_pattern the user defined pattern used when dash pattern is set to USER_DASH
width the width of the line
color the predefined color or USER_RGB
RGB an array of 3 doubles [0,255] that define an RGB color

Implements UCdriverEx.

Definition at line 232 of file GLDriverQt.cpp.

void GLDriverQt::textEx ( double  x,
double  y,
double  z,
double  nx,
double  ny,
double  nz,
const char *  s,
const char *  font,
double  size,
double  rotation,
double  horiz_just,
double  vert_just,
int  color,
double *  RGB 
) [virtual]

Places text

Parameters:
x the x coordinate of the text
y the y coordinate of the text
z the z coordinate of the text
nx the nx normal to the text plane
ny the ny normal to the text plane
nz the nz normal to the text plane
s the string to output
font the font to use when printing the string (platform specific)
size the size in points
rotation the number of degrees to rotate the text
horiz_just The horizontal alignment of the string about the reference point.
vert_just The vertical alignment of the string about the reference point.
color the predefined color or USER_RGB
RGB an array of 3 doubles [0,255] that define an RGB color

Implements UCdriverEx.

Definition at line 264 of file GLDriverQt.cpp.

void GLDriverQt::pointEx ( double  x,
double  y,
char  chr,
const char *  font,
double  size,
int  color,
double *  RGB 
) [virtual]

Draw a point at a set of coordinates.

Parameters:
x the x coordinate of the point
y the y coordinate of the point
chr the 'point' to draw
font the font used to draw the point
color the predefined color or USER_RGB
RGB an array of 3 doubles [0,255] that define an RGB color

Implements UCdriverEx.

Definition at line 273 of file GLDriverQt.cpp.

void GLDriverQt::pointEx ( double  x,
double  y,
double  z,
char  chr,
const char *  font,
double  size,
int  color,
double *  RGB 
) [virtual]

Draw a point at a set of coordinates. Since this is an explicitly 3D point the point character is interpreted to mean some three dimensional symbol that is specific to the driver being used.

Parameters:
x the x coordinate of the point
y the y coordinate of the point
z the z coordinate of the point
chr the 'point' to draw
font the font used to draw the point
color the predefined color or USER_RGB
RGB an array of 3 doubles [0,255] that define an RGB color

Implements UCdriverEx.

Definition at line 307 of file GLDriverQt.cpp.

void GLDriverQt::SetGLDisplayListWidget ( GLDisplayListWidget a  ) 

Associates a GLDisplayListWidget parent object with the driver.

Definition at line 39 of file GLDriverQt.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Feb 17 11:57:13 2009 for QtGLgraphics by  doxygen 1.5.1-p1