IDLgrSurface

A surface object represents a shaded or vector representation of a mesh grid.

An IDLgrSurface object is an atomic graphic object ; it is one of the basic drawable elements of the IDL Object Graphics system, and it is not a container for other objects.

Superclasses

This class has no superclasses.

Subclasses

This class has no subclasses.

Creation

See IDLgrSurface::Init

Methods

Intrinsic Methods

This class has the following methods:


IDLgrSurface::Cleanup

The IDLgrSurface:: Cleanup procedure method performs all cleanup on the object. IDLgrSurface is described above.

Calling Sequence

OBJ_DESTROY, Obj

or

Obj -> [IDLgrSurface::] Cleanup                               ( In a subclass' Cleanup method only .)

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrSurface::GetCTM

The IDLgrSurface:: GetCTM function method returns the 4 x 4 graphics transform matrix from the current object upward through the graphics tree. IDLgrSurface is described above.

Calling Sequence

Result = Obj -> [IDLgrSurface::] GetCTM()

Arguments

There are no arguments for this method.

Keywords

DESTINATION

Set this keyword to the object reference of a destination object to specify that the projection matrix for the View object in the current tree be included in the returned transformation matrix. The resulting matrix will transform a point in the data space of the object on which the GetCTM method is called into a normalized coordinate system (-1 to +1 in X, Y, and Z), relative to the View object that contains the surface object.

TOP

Set this keyword equal to the object reference to an IDLgrModel object to specify that the returned matrix accumulate from the object on which the GetCTM method is called up to and including the specified model object.


IDLgrSurface::GetProperty

The IDLgrSurface:: GetProperty procedure method retrieves the value of a property or group of properties for the surface. IDLgrSurface is described above.

Calling Sequence

Obj -> [IDLgrSurface::] GetProperty

Arguments

There are no arguments for this method.

Keywords

Any keyword to IDLgrSurface::Init

ALL

Set this keyword to a named variable that will contain an anonymous structure containing the values of all of the properties associated with the state of this object. State information about the object includes things like color, range, tick direction, etc., but not image, vertex, or connectivity data, or user values.

DATA

Set this keyword to retrieve the surface data.

PARENT

Set this keyword equal to a named variable that will contain an object reference to the object that contains this object.

XRANGE

Set this keyword equal to a named variable that will contain a two-element vector of the form [ xmin , xmax ] that specifies the range of x data coordinates covered by the graphic object.

YRANGE

Set this keyword equal to a named variable that will contain a two-element vector of the form [ ymin , ymax ] that specifies the range of y data coordinates covered by the graphic object.

ZRANGE

Set this keyword equal to a named variable that will contain a two-element vector of the form [ zmin , zmax ] that specifies the range of z data coordinates covered by the graphic object.


IDLgrSurface::Init

The IDLgrSurface:: Init function method initializes the surface object. IDLgrSurface is described above.

Calling Sequence

Obj = OBJ_NEW('IDLgrSurface' [, Z [ , X , Y]] )

or

Result = Obj -> [IDLgrSurface::] Init( [Z, [X, Y]] )         ( In a subclass' Init method only .)

Arguments

Z

The two-dimensional array to be displayed. If X and Y are provided, the surface is defined as a function the ( X , Y ) locations specified by their contents. Otherwise, the surface is generated as a function of the array indices of each element of Z . This argument is converted to single-precision floating-point.

X

A vector or two-dimensional array specifying the X coordinates of the grid. If this argument is a vector, each element of X specifies the X coordinate for a column of Z (e.g., X [0] specifies the X coordinate for Z [0,*]). If X is a two-dimensional array, each element of X specifies the X coordinate of the corresponding point in Z ( X ij specifies the X coordinate for Z ij ). This argument is converted to single-precision floating-point.

Y

A vector or two-dimensional array specifying the Y coordinates of the grid. If this argument is a vector, each element of Y specifies the Y coordinate for a row of Z (e.g., Y (0) specifies the Y coordinate for Z [*,0]). If Y is a two-dimensional array, each element of Y specifies the Y coordinate of the corresponding point in Z ( Y ij specifies the Y coordinate for Z ij ). This argument is converted to single-precision floating-point.

Keywords

Properties retrievable via IDLgrSurface::GetProperty

BOTTOM (Get, Set)

The color value used to draw the bottom surface. If not specified, or set to a negative scalar value, the bottom is drawn with the same color as the top. Setting a bottom color is only supported when the destination device uses RGB color mode.

COLOR (Get, Set)

Set this keyword to the color to be used as the foreground color for this model. The color may be specified as a color lookup table index or as an RGB vector. The default is [255, 255, 255].

DATAX (Set)

Set this keyword to a vector or a two-dimensional array specifying the X coordinates of the surface grid. This keyword is the same as the X argument described above.

DATAY (Set)

Set this keyword to a vector or a two-dimensional array specifying the Ycoordinates of the surface grid. This keyword is the same as the Y argument described above.

DATAZ (Set)

Set this keyword to the two-dimensional array to display as a surface. This keyword is the same as the Z argument described above.

HIDDEN_LINES (Get, Set)

Set this keyword to draw point and wireframe surfaces using hidden line (point) removal. By default, hidden line removal is disabled.

HIDE (Get, Set)

Set this keyword to a boolean value indicating whether this object should be drawn:

LINESTYLE (Get, Set)

Set this keyword to indicate the line style that should be used to draw the surface lines. The value can be either an integer value specifying a pre-defined line style, or a two-element vector specifying a stippling pattern.

To use a pre-defined line style, set the LINESTYLE property equal to one of the following integer values:

To define your own stippling pattern, specify a two-element vector [ repeat , bitmask ], where repeat indicates the number of times consecutive runs of 1's or 0's in the bitmask should be repeated. (That is, if three consecutive 0's appear in the bitmask and the value of repeat is 2, then the line that is drawn will have six consecutive bits turned off.) The value of repeat must be in the range 1  £   repeat   £  255.

The bitmask indicates which pixels are drawn and which are not along the length of the line. Bitmask is most conveniently specified as a 16-bit hexadecimal value.

For example, LINESTYLE = [2, 'F0F0'X] describes a dashed line (8 bits on, 8 bits off, 8 bits on, 8 bits off).

MAX_VALUE (Get, Set)

The maximum value to be plotted. If this keyword is present, data values greater than the value of MAX_VALUE are treated as missing and are not plotted when the surface is drawn. Note that the IEEE floating-point value NaN is also treated as missing data.

MIN_VALUE (Get, Set)

The minimum value to be plotted. If this keyword is present, data values less than the value of MIN_VALUE are treated as missing and are not plotted. Note that the IEEE floating-point value NaN is also treated as missing data.

NAME (Get, Set)

Set this keyword equal to a string containing the name associated with this object. The default is the null string, ' '.

RESET_DATA (Set)

Set this keyword to treat the data provided via one of the DATA[XYZ] properties as a new data set unique to this object, rather than overwriting data that is shared by other objects. There is no reason to use this keyword if the object on which the property is being set does not currently share data with another object (that is, if the SHARE_DATA property is not in use). This keyword has no effect if no new data is provided via a DATA property.

SHADE_RANGE (Get, Set)

Set this keyword to a two-element array that specifies the range of pixel values (color indices) to use for shading. The first element is the color index for the darkest pixel. The second element is the color element for the brightest pixel. This value is ignored when the polygons are drawn to a graphics destination that uses the RGB color model.

SHADING (Get, Set)

Set this keyword to an integer representing the type of shading to use if STYLE is set to 2 (Filled) or 6 (LegoFilled).

Gouraud shading may be slower than flat shading, but results in a smoother appearance.

SHARE_DATA (Set)

Set this keyword to an object whose data is to be shared by this surface. A surface may only share data with another surface. The SHARE_DATA property is intended for use when data values are not set via an argument to the object's Init method or by setting the object's DATA property.

SHOW_SKIRT (Get, Set)

Set this keyword to enable skirt drawing. The default is to disable skirt drawing.

SKIRT (Get, Set)

Set this keyword to the Z value at which a skirt is to be defined around the array. The Z value is expressed in data units; the default is 0.0. If a skirt is defined, each point on the four edges of the surface is connected to a point on the skirt which has the given Z value, and the same X and Y values as the edge point. In addition, each point on the skirt is connected to its neighbor. The skirt value is ignored if skirt drawing is disabled (see SHOW_SKIRT above).

STYLE (Get, Set)

Set this keyword to and integer value that indicates the style to be used to draw the surface. Valid values are:

TEXTURE_COORD (Get, Set)

A 2 x n array of surface coordinate-texturemap coordinate pairs [ s , t ] at each vertex., containing the fill pattern array subscripts of each of the n polygon vertices. Use this keyword in conjunction with the TEXTURE_MAP keyword to warp images over the surface. To stretch (or shrink) the texture map to cover the surface mesh completely, set TEXTURE_COORD to a scalar. By default, TEXTURE_COORD is set equal to [0.0, 0.0] to [1.0, 1.0] over the surface bounds.

Texture coordinates are normalized. This means that the m x n image object specified via the TEXTURE_MAP property is mapped into the range [0.0, 0.0] to [1.0, 1.0]. If texture coordinates outside the range [0.0, 0.0] to [1.0, 1.0] are specified, the image object is tiled into the larger range.

For example, suppose the image object specified via TEXTURE_MAP is a 256 x 256 array, and we want to map the image into a square two units on each side. To completely fill the square with a single copy of the image:

TEXTURE_COORD = [[0,0], [1,0], [1,1], [0,1]]

To fill the square with four tiled copies of the image:

TEXTURE_COORD = [[0,0], [2,0], [2,2], [0,2]]

TEXTURE_INTERP (Get, Set)

Set this keyword to a nonzero value to indicate that bilinear sampling is to be used with texture mapping. The default method is nearest-neighbor sampling.

TEXTURE_MAP (Get, Set)

Set this keyword to an instance of the IDLgrImage object class to be texture mapped onto the surface. If this keyword is omitted or set to a null object reference, no texture map is applied and the surface is filled with the color specified by the COLOR or VERT_COLORS property. If both TEXTURE_MAP and COLORS or VERT_COLORS properties exist, the color of the texture is modulated by the base color of the object. (This means that for the clearest display of the texture image, the COLOR property should be set equal to [255,255,255].) By default, the texture map will be stretched (or shrunk) to cover the surface mesh completely.

THICK (Get, Set)

Set this keyword to an integer value between 1 and 10, specifying the line thickness to use to draw surface lines, in pixels. The default is one pixel.

UVALUE (Get, Set)

Set this keyword to a value of any type. You can use this "user value" to contain any information you wish. Remember that if you set the user value equal to a pointer or object reference, you should destroy the pointer or object reference explicitly when destroying the object it is a user value of.

VERT_COLORS (Get, Set)

Set this keyword to a vector of colors to be used to draw at each vertex. Color is interpolated between vertices if SHADING is set to 1 (Gouraud). If there are more vertices than elements in VERT_COLORS, the elements of VERT_COLORS are cyclically repeated. By default, the polygons are all drawn in the single color provided by the COLOR keyword. If this keyword is omitted or set to a scalar, vertex colors are removed and the surface is drawn in the color specified by the COLOR keyword.

XCOORD_CONV (Get, Set)

Set this keyword to a vector, [ s 0 , s 1 ], of scaling factors used to convert X coordinates from data units to normalized units. The formula for the conversion is as follows:

Normalized X = s 0 + s 1 * Data X

Recommended values are:

[(- X min )/( X max - X min ), 1/( X max - X min )]

The default is [0.0, 1.0].

YCOORD_CONV (Get, Set)

Set this keyword to a vector, [ s 0 , s 1 ], of scaling factors used to convert Y coordinates from data units to normalized units. The formula for the conversion is as follows:

Normalized Y = s 0 + s 1 * Data Y

Recommended values are:

[(- Y min )/( Y max - Y min ), 1/( Y max - Y min )]

The default is [0.0, 1.0].

ZCOORD_CONV (Get, Set)

Set this keyword to a vector, [ s 0 , s 1 ], of scaling factors used to convert Z coordinates from data units to normalized units. The formula for the conversion is as follows:

Normalized Z = s 0 + s 1 * Data Z

Recommended values are:

[(- Z min )/( Z max - Z min ), 1/( Z max - Z min )]

The default is [0.0, 1.0].


IDLgrSurface::SetProperty

The IDLgrSurface:: SetProperty procedure method sets the value of a property or group of properties for the surface. IDLgrSurface is described above.

Calling Sequence

Obj -> [IDLgrSurface::] SetProperty

Arguments

There are no arguments for this method.

Keywords

Any keyword to IDLgrSurface::Init