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

Txq2dDrawable Class Reference

The Txq2dDrawable is a derived class for all canvas drawables. More...

#include <Txq2dDrawable.h>

Inheritance diagram for Txq2dDrawable::

TxqDrawable Txq2dAxis Txq2dLabel Txq2dLineArray Txq2dPoint Txq2dSeg TxqAttribDrawable Txq2dPointArray Txq2dPoints Txq2dLineSeg Txq2dSegmented Txq2dLine Txq2dVector Txq2dOutlined Txq2dPolygon Txq2dPolygonArray List of all members.

Public Methods

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

virtual ~Txq2dDrawable ()
 The destructor does nothing. More...

void update (QPainter *g)
 Update will repaint this Txq2dDrawable object. More...

virtual void paint (QPainter *g)=0
 The paint method must be implemented for each drawable, so it is abstract here. More...

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

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

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

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

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

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

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

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

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

void setViewPort (TxqViewPort *viewPort)
 Set the viewport in order to obtain bounds methods. More...


Protected Attributes

TxqViewPortview
 The Viewport. More...


Detailed Description

The Txq2dDrawable is a derived class for all canvas drawables.

A canvas drawable is an object that can have a color value and knows how to paint itself given a QPainter device.

Copyright 2000 by Tech-X Corporation

Author:
Kelly G. Luetkemeyer

Version:
Id:
Txq2dDrawable.h,v 1.4 2001/10/10 22:41:05 kgl Exp

Definition at line 43 of file Txq2dDrawable.h.


Constructor & Destructor Documentation

Txq2dDrawable::Txq2dDrawable ( )
 

The constructor is default.

Txq2dDrawable::~Txq2dDrawable ( ) [virtual]
 

The destructor does nothing.


Member Function Documentation

double Txq2dDrawable::getXmax ( ) [inline]
 

Get the X maximum value of the plot region.

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

Definition at line 81 of file Txq2dDrawable.h.

double Txq2dDrawable::getXmin ( ) [inline]
 

Get the X minimum value of the plot region.

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

Definition at line 75 of file Txq2dDrawable.h.

double Txq2dDrawable::getYmax ( ) [inline]
 

Get the Y maximum value of the plot region.

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

Definition at line 94 of file Txq2dDrawable.h.

double Txq2dDrawable::getYmin ( ) [inline]
 

Get the Y minimum value of the plot region.

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

Definition at line 88 of file Txq2dDrawable.h.

void Txq2dDrawable::paint ( QPainter * g ) [pure virtual]
 

The paint method must be implemented for each drawable, so it is abstract here.

Parameters:
g   the paint device to use to paint upon.

Reimplemented in Txq2dAxis, Txq2dLabel, Txq2dLine, Txq2dLineArray, Txq2dLineSeg, Txq2dPoint, Txq2dPointArray, Txq2dPoints, Txq2dPolygon, Txq2dPolygonArray, Txq2dSeg, Txq2dSegmented, Txq2dVector, and TxqAttribDrawable.

Referenced by update().

double Txq2dDrawable::pixelToX ( const QPoint & p ) [inline]
 

Convert the pixel to the plot x value.

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

Definition at line 101 of file Txq2dDrawable.h.

double Txq2dDrawable::pixelToY ( const QPoint & p ) [inline]
 

Convert the pixel to the plot y value.

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

Definition at line 108 of file Txq2dDrawable.h.

void Txq2dDrawable::setViewPort ( TxqViewPort * viewPort ) [inline]
 

Set the viewport in order to obtain bounds methods.

The bounds are the real-world cordinates of the Txq2dCanvas

Parameters:
viewPort   the viewport pointer to set

Definition at line 143 of file Txq2dDrawable.h.

void Txq2dDrawable::update ( QPainter * g ) [inline]
 

Update will repaint this Txq2dDrawable object.

Parameters:
g   the paint device to use to paint upon.

Definition at line 62 of file Txq2dDrawable.h.

short Txq2dDrawable::xToPixel ( double x ) [inline]
 

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

Definition at line 126 of file Txq2dDrawable.h.

QPoint Txq2dDrawable::xyToPixel ( double x,
double y ) [inline]
 

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

Definition at line 117 of file Txq2dDrawable.h.

short Txq2dDrawable::yToPixel ( double y ) [inline]
 

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

Definition at line 135 of file Txq2dDrawable.h.


Member Data Documentation

TxqViewPort * Txq2dDrawable::view [protected]
 

The Viewport.

Definition at line 151 of file Txq2dDrawable.h.


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