Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

TxqViewPort Class Reference

The TxqViewPort is an interface class to convert between the pixel and real world coordinate system. More...

#include <TxqViewPort.h>

Inheritance diagram for TxqViewPort::

TxqLinViewPort TxqLogViewPort TxqLinLogViewPort TxqLogLinViewPort List of all members.

Public Methods

 TxqViewPort ()
 The constructor is default. More...

virtual double getXmin ()
 get the X minimum value of the plot region. More...

virtual double getXmax ()
 get the X maximum value of the plot region. More...

virtual double getYmin ()
 get the Y minimum value of the plot region. More...

virtual double getYmax ()
 get the Y maximum value of the plot region. More...

virtual double pixelToX (const QPoint &p)=0
 Convert the pixel to the plot x value. More...

virtual double pixelToY (const QPoint &p)=0
 Convert the pixel to the plot y value. More...

virtual QPoint xyToPixel (double x, double y)
 Convert the x,y plot cordinates to a screen pixel point. More...

virtual short xToPixel (double x)=0
 Convert the x coordinate on the plot to a x pixel value. More...

virtual short yToPixel (double y)=0
 Convert the y coordinate on the plot to a y pixel value. More...

virtual void setXmin (double val)=0
 set the X minimum value of the plot region. More...

virtual void setXmax (double val)=0
 set the X maximum value of the plot region. More...

virtual void setYmin (double val)=0
 set the Y minimum value of the plot region. More...

virtual void setYmax (double val)=0
 set the Y maximum value of the plot region. More...

virtual void setBounds (double plxmin, double plymin, double plxmax, double plymax, int cwidth, int cheight)
 set the x and y bounds of the plot region. More...

virtual void setBounds (double plxmin, double plymin, double plxmax, double plymax, int transx, int transy, int cwidth, int cheight)
 set the x and y bounds of the plot region. More...

virtual void setBounds (double plxmin, double plymin, double plxmax, double plymax)
 set the x and y bounds of the plot region. More...

virtual void setPlotRegion (int transx, int transy, int cwidth, int cheight)
 Define the plot region. More...

virtual QRect getPlotRegion ()
 Get the plot region as a QRect. More...

virtual int width ()
 Get the canvas width. More...

virtual int getWidth ()
 Get the canvas width. More...

virtual int height ()
 Get the canvas height. More...

virtual int getHeight ()
 Get the canvas height. More...

virtual void setScreenCoordinates (bool b)
 Set the screen coordinate flag. More...

virtual bool isScreenCoordinates ()
 Get the screen coordinate flag. More...

virtual ~TxqViewPort ()
 The destructor. More...


Protected Attributes

double xmin
 The x min value for the plot. More...

double xmax
 The x max value for the plot. More...

double ymin
 The y min value for the plot. More...

double ymax
 The y max value for the plot. More...

int xwidth
 The canvas width. More...

int yheight
 The canvas height. More...

QRect plotRect
 The plot region rectangle. More...

bool scFlag
 the screen coordinate flag. More...


Detailed Description

The TxqViewPort is an interface class to convert between the pixel and real world coordinate system.

Derived classes can be used to change the X or Y scaling. The pure virtual classes must be implemented in the derived classes.

Copyright 2000 by Tech-X Corporation

Author:
Kelly G. Luetkemeyer

Version:
Id:
TxqViewPort.h,v 1.14 2001/10/12 18:51:23 kgl Exp

Definition at line 42 of file TxqViewPort.h.


Constructor & Destructor Documentation

TxqViewPort::TxqViewPort ( )
 

The constructor is default.

TxqViewPort::~TxqViewPort ( ) [virtual]
 

The destructor.


Member Function Documentation

int TxqViewPort::getHeight ( ) [virtual]
 

Get the canvas height.

Returns:
the height of the canvas

QRect TxqViewPort::getPlotRegion ( ) [virtual]
 

Get the plot region as a QRect.

Returns:
the plot region

int TxqViewPort::getWidth ( ) [virtual]
 

Get the canvas width.

Returns:
the width of the canvas

double TxqViewPort::getXmax ( ) [virtual]
 

get the X maximum value of the plot region.

Returns:
the value for the right edge of the plot.

Referenced by Txq2dDrawable::getXmax(), and Txq2dCanvas::getXmax().

double TxqViewPort::getXmin ( ) [virtual]
 

get the X minimum value of the plot region.

Returns:
the value for the left edge of the plot.

Referenced by Txq2dDrawable::getXmin(), and Txq2dCanvas::getXmin().

double TxqViewPort::getYmax ( ) [virtual]
 

get the Y maximum value of the plot region.

Returns:
the value for the top edge of the plot.

Referenced by Txq2dDrawable::getYmax(), and Txq2dCanvas::getYmax().

double TxqViewPort::getYmin ( ) [virtual]
 

get the Y minimum value of the plot region.

Returns:
the value for the bottom edge of the plot.

Referenced by Txq2dDrawable::getYmin(), and Txq2dCanvas::getYmin().

int TxqViewPort::height ( ) [virtual]
 

Get the canvas height.

Returns:
the height of the canvas

bool TxqViewPort::isScreenCoordinates ( ) [virtual]
 

Get the screen coordinate flag.

Returns:
true if using screen coordinates

double TxqViewPort::pixelToX ( const QPoint & p ) [pure virtual]
 

Convert the pixel to the plot x value.

Returns:
the plot x coordinate for a given screen pixel p.
Parameters:
p   the pixel point.

Reimplemented in TxqLinLogViewPort, TxqLinViewPort, and TxqLogViewPort.

Referenced by Txq2dDrawable::pixelToX(), and Txq2dCanvas::pixelToX().

double TxqViewPort::pixelToY ( const QPoint & p ) [pure virtual]
 

Convert the pixel to the plot y value.

Returns:
the plot y coordinate for a given screen pixel p.
Parameters:
p   the pixel point.

Reimplemented in TxqLinViewPort, TxqLogLinViewPort, and TxqLogViewPort.

Referenced by Txq2dDrawable::pixelToY(), and Txq2dCanvas::pixelToY().

void TxqViewPort::setBounds ( double plxmin,
double plymin,
double plxmax,
double plymax ) [virtual]
 

set the x and y bounds of the plot region.

The bounds are the real-world cordinates of the TxqCanvas This method may be used in conjuntion with setPlotRegion.

Parameters:
plxmin   the value for the left edge of the plot.
plymin   the value for the bottom edge of the plot.
plxmax   the value for the right edge of the plot.
plymax   the value for the top edge of the plot.

void TxqViewPort::setBounds ( double plxmin,
double plymin,
double plxmax,
double plymax,
int transx,
int transy,
int cwidth,
int cheight ) [virtual]
 

set the x and y bounds of the plot region.

The bounds are the real-world cordinates of the TxqCanvas

Parameters:
plxmin   the value for the left edge of the plot.
plymin   the value for the bottom edge of the plot.
plxmax   the value for the right edge of the plot.
plymax   the value for the top edge of the plot.
transx   the starting pixel X value of the plot region
transy   the starting pixel Y value of the plot region
cwidht   the width of the plot region
cheight   the height of the plot region

void TxqViewPort::setBounds ( double plxmin,
double plymin,
double plxmax,
double plymax,
int cwidth,
int cheight ) [virtual]
 

set the x and y bounds of the plot region.

The bounds are the real-world cordinates of the TxqCanvas

Parameters:
plxmin   the value for the left edge of the plot.
plymin   the value for the bottom edge of the plot.
plxmax   the value for the right edge of the plot.
plymax   the value for the top edge of the plot.
cwidth   the width of the canvas
cheight   the height of the canvas

Referenced by Txq2dCanvas::setRange().

void TxqViewPort::setPlotRegion ( int transx,
int transy,
int cwidth,
int cheight ) [virtual]
 

Define the plot region.

The plot region is defined as the starting X and the starting Y pixel values followed by the width and height of the region. All graphics will be bounded within this region.

Parameters:
transx   the starting pixel X value of the plot region
transy   the starting pixel Y value of the plot region
cwidth   the width of the plot region
cheight   the height of the plot region

void TxqViewPort::setScreenCoordinates ( bool b ) [virtual]
 

Set the screen coordinate flag.

Parameters:
b   true if using screen coordinate to paint

void TxqViewPort::setXmax ( double val ) [pure virtual]
 

set the X maximum value of the plot region.

Parameters:
val   the value for the right edge of the plot.

Reimplemented in TxqLinLogViewPort, TxqLinViewPort, and TxqLogViewPort.

Referenced by Txq2dCanvas::setXmax().

void TxqViewPort::setXmin ( double val ) [pure virtual]
 

set the X minimum value of the plot region.

Parameters:
val   the value for the left edge of the plot.

Reimplemented in TxqLinLogViewPort, TxqLinViewPort, and TxqLogViewPort.

Referenced by Txq2dCanvas::setXmin().

void TxqViewPort::setYmax ( double val ) [pure virtual]
 

set the Y maximum value of the plot region.

Parameters:
val   the value for the top edge of the plot.

Reimplemented in TxqLinViewPort, TxqLogLinViewPort, and TxqLogViewPort.

Referenced by Txq2dCanvas::setYmax().

void TxqViewPort::setYmin ( double val ) [pure virtual]
 

set the Y minimum value of the plot region.

Parameters:
val   the value for the bottom edge of the plot.

Reimplemented in TxqLinViewPort, TxqLogLinViewPort, and TxqLogViewPort.

Referenced by Txq2dCanvas::setYmin().

int TxqViewPort::width ( ) [virtual]
 

Get the canvas width.

Returns:
the width of the canvas

short TxqViewPort::xToPixel ( double x ) [pure virtual]
 

Convert the x coordinate on the plot to a x pixel value.

Larger valued x pixels are to the right on the screen.

Returns:
the x pixel
Parameters:
x   the plot coordinate x

Reimplemented in TxqLinLogViewPort, TxqLinViewPort, and TxqLogViewPort.

Referenced by Txq2dDrawable::xToPixel(), and Txq2dCanvas::xToPixel().

QPoint TxqViewPort::xyToPixel ( double x,
double y ) [virtual]
 

Convert the x,y plot cordinates to a screen pixel point.

Returns:
the screen pixel point
Parameters:
x   the plot coordinate x
y   the plot coordinate y

Referenced by Txq2dDrawable::xyToPixel(), and Txq2dCanvas::xyToPixel().

short TxqViewPort::yToPixel ( double y ) [pure virtual]
 

Convert the y coordinate on the plot to a y pixel value.

Larger valued y pixels are lower on the screen.

Returns:
the y pixel
Parameters:
y   the plot coordinate y

Reimplemented in TxqLinViewPort, TxqLogLinViewPort, and TxqLogViewPort.

Referenced by Txq2dDrawable::yToPixel(), and Txq2dCanvas::yToPixel().


Member Data Documentation

QRect TxqViewPort::plotRect [protected]
 

The plot region rectangle.

Definition at line 294 of file TxqViewPort.h.

bool TxqViewPort::scFlag [protected]
 

the screen coordinate flag.

Definition at line 299 of file TxqViewPort.h.

double TxqViewPort::xmax [protected]
 

The x max value for the plot.

Definition at line 271 of file TxqViewPort.h.

double TxqViewPort::xmin [protected]
 

The x min value for the plot.

Definition at line 267 of file TxqViewPort.h.

int TxqViewPort::xwidth [protected]
 

The canvas width.

Definition at line 284 of file TxqViewPort.h.

int TxqViewPort::yheight [protected]
 

The canvas height.

Definition at line 289 of file TxqViewPort.h.

double TxqViewPort::ymax [protected]
 

The y max value for the plot.

Definition at line 279 of file TxqViewPort.h.

double TxqViewPort::ymin [protected]
 

The y min value for the plot.

Definition at line 275 of file TxqViewPort.h.


The documentation for this class was generated from the following file: Copyright Tech-X Corporation, all rights reserved.