This class creates device independent coordinate systems. More...
#include "../include/GTran.h"
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) |
This class creates device independent coordinate systems.
| GTran::GTran | ( | ) |
Constructor. Initializes the class values
| GTran::GTran | ( | Rect | rect | ) |
Constructor. Sets extent of space
| rect | Rect class defining extent |
| GTran::~GTran | ( | ) |
Destructor
| Rect GTran::getClipRect | ( | ) |
Gets the current clip rectangle in device plot space
References ndcPlotX(), and ndcPlotY().
| Rect GTran::getNdc | ( | ) |
Gets the normalized device coordinate extent
| int GTran::getNdc | ( | Rect & | rect | ) |
Gets the normalized device coordinate extent
| rect | Rect class to put NDC extent |
Referenced by WXP::Graph::setViewportAspect().
| Rect GTran::getViewport | ( | ) |
Gets the current viewport coordinates
| int GTran::getViewport | ( | Rect & | rect | ) |
Gets the current viewport coordinates
| rect | Rect class to put viewport extent in NDC space |
Referenced by WXP::Graph::getViewport().
| Rect GTran::getWindow | ( | ) |
Gets the current window/world coordinates
| int GTran::getWindow | ( | Rect & | rect | ) |
Gets the current window/world coordinates
| 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
| x | X coordinate to translate |
References WXP::Point::x.
Referenced by getClipRect().
| float GTran::ndcPlotY | ( | float | y | ) |
Translates normalized device coordinates to device plot coordinates for Y
| y | Y coordinate to translate |
References WXP::Point::y.
Referenced by getClipRect().
| float GTran::plotWindowX | ( | float | x | ) |
Translates device plot coordinates to world coordinates for X
| x | X coordinate to translate |
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
| y | Y coordinate to translate |
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
| pts | Points class |
References WXP::Points::getNum().
| bool GTran::pointsInWindow | ( | int | num, | |
| Point * | pts | |||
| ) |
Checks to see if all the values are within the current viewport
| num_pt | Number of points in the array | |
| pts | Point array |
References WXP::Point::x, and WXP::Point::y.
| int GTran::resize | ( | Rect | rect | ) |
Resizes the translation space
| rect | New space extent |
References WXP::Point::x, and WXP::Point::y.
| int GTran::set | ( | Rect | rect | ) |
Sets up the transformation
| 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
| 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
| 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
| x | X coordinate to translate |
References WXP::Point::x.
| float GTran::windowNdcY | ( | float | y | ) |
Translates world coordinates to normalizes device coordinates for Y
| y | Y coordinate to translate |
References WXP::Point::y.
| float GTran::windowPlotX | ( | float | x | ) |
Translates world coordinates to device plot coordinates for X
| x | X coordinate to translate |
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
| y | Y coordinate to translate |
References WXP::Point::y.
Referenced by WXP::Graph::drawImage(), WXP::Graph::drawMark(), WXP::Graph::drawText(), and WXP::Graph::tranWindow().
Translates between two translation spaces in X
| gtran1 | Input translation space | |
| gtran2 | Output translation space | |
| x | X world coordinate to translate |
Translates between two translation spaces in Y
| gtran1 | Input translation space | |
| gtran2 | Output translation space | |
| y | Y world coordinate to translate |
1.6.1