Version: 6.3.1
Public Types | Public Member Functions | Protected Member Functions | Private Attributes

GLViewer_CoordSystem Class Reference

Class implementing mathematical model of 2D coordinate system. More...

#include <GLViewer_CoordSystem.h>

Public Types

enum  CSType { Cartesian, Polar }
 

A type of coordinate system.

More...

Public Member Functions

 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 )
void getOrigin (double &x, double &y) const
 Returns the origin in reference system.
void setOrigin (double x, double y)
 A function installing the origin in reference system.
void getUnits (double &x, double &y) const
 Returns units along axes.
void setUnits (double x, double y)
 A function installing units along axes.
double getRotation () const
 Returns rotation angle of axes in reference system.
void setRotation (double rotation)
 A function installing rotation angle of axes in reference system.
CSType getType () const
 Returns type of system.
void setType (CSType type)
 A function installing type of system.
void transform (GLViewer_CoordSystem &aSystem, double &x, double &y)
 Transform the coordinates x, y from current CS to aSystem.
virtual void getStretching (GLViewer_CoordSystem &aSystem, double &theX, double &theY)
 Return how many times line width in aSystem system bigger than in current.

Protected Member Functions

virtual void toReference (double &x, double &y)
 A function transforms system coords to coords in reference system.
virtual void fromReference (double &x, double &y)
 A function transforms from coords in reference system to system coords.

Private Attributes

double myX0
 The coordinates of origin in the reference CS.
double myY0
double myXUnit
 The lengths of axis units in the reference unit.
double myYUnit
double myRotation
 The rotation in radians relative to reference CS.
CSType myType
 In the polar CS myYUnit is ignored, but myXUnit is the unit of polar radius.

Detailed Description

Class GLViewer_CoordSystem Class implementing mathematical model of 2D coordinate system


Member Enumeration Documentation

Enumerator:
Cartesian 
Polar 

Constructor & Destructor Documentation

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


Member Function Documentation

void GLViewer_CoordSystem::getOrigin ( double &  x,
double &  y 
) const
Returns:
origin in reference CS

References myX0, and myY0.

void GLViewer_CoordSystem::setOrigin ( double  x,
double  y 
)

Sets origin in reference CS

References myX0, and myY0.

void GLViewer_CoordSystem::getUnits ( double &  x,
double &  y 
) const
Returns:
units

References myXUnit, and myYUnit.

void GLViewer_CoordSystem::setUnits ( double  x,
double  y 
)

Sets units

References myXUnit, and myYUnit.

double GLViewer_CoordSystem::getRotation ( ) const
Returns:
rotation

References myRotation.

void GLViewer_CoordSystem::setRotation ( double  rotation)

Sets rotation

References myRotation.

GLViewer_CoordSystem::CSType GLViewer_CoordSystem::getType ( ) const
Returns:
type

References myType.

void GLViewer_CoordSystem::setType ( CSType  type)

Sets type

References myType.

void GLViewer_CoordSystem::transform ( GLViewer_CoordSystem aSystem,
double &  x,
double &  y 
)

Recalculate co-ordinates to co-ordinates of other CS

Parameters:
aSystem- other CS
x,y- co-ordinates

References fromReference(), and toReference().

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.

void GLViewer_CoordSystem::toReference ( double &  x,
double &  y 
) [protected, virtual]

Recalculate co-ordinates to reference co-ordinates

Parameters:
x,y- co-ordinates

References Cartesian, myRotation, myType, myX0, myXUnit, myY0, myYUnit, and Polar.

void GLViewer_CoordSystem::fromReference ( double &  x,
double &  y 
) [protected, virtual]

Recalculate co-ordinates from reference co-ordinates

Parameters:
x,y- co-ordinates

References Cartesian, myRotation, myType, myX0, myXUnit, myY0, myYUnit, and Polar.


Field Documentation

double GLViewer_CoordSystem.myX0 [private]
double GLViewer_CoordSystem.myY0 [private]
double GLViewer_CoordSystem.myXUnit [private]
double GLViewer_CoordSystem.myYUnit [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS