A polygon object represents one or more polygons that share a given set of vertices and rendering attributes. All polygons must be convex--that is, a line connecting any pair of vertices on the polygon cannot fall outside the polygon. Concave polygons can be converted to a set of convex polygons using the IDLgrTessellator object.
An IDLgrPolygon 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.
The IDLgrPolygon:: Cleanup procedure method performs all cleanup on the object. IDLgrPolygon is described above.
NOTE: Cleanup methods are special lifecycle methods , and as such cannot be called outside the context of object destruction. This means that in most cases, you cannot call the Cleanup method directly. There is one exception to this rule: If you write your own subclass of this class, you can call the Cleanup method from within the Cleanup method of the subclass.
The IDLgrPolygon:: GetCTM function method returns the 4 x 4 graphics transform matrix from the current object upward through the graphics tree. IDLgrPolygon is described above.
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 polygon object.
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.
The IDLgrPolygon:: GetProperty procedure method retrieves the value of the property or group of properties for the polygons. IDLgrPolygon is described above.
Any keyword to IDLgrPolygon::Init
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.
Set this keyword equal to a named variable that will contain an object reference to the object that contains this object.
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.
The IDLgrPolygon:: Init function method initializes the polygons object. IDLgrPolygon is described above.
NOTE: Init methods are special lifecycle methods , and as such cannot be called outside the context of object creation. This means that in most cases, you cannot call the Init method directly. There is one exception to this rule: If you write your own subclass of this class, you can call the Init method from within the Init method of the subclass.
Obj = OBJ_NEW('IDLgrPolygon' [, X [ , Y[ , Z]]] )
Result =
Obj
->
[IDLgrPolygon::]
Init(
[X, [Y, [Z]]]
) (
In a subclass' Init method only
.)
A vector argument providing the X coordinates of the vertices. The vector must contain at least three elements. If the Y and Z arguments are not provided, X must be an array of either two or three vectors (i.e., [2,*] or [3,*]), in which case, X [0,*] specifies the X values, X [1,*] specifies the Y values, and X [2,*] specifies the Z values.
Properties retrievable via IDLgrPolygon::GetProperty
Set this keyword to an RGB or Indexed color for drawing the backs of the polygons. (The back of a polygon is the side opposite the normal direction). Setting a bottom color is only supported when the destination device uses RGB color mode.
Set this keyword to an RGB or Indexed color for drawing polygons. The default color is [255, 255, 255] (white). If the TEXTURE_MAP property is used, the final color is modulated by the texture map pixel values. This keyword is ignored if the VERT_COLORS keyword is provided.
Set this keyword to a 2 x n or 3 x n array which defines, respectively, the 2D or 3D vertex data. DATA is equivalent to the optional arguments, X , Y , and Z .
Set this keyword equal to an object reference to an IDLgrPattern object (or an array of IDLgrPattern objects) to specify the fill pattern to use for filling the polygons. By default, FILL_PATTERN is set to a null object reference, specifying a solid fill.
Set this keyword to draw point and wireframe surfaces using hidden line (point) removal. By default, hidden line removal is disabled.
Set this keyword to indicate the line style that should be used to draw the polygon. 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).
Set this keyword equal to a string containing the name associated with this object. The default is the null string, ' '.
Set this keyword to a 3 x n array of unit polygon normals at each vertex. If this keyword is not set, vertex normals are computed by averaging shared polygon normals at each vertex. Normals are computed using the Right Hand Rule; that is, if the polygon is facing the viewer, vertices are taken in counterclockwise order. To remove previously specified normals, set NORMALS to a scalar.
Set this keyword to an array of polygon descriptions. A polygon description is an integer or longword array of the form: [ n , i 0 , i 1 , ..., i n-1 ], where n is the number of vertices that define the polygon, and i 0 ..i n -1 are indices into the X , Y , and Z arguments that represent the polygon vertices. To ignore an entry in the POLYGONS array, set the vertex count, n , to 0. To end the drawing list, even if additional array space is available, set n to -1. If this keyword is not specified, a single polygon will be generated.
NOTE: The connectivity array described by POLYGONS allows an individual object to contain more than one polygon. Vertex, normal, and color information can be shared by the multiple polygons. Consequently, the polygon object can represent an entire mesh and compute reasonable normal estimates in most cases.
Set this keyword to an integer value to reject polygons as being hidden depending on the orientation of their normals. Select from one of the following values:
Set this keyword to zero to draw all polygons regardless of the direction of their normals.
Set this keyword to treat the data provided via the DATA property 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 the DATA property.
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 index for the brightest pixel. The default is [0, 255]. This keyword is ignored when the polygons are drawn to a graphics destination that uses the RGB color model.
Set this keyword to an integer representing the type of shading to use:
Gouraud shading may be slower than flat shading, but results in a smoother appearance.
Set this keyword to an object with which data is to be shared by this polygon(s). Polygons may only share data with another polygons object or a polyline. 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.
A 2 x n array containing the texture map coordinates for each of the n polygon vertices. Use this keyword in conjunction with the TEXTURE_MAP keyword to wrap images over 2D and 3D polygons. Default coordinates are not provided.
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]]
Set this keyword to indicate that bilinear sampling is to be used for texture mapping an image onto the polygon(s). The default is nearest neighbor sampling.
Set this keyword to the object reference of an IDLgrImage object to be texture mapped onto the polygons. The tiling or mapping of the texture is defined expressly by TEXTURE_COORD. If this keyword is omitted, polygons are 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].) To remove a texture map, set TEXTURE_MAP equal to a null object reference.
Set this keyword to an integer value between 1 and 10, specifying the size of the points or the thickness of the lines to be drawn when STYLE is set to either 0 (Points) or 1 (Lines), in pixels. The default is one pixel.
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. To remove vertex colors, set VERT_COLORS to a scalar.
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
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
The IDLgrPolygon:: SetProperty procedure method sets the value of the property or group of properties for the polygons. IDLgrPolygon is described above.
Any keyword to IDLgrPolygon::Init