Class implementing mathematical model of 2D coordinate system.
More...
#include <GLViewer_CoordSystem.h>
|
| GLViewer_CoordSystem (CSType aType, double X0=0.0, double Y0=0.0, double XUnit=1.0, double YUnit=1.0, double Rotation=0.0) |
| A constructor ( by default new system is identical to reference ) More...
|
|
void | getOrigin (double &x, double &y) const |
| Returns the origin in reference system. More...
|
|
void | setOrigin (double x, double y) |
| A function installing the origin in reference system. More...
|
|
void | getUnits (double &x, double &y) const |
| Returns units along axes. More...
|
|
void | setUnits (double x, double y) |
| A function installing units along axes. More...
|
|
double | getRotation () const |
| Returns rotation angle of axes in reference system. More...
|
|
void | setRotation (double rotation) |
| A function installing rotation angle of axes in reference system. More...
|
|
CSType | getType () const |
| Returns type of system. More...
|
|
void | setType (CSType type) |
| A function installing type of system. More...
|
|
void | transform (GLViewer_CoordSystem &aSystem, double &x, double &y) |
| Transform the coordinates x, y from current CS to aSystem. More...
|
|
virtual void | getStretching (GLViewer_CoordSystem &aSystem, double &theX, double &theY) |
| Return how many times line width in aSystem system bigger than in current. More...
|
|
|
virtual void | toReference (double &x, double &y) |
| A function transforms system coords to coords in reference system. More...
|
|
virtual void | fromReference (double &x, double &y) |
| A function transforms from coords in reference system to system coords. More...
|
|
Class GLViewer_CoordSystem Class implementing mathematical model of 2D coordinate system
Enumerator |
---|
Cartesian |
|
Polar |
|
GLViewer_CoordSystem::GLViewer_CoordSystem |
( |
CSType |
aType, |
|
|
double |
X0 = 0.0 , |
|
|
double |
Y0 = 0.0 , |
|
|
double |
XUnit = 1.0 , |
|
|
double |
YUnit = 1.0 , |
|
|
double |
Rotation = 0.0 |
|
) |
| |
Constructor
- Parameters
-
aType | - type of CS |
X0 | - X of origin in reference CS |
Y0 | - Y of origin in reference CS |
XUnit | - X unit in reference CS |
YUnit | - Y unit in reference CS |
Rotation | - rotation relative reference CS |
References setOrigin(), setRotation(), setType(), and setUnits().
void GLViewer_CoordSystem::fromReference |
( |
double & |
x, |
|
|
double & |
y |
|
) |
| |
|
protectedvirtual |
void GLViewer_CoordSystem::getOrigin |
( |
double & |
x, |
|
|
double & |
y |
|
) |
| const |
- Returns
- origin in reference CS
References myX0, and myY0.
double GLViewer_CoordSystem::getRotation |
( |
| ) |
const |
void GLViewer_CoordSystem::getStretching |
( |
GLViewer_CoordSystem & |
aSystem, |
|
|
double & |
theX, |
|
|
double & |
theY |
|
) |
| |
|
virtual |
- Returns
- stretching of CS along X and Y axis
References myXUnit, and myYUnit.
- Returns
- type
References myType.
void GLViewer_CoordSystem::getUnits |
( |
double & |
x, |
|
|
double & |
y |
|
) |
| const |
void GLViewer_CoordSystem::setOrigin |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Sets origin in reference CS
References myX0, and myY0.
void GLViewer_CoordSystem::setRotation |
( |
double |
rotation | ) |
|
void GLViewer_CoordSystem::setType |
( |
CSType |
type | ) |
|
void GLViewer_CoordSystem::setUnits |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
void GLViewer_CoordSystem::toReference |
( |
double & |
x, |
|
|
double & |
y |
|
) |
| |
|
protectedvirtual |
Recalculate co-ordinates to co-ordinates of other CS
- Parameters
-
aSystem | - other CS |
x,y | - co-ordinates |
References fromReference(), and toReference().
double GLViewer_CoordSystem::myRotation |
|
private |
CSType GLViewer_CoordSystem::myType |
|
private |
double GLViewer_CoordSystem::myX0 |
|
private |
double GLViewer_CoordSystem::myXUnit |
|
private |
double GLViewer_CoordSystem::myY0 |
|
private |
double GLViewer_CoordSystem::myYUnit |
|
private |
The documentation for this class was generated from the following files: