WXP::GTran Class Reference

This class creates device independent coordinate systems. More...

#include "../include/GTran.h"

List of all members.

Public Member Functions

 GTran ()
 GTran (Rect rect)
 ~GTran ()
int set (Rect rect)
int resize (Rect rect)
float windowNdcX (float x)
float windowNdcY (float y)
float windowPlotX (float x)
float windowPlotY (float y)
float plotWindowX (float x)
float plotWindowY (float y)
float ndcPlotX (float x)
float ndcPlotY (float y)
Rect getClipRect ()
bool pointsInWindow (int num, Point *pts)
bool pointsInWindow (Points &pts)
int getWindow (Rect &rect)
Rect getWindow ()
int getViewport (Rect &rect)
Rect getViewport ()
int getNdc (Rect &rect)
Rect getNdc ()
int setWindow (Rect rect)
int setViewport (Rect rect)
int print ()

Static Public Member Functions

static float windowTranslateX (GTran gtran1, GTran gtran2, float x)
static float windowTranslateY (GTran gtran1, GTran gtran2, float x)

Detailed Description

This class creates device independent coordinate systems.

Author:
Dan Vietor

Constructor & Destructor Documentation

GTran::GTran (  ) 

Constructor. Initializes the class values

GTran::GTran ( Rect  rect  ) 

Constructor. Sets extent of space

Parameters:
rect Rect class defining extent
GTran::~GTran (  ) 

Destructor


Member Function Documentation

Rect GTran::getClipRect (  ) 

Gets the current clip rectangle in device plot space

Returns:
Rect class with clip rectangle values

References ndcPlotX(), and ndcPlotY().

Rect GTran::getNdc (  ) 

Gets the normalized device coordinate extent

Returns:
Rect class with NDC extent
int GTran::getNdc ( Rect rect  ) 

Gets the normalized device coordinate extent

Return values:
rect Rect class to put NDC extent

Referenced by WXP::Graph::setViewportAspect().

Rect GTran::getViewport (  ) 

Gets the current viewport coordinates

Returns:
Rect class with viewport extent in NDC space
int GTran::getViewport ( Rect rect  ) 

Gets the current viewport coordinates

Return values:
rect Rect class to put viewport extent in NDC space

Referenced by WXP::Graph::getViewport().

Rect GTran::getWindow (  ) 

Gets the current window/world coordinates

Returns:
Rect class with window extent
int GTran::getWindow ( Rect rect  ) 

Gets the current window/world coordinates

Return values:
rect Rect class to put window extent

Referenced by WXP::Graph::getWindow(), and WXP::Graph::setFontSpec().

float GTran::ndcPlotX ( float  x  ) 

Translates normalized device coordinates to device plot coordinates for X

Parameters:
x X coordinate to translate
Returns:
X in plot space

References WXP::Point::x.

Referenced by getClipRect().

float GTran::ndcPlotY ( float  y  ) 

Translates normalized device coordinates to device plot coordinates for Y

Parameters:
y Y coordinate to translate
Returns:
Y in plot space

References WXP::Point::y.

Referenced by getClipRect().

float GTran::plotWindowX ( float  x  ) 

Translates device plot coordinates to world coordinates for X

Parameters:
x X coordinate to translate
Returns:
X in world space

References WXP::Point::x.

Referenced by WXP::Graph::tranPlotWindow(), and WXP::Graph::tranWindow().

float GTran::plotWindowY ( float  y  ) 

Translates device plot coordinates to world coordinates for Y

Parameters:
y Y coordinate to translate
Returns:
Y in world space

References WXP::Point::y.

Referenced by WXP::Graph::tranPlotWindow(), and WXP::Graph::tranWindow().

bool GTran::pointsInWindow ( Points pts  ) 

Checks to see if all the values are within the current viewport

Parameters:
pts Points class
Returns:
true if all points within viewport

References WXP::Points::getNum().

bool GTran::pointsInWindow ( int  num,
Point pts 
)

Checks to see if all the values are within the current viewport

Parameters:
num_pt Number of points in the array
pts Point array
Returns:
true if all points within viewport

References WXP::Point::x, and WXP::Point::y.

int GTran::resize ( Rect  rect  ) 

Resizes the translation space

Parameters:
rect New space extent

References WXP::Point::x, and WXP::Point::y.

int GTran::set ( Rect  rect  ) 

Sets up the transformation

Parameters:
rect Defines extent of space

References WXP::Point::x, and WXP::Point::y.

int GTran::setViewport ( Rect  rect  ) 

Sets the viewport coordinate extent in NDC space

Parameters:
rect Rect clas with viewport extent

References WXP::Point::x, and WXP::Point::y.

Referenced by WXP::Graph::setViewport(), and WXP::Graph::setViewportAspect().

int GTran::setWindow ( Rect  rect  ) 

Sets the window coordinate extent

Parameters:
rect Rect class with window extent

References WXP::Point::x, and WXP::Point::y.

Referenced by WXP::Graph::setWindow().

float GTran::windowNdcX ( float  x  ) 

Translates world coordinates to normalizes device coordinates for X

Parameters:
x X coordinate to translate
Returns:
X in NDC space

References WXP::Point::x.

float GTran::windowNdcY ( float  y  ) 

Translates world coordinates to normalizes device coordinates for Y

Parameters:
y Y coordinate to translate
Returns:
Y in NDC space

References WXP::Point::y.

float GTran::windowPlotX ( float  x  ) 

Translates world coordinates to device plot coordinates for X

Parameters:
x X coordinate to translate
Returns:
X in device plot space

References WXP::Point::x.

Referenced by WXP::Graph::drawImage(), WXP::Graph::drawMark(), WXP::Graph::drawText(), and WXP::Graph::tranWindow().

float GTran::windowPlotY ( float  y  ) 

Translates world coordinates to device plot coordinates for Y

Parameters:
y Y coordinate to translate
Returns:
Y in device plot space

References WXP::Point::y.

Referenced by WXP::Graph::drawImage(), WXP::Graph::drawMark(), WXP::Graph::drawText(), and WXP::Graph::tranWindow().

float GTran::windowTranslateX ( GTran  gtran1,
GTran  gtran2,
float  x 
) [static]

Translates between two translation spaces in X

Parameters:
gtran1 Input translation space
gtran2 Output translation space
x X world coordinate to translate
Returns:
X in world space for new translation
float GTran::windowTranslateY ( GTran  gtran1,
GTran  gtran2,
float  y 
) [static]

Translates between two translation spaces in Y

Parameters:
gtran1 Input translation space
gtran2 Output translation space
y Y world coordinate to translate
Returns:
Y in world space for new translation

The documentation for this class was generated from the following files:

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1