NCL Website header
NCL Home > Documentation > HLUs > Classes

Transformation class

The Transformation classes manage forward and reverse transformations for the Transform classes.


Header file:		ncarg/hlu/Transformation.h
Class name:		transformationClass
Class pointer:		<Not referenceable>
Fortran class function:	<Not referenceable>
Superclass:		Obj
Composite classes:	<None>

Class-defined types

Type name:              NhlTGridType
typedef enum _NhlGridType {
	NhltrMAP               = 0      /* "Map" */
        NhltrLOGLIN            = 1,     /* "LogLin" */
        NhltrIRREGULAR         = 2,     /* "Irregular"   */
	NhltrCURVILINEAR       = 3,     /* "Curvilinear" */
	NhltrSPHERICAL         = 4,     /* "Spherical" */
        NhltrTRIANGULARMESH    = 5      /* "TriangularMesh" */
} NhlGridType;


Local resources

|		Transformation Resource Set			|
| trXMinF                       NhlTFloat               RCSG    |
|       TrXMinF                         0.0                     |
| trXMaxF                       NhlTFloat               RCSG    |
|       TrXMaxF                         1.0                     |
| trXReverse                    NhlTBoolean             RCSG    |
|       TrXReverse                      False                   |
| trYMinF                       NhlTFloat               RCSG    |
|       TrYMinF                         0.0                     |
| trYMaxF                       NhlTFloat               RCSG    |
|       TrYMaxF                         1.0                     |
| trYReverse                    NhlTBoolean             RCSG    |
|       TrYReverse                      False                   |
| trGridType                    NhlTGridType            RCSG    |
|       TrGridType                      False                   |
| trLineInterpolationOn         NhlTBoolean             RCSG    |
|       TrLineInterpolationOn           False                   |

Composite resources

The Transformation object class has no composite class resources.

Superclass resources

The superclass of the Transformation object class does not define any resources.


Transformation class objects perform forward and reverse transformations between data and NDC space for objects belonging to Transform class. You do not instantiate any of these objects directly. Rather, Transform class objects (plot objects) create them as needed, and provide controlled access to their resources.

The Transformation class is never itself instantiated. However, it does provide some basic resources that its subclasses may use to specify the extent and direction of the data space. Currently there are five subclasses of the Transformation class:

  • The LogLinTransformation provides transformations to and from a linear or logarithmic coordinate space. Either or both coordinate axes may be logarithmic.
  • The IrregularTransformation provides transformations to and from rectangular coordinate spaces where each coordinate axis may be either irregularly spaced, linear, or logarithmic.
  • The CurvilinearTransformation provides transformations to and from topologically rectangular grids described using 2D coordinate arrays.
  • The SphericalTransformation provides transformations to and from topologically rectangular grids defined on the surface of a sphere using 2D coordinate arrays.
  • The TriangularMeshTransformation provides transformations for a triangular mesh of point data nodes. The triangular mesh can theoretically be created from any type of input grid including rectangular arrays or simply a random array of points. Currently, if the mesh is not pre-defined, only node sets without significant concavities in the boundary are handled reasonably.
  • The MapTransformation provides transformations to and from any of 11 different standard map projections. It disables access to all the basic Transformation class resources, since it requires more specialized resources for defining extent and direction adequately.
In most cases the plot object decides which Transformation sub-class to use based on its intrinsic requirements or on information provided by the data object. However, when data is supplied with 2D coordinate grids, there is no clear way for a plot object to decide between the possible transformations. In this case, the user can specify a preference using the trGridType resource.

Support functions

There are no special support functions defined for the Transformation class or its superclass.

Status notes

1. When line interpolation is turned on, the quality of the interpolation into data space is not always very good, particularly for log plots.

See also