WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
WXP::GTran Class Reference

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)
 

Detailed Description

This class creates device independent coordinate systems.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ GTran() [1/2]

GTran::GTran ( )

Constructor. Initializes the class values

References set().

◆ GTran() [2/2]

GTran::GTran ( Rect  rect)

Constructor. Sets extent of space

Parameters
rectRect class defining extent

References set().

◆ ~GTran()

GTran::~GTran ( )

Destructor

Member Function Documentation

◆ getClipRect()

Rect GTran::getClipRect ( )

Gets the current clip rectangle in device plot space

Returns
Rect class with clip rectangle values

References tranNdcPlotX(), tranNdcPlotY(), WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.

◆ getNdc() [1/2]

Rect GTran::getNdc ( )

Gets the normalized device coordinate extent

Returns
Rect class with NDC extent

References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.

◆ getNdc() [2/2]

int GTran::getNdc ( Rect rect)

Gets the normalized device coordinate extent

Return values
rectRect 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().

◆ getViewport() [1/2]

Rect GTran::getViewport ( )

Gets the current viewport coordinates

Returns
Rect class with viewport extent in NDC space

References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.

◆ getViewport() [2/2]

int GTran::getViewport ( Rect rect)

Gets the current viewport coordinates

Return values
rectRect 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().

◆ getWindow() [1/2]

Rect GTran::getWindow ( )

Gets the current window/world coordinates

Returns
Rect class with window extent

References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.

◆ getWindow() [2/2]

int GTran::getWindow ( Rect rect)

Gets the current window/world coordinates

Return values
rectRect 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().

◆ isPointsInWindow() [1/2]

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

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

Parameters
num_ptNumber of points in the array
ptsPoint array
Returns
true if all points within viewport

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

◆ isPointsInWindow() [2/2]

bool GTran::isPointsInWindow ( Points pts)

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

Parameters
ptsPoints class
Returns
true if all points within viewport

References WXP::Points::getNum(), WXP::Points::getX(), and WXP::Points::getY().

◆ resize()

int GTran::resize ( Rect  rect)

Resizes the translation space

Parameters
rectNew space extent

References WXP::Point::x, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Point::y, WXP::Rect::ymax, and WXP::Rect::ymin.

◆ set()

int GTran::set ( Rect  rect)

Sets up the transformation

Parameters
rectDefines extent of space

References WXP::Point::x, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Point::y, WXP::Rect::ymax, and WXP::Rect::ymin.

Referenced by GTran(), and GTran().

◆ setViewport()

int GTran::setViewport ( Rect  rect)

Sets the viewport coordinate extent in NDC space

Parameters
rectRect 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().

◆ setWindow()

int GTran::setWindow ( Rect  rect)

Sets the window coordinate extent

Parameters
rectRect 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().

◆ tranNdcPlotX()

float GTran::tranNdcPlotX ( float  x)

Translates normalized device coordinates to device plot coordinates for X

Parameters
xX coordinate to translate
Returns
X in plot space

References WXP::Point::x.

Referenced by getClipRect().

◆ tranNdcPlotY()

float GTran::tranNdcPlotY ( float  y)

Translates normalized device coordinates to device plot coordinates for Y

Parameters
yY coordinate to translate
Returns
Y in plot space

References WXP::Point::y.

Referenced by getClipRect().

◆ tranPlotNdcX()

float GTran::tranPlotNdcX ( float  x)

Translates device plot coordinates to normalized coordinates for X

Parameters
xX coordinate to translate
Returns
X in NDC space

References WXP::Point::x.

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

◆ tranPlotNdcY()

float GTran::tranPlotNdcY ( float  y)

Translates device plot coordinates to normalized coordinates for Y

Parameters
yY coordinate to translate
Returns
Y in NDC space

References WXP::Point::y.

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

◆ tranPlotWindowX()

float GTran::tranPlotWindowX ( float  x)

Translates device plot coordinates to world coordinates for X

Parameters
xX coordinate to translate
Returns
X in world space

References WXP::Point::x.

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

◆ tranPlotWindowY()

float GTran::tranPlotWindowY ( float  y)

Translates device plot coordinates to world coordinates for Y

Parameters
yY coordinate to translate
Returns
Y in world space

References WXP::Point::y.

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

◆ tranWindowNdcX()

float GTran::tranWindowNdcX ( float  x)

Translates world coordinates to normalizes device coordinates for X

Parameters
xX coordinate to translate
Returns
X in NDC space

References WXP::Point::x.

◆ tranWindowNdcY()

float GTran::tranWindowNdcY ( float  y)

Translates world coordinates to normalizes device coordinates for Y

Parameters
yY coordinate to translate
Returns
Y in NDC space

References WXP::Point::y.

◆ tranWindowPlotX()

float GTran::tranWindowPlotX ( float  x)

Translates world coordinates to device plot coordinates for X

Parameters
xX coordinate to translate
Returns
X in device plot space

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().

◆ tranWindowPlotY()

float GTran::tranWindowPlotY ( float  y)

Translates world coordinates to device plot coordinates for Y

Parameters
yY coordinate to translate
Returns
Y in device plot space

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().

◆ tranWindowX()

float GTran::tranWindowX ( GTran  gtran1,
GTran  gtran2,
float  x 
)
static

Translates between two translation spaces in X

Parameters
gtran1Input translation space
gtran2Output translation space
xX world coordinate to translate
Returns
X in world space for new translation

◆ tranWindowY()

float GTran::tranWindowY ( GTran  gtran1,
GTran  gtran2,
float  y 
)
static

Translates between two translation spaces in Y

Parameters
gtran1Input translation space
gtran2Output translation space
yY world coordinate to translate
Returns
Y in world space for new translation

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