WXP C++ Library Version 6.74.9
|
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 | tranWindowNdcX (float x) |
float | tranWindowNdcY (float y) |
float | tranWindowPlotX (float x) |
float | tranWindowPlotY (float y) |
float | tranPlotNdcX (float x) |
float | tranPlotNdcY (float y) |
float | tranPlotWindowX (float x) |
float | tranPlotWindowY (float y) |
float | tranNdcPlotX (float x) |
float | tranNdcPlotY (float y) |
Rect | getClipRect () |
bool | isPointsInWindow (int num, Point *pts) |
bool | isPointsInWindow (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 | tranWindowX (GTran gtran1, GTran gtran2, float x) |
static float | tranWindowY (GTran gtran1, GTran gtran2, float y) |
This class creates device independent coordinate systems.
GTran::GTran | ( | ) |
Constructor. Initializes the class values
References set().
GTran::GTran | ( | Rect | rect | ) |
GTran::~GTran | ( | ) |
Destructor
Rect GTran::getClipRect | ( | ) |
Gets the current clip rectangle in device plot space
References tranNdcPlotX(), tranNdcPlotY(), WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
Rect GTran::getNdc | ( | ) |
Gets the normalized device coordinate extent
References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
int GTran::getNdc | ( | Rect & | rect | ) |
Gets the normalized device coordinate extent
rect | Rect class to put NDC extent |
References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
Referenced by WXP::Graph::getMaxViewport(), WXP::Graph::getMaxViewport(), and WXP::Graph::setViewportAspect().
Rect GTran::getViewport | ( | ) |
Gets the current viewport coordinates
References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
int GTran::getViewport | ( | Rect & | rect | ) |
Gets the current viewport coordinates
rect | Rect class to put viewport extent in NDC space |
References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
Referenced by WXP::Graph::getViewport(), and WXP::Graph::getViewport().
Rect GTran::getWindow | ( | ) |
Gets the current window/world coordinates
References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
int GTran::getWindow | ( | Rect & | rect | ) |
Gets the current window/world coordinates
rect | Rect class to put window extent |
References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
Referenced by WXP::Graph::getWindow(), WXP::Graph::getWindow(), and WXP::Graph::setFontSpec().
bool GTran::isPointsInWindow | ( | 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.
bool GTran::isPointsInWindow | ( | Points & | pts | ) |
Checks to see if all the values are within the current viewport
pts | Points class |
References WXP::Points::getNum(), WXP::Points::getX(), and WXP::Points::getY().
int GTran::resize | ( | Rect | rect | ) |
Resizes the translation space
rect | New space extent |
References WXP::Point::x, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Point::y, WXP::Rect::ymax, and WXP::Rect::ymin.
int GTran::set | ( | Rect | rect | ) |
Sets up the transformation
rect | Defines extent of space |
References WXP::Point::x, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Point::y, WXP::Rect::ymax, and WXP::Rect::ymin.
int GTran::setViewport | ( | Rect | rect | ) |
Sets the viewport coordinate extent in NDC space
rect | Rect clas with viewport extent |
References WXP::Point::x, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Point::y, WXP::Rect::ymax, and WXP::Rect::ymin.
Referenced by WXP::Graph::setViewport(), 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, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Point::y, WXP::Rect::ymax, and WXP::Rect::ymin.
Referenced by WXP::Graph::setWindow(), and WXP::Graph::setWindow().
float GTran::tranNdcPlotX | ( | 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::tranNdcPlotY | ( | 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::tranPlotNdcX | ( | float | x | ) |
Translates device plot coordinates to normalized coordinates for X
x | X coordinate to translate |
References WXP::Point::x.
Referenced by WXP::Graph::tranPlotView().
float GTran::tranPlotNdcY | ( | float | y | ) |
Translates device plot coordinates to normalized coordinates for Y
y | Y coordinate to translate |
References WXP::Point::y.
Referenced by WXP::Graph::tranPlotView().
float GTran::tranPlotWindowX | ( | 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::tranPlotWindowY | ( | 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().
float GTran::tranWindowNdcX | ( | float | x | ) |
Translates world coordinates to normalizes device coordinates for X
x | X coordinate to translate |
References WXP::Point::x.
float GTran::tranWindowNdcY | ( | float | y | ) |
Translates world coordinates to normalizes device coordinates for Y
y | Y coordinate to translate |
References WXP::Point::y.
float GTran::tranWindowPlotX | ( | float | x | ) |
Translates world coordinates to device plot coordinates for X
x | X coordinate to translate |
References WXP::Point::x.
Referenced by WXP::Graph::clearRect(), WXP::Graph::drawImage(), WXP::Graph::drawImage(), WXP::Graph::drawMark(), WXP::Graph::drawText(), and WXP::Graph::tranWindow().
float GTran::tranWindowPlotY | ( | float | y | ) |
Translates world coordinates to device plot coordinates for Y
y | Y coordinate to translate |
References WXP::Point::y.
Referenced by WXP::Graph::clearRect(), WXP::Graph::drawFill(), WXP::Graph::drawFill(), WXP::Graph::drawImage(), WXP::Graph::drawImage(), WXP::Graph::drawLine(), 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 |