IDLgrWindow

A window object is a representation of an on-screen area on a display device that serves as a graphics destination.

Note on Window Size Limits

The OpenGL libraries IDL uses impose limits on the maximum size of a drawable area. The limits are device-dependent -- they depend both on your graphics hardware and the setting of the RENDERER property. Currently, the smallest maximum drawable area on any IDL platform is 1280 x 1024 pixels; the limit on your system may be larger.

Superclasses

This class has no superclass.

Subclasses

This class has no subclasses.

Creation

See IDLgrWindow::Init

Methods

Intrinsic Methods

This class has the following methods:


IDLgrWindow::Cleanup

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

Calling Sequence

OBJ_DESTROY, Obj

or

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

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrWindow::Draw

The IDLgrWindow:: Draw procedure method draws the specified scene or view object to this graphics destination. IDLgrWindow is described above.

Calling Sequence

Obj -> [IDLgrWindow::] Draw, Picture

Arguments

Picture

The view (an instance of an IDLgrView object), viewgroup (an instance of an IDLgrViewgroup object), or scene (an instance of an IDLgrScene object) to be drawn.

Keywords

CREATE_INSTANCE

Set this keyword equal to one specify that this scene or view is the unchanging part of a drawing. Some destinations can make an instance from the current window contents without having to perform a complete redraw. If the view or scene to be drawn is identical to the previously dawn view or scene, this keyword can be set equal to 2 to hint the destination to create the instance from the current window contents if it can.

DRAW_INSTANCE

Set this keyword to specify that this scene or view is the changing part of a drawing. It is overlaid on the result of the most recent CREATE_INSTANCE draw.


IDLgrWindow::Erase

The IDLgrWindow:: Erase procedure method erases the entire contents of the window. IDLgrWindow is described above.

Calling Sequence

Obj -> [IDLgrWindow::] Erase

Arguments

There are no arguments for this method.

Keywords

COLOR

Set this keyword to the color to be used for the erase. The color may be specified as a color lookup table index or as an RGB vector. The default erase color is white.


IDLgrWindow::GetContiguousPixels

The IDLgrWindow:: GetContiguousPixels function method returns an array of long integers whose length is equal to the number of colors available in the index color mode (that is, the value of the N_COLORS property).

The returned array marks contiguous pixels with the ranking of the range's size. This means that within the array, the elements in the largest available range are set to zero, the elements in the second-largest range are set to one, etc. Use this range to set an appropriate colormap for use with the SHADE_RANGE property of the IDLgrSurface and IDLgrPolygon object classes.

To get the largest contiguous range, you could use the following IDL command:

result = obj -> GetContiguousPixels()

Range0 = WHERE(result EQ 0)

A contiguous region in the colormap can be increasing or decreasing in values. The following would be considered contiguous:

[0,1,2,3,4]

[4,3,2,1,0]

IDLgrWindow is described above.

Calling Sequence

Return = Obj -> [IDLgrWindow::] GetContiguousPixels()

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrWindow::GetProperty

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

Calling Sequence

Obj -> [IDLgrWindow::] GetProperty

Arguments

There are no arguments for this method.

Keywords

Any keyword to IDLgrWindow::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.

IMAGE_DATA

Set this keyword to a named variable that will contain a byte array representing the image that is currently displayed in the window. If the window object uses an RGB color model, the returned array will have dimensions (3, winXSize , winYSize ), or (4, winXSize , winYSize ) if an alpha channel is included. If the window object uses an Indexed color model, the returned array will have dimensions ( winXSize , winYSize ). See IDLgrWindow::Read for more information.

RESOLUTION

Set this keyword to a named variable that will contain a vector of the form [ xres , yres ] reporting the pixel resolution, measured in centimeters per pixel.

SCREEN_DIMENSIONS

Set this keyword to a named variable that will contain a two-element vector of the form [ width , height ] specifying the dimensions of the overall screen dimensions for the screen with which this window is associated. The screen dimensions are measured in device units.


IDLgrWindow::GetTextDimensions

The IDLgrWindow:: GetTextDimensions function method retrieves the dimensions of a text object that will be rendered in the window. The result is a 3-element floating-point vector [ xDim , yDim , zDim ] representing the dimensions of the text object, measured in data units. IDLgrWindow is described above.

Calling Sequence

Result = Obj -> [IDLgrWindow::] GetTextDimensions( TextObj )

Arguments

TextObj

The object reference to a text or axis object for which the text dimensions are requested.

Keywords

DESCENT

Set this keyword equal to a named variable that will contain an array of floating- point values (one for each string in the IDLgrText object). The values are the distance to travel (parallel to the UPDIR direction) from the baseline to reach the bottom of all the descenders for the string; the values will be negative or 0. This keyword is only valid if TextObj is of the class IDLgrText.


IDLgrWindow::Iconify

The IDLgrWindow:: Iconify procedure method iconifies or de-iconifies the window. IDLgrWindow is described above.

Calling Sequence

Obj -> [IDLgrWindow::] Iconify, IconFlag

Arguments

IconFlag

Set IconFlag to 1 (one) to iconify the window or to 0 (zero) to restore the window. If the window is already restored, it is brought to the front of the window stack.

Keywords

There are no keywords for this method.


IDLgrWindow::Init

The IDLgrWindow:: Init function method initializes the window object. IDLgrWindow is described above.

Calling Sequence

Obj = OBJ_NEW('IDLgrWindow')

or

Result = Obj -> [IDLgrWindow::] Init( )         ( In a subclass' Init method only .)

Arguments

There are no arguments for this method.

Keywords

Properties retrievable via IDLgrWindow::GetProperty

COLOR_MODEL (Get)

Set this keyword to the color model to be used for the window:

DIMENSIONS (Get, Set)

Set this keyword to a two-element vector of the form [ width , height ] to specify the dimensions of the window in units specified by the UNITS property. By default, if no value is specified for DIMENSIONS, IDL uses the value of the "Default Window Width" and "Default Window Height" preferences set in the IDL Development Environment's (IDLDE) Preferences dialog. If there is no preference file for the IDLDE, the DIMENSIONS property is set equal to one quarter of the screen size. There are limits on the maximum size of an IDLgrWindow object; see Note on Window Size Limits for details.

DISPLAY_NAME (Get) [X Only]

Set this keyword to the name of the X Windows display on which the window is to appear.

GRAPHICS_TREE (Get, Set)

Set this keyword to an object reference of type IDLgrScene, IDLgrViewgroup, or IDLgrView. If this property is set to a valid object reference, calling the Draw method on the destination object with no arguments will cause the object reference associated with this property to be drawn. If this object is valid and the destination object is destroyed, this object reference will be destroyed as well. By default the GRAPHICS_TREE property is set equal to the null-object.

LOCATION (Get, Set)

Set this keyword to a two-element vector of the form [ x , y ] to specify the location of the upper lefthand corner of the window relative to the display screen, in units specified by the UNITS property. By default, the window is positioned at one of four quadrants on the display screen, and the location is measured in device units.

N_COLORS (Get)

Set this keyword to the number of colors (between 2 and 256) to be used if COLOR_MODEL is set to Indexed (1). This keyword is ignored if COLOR_MODEL is set to RGB (0).

PALETTE (Get, Set)

Set this keyword to the object reference of a palette object (an instance of the IDLgrPalette object class) to specify the red, green, and blue values that are to be loaded into the graphics destination's color lookup table, applicable if the Indexed color model is used.

QUALITY (Get, Set)

Set this keyword to an integer indicating the rendering quality at which graphics are to be drawn to this destination. Valid values are:

RENDERER (Get)

Set this keyword to an integer value indicating which graphics renderer to use when drawing objects within the window. Valid values are:

By default, your platform's native OpenGL implementation is used. If your platform does not have a native OpenGL implementation, IDL's software implementation is used regardless of the value of this property. See for details. Your choice of renderer may also affect the maximum size of an IDLgrWindow object; see Note on Window Size Limits for details.

RETAIN (Get)

Set this keyword to 0, 1, or 2 to specify how backing store should be handled for the window. By default, if no value is specified for RETAIN, IDL uses the value of the "Backing Store" preference set in the IDL Development Environment's (IDLDE) Preferences dialog. If there is no preference file for the IDLDE (that is, if you always use IDL in plain tty mode), the RETAIN property is set equal to 0 by default.

In IDL Object Graphics, it is almost always best to disable backing store (that is, set the RETAIN property equal to zero). This is because drawing to an off-screen pixmap (which is what happens when backing store is enabled) almost always bypasses any hardware graphics acceleration that may be available, causing all rendering to be done in software. To ensure that windows are redrawn properly, enable the generation of expose events on the WIDGET_DRAW window and redraw the window explicitly when an expose event is received.

TITLE (Get, Set)

Set this keyword equal to a string that represents the title of the window.

UNITS (Get, Set)

Set this keyword to indicate the units of measure for the LOCATION and DIMENSIONS properties. Valid values are:

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.


IDLgrWindow::Pickdata

The IDLgrWindow:: Pickdata function method maps a point in the two-dimensional device space of the window to a point in the three-dimensional data space of an object tree. The resulting 3D data space coordinates are returned in a user-specified variable. The Pickdata function returns one if the specified location in the window's device space "hits" a graphic object, or zero if no object was "hit". Pickdata returns -1 if the point selected falls outside of the specified view or window. IDLgrWindow is described above.

Calling Sequence

Result = Obj -> [IDLgrWindow::] Pickdata( View , Object , Location , XYZLocation )

Arguments

View

The object reference of an IDLgrView object that contains the object being picked.

Object

The object reference of a model or atomic graphic object from which the data space coordinates are being requested.

Location

A two-element vector [ x , y ] specifying the location in the window's device space of the point to pick data from.

XYZLocation

A named variable that will contain the three-dimensional data space coordinates of the picked point. Note that the value returned in this variable is a location, not a data value.

Keywords

There are no keywords for this method.


IDLgrWindow::Read

The IDLgrWindow:: Read function method reads an image from a window. The returned value is an instance of the IDLgrImage object class. IDLgrWindow is described above.

Calling Sequence

Result = Obj -> [IDLgrWindow::] Read()

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrWindow::Select

The IDLgrWindow:: Select function method returns a list of objects selected at a specified location. If no objects are selected, the Select function returns -1. IDLgrWindow is described above.

Calling Sequence

Result = Obj -> [IDLgrWindow::] Select( Picture, XY )

Arguments

Picture

The view or scene (an instance of the IDLgrView , IDLgrViewgroup, or IDLgrScene class) whose children are among the candidates for selection.

If the first argument is a scene, then the returned object list will contain one or more views. If the first argument is a view, the list will contain atomic graphic objects (or model objects which have their SELECT_TARGET property set). Objects are returned in order, according to their distance from the viewer. The closer an object is to the viewer, the lower its index in the returned object list. If multiple objects are at the same distance from the viewer (views in a scene or 2D geometry), the last object drawn will appear at a lower index in the list.

XY

A two-element array defining the center of the selection box in device space. By default, the selection box is 3 pixels by 3 pixels.

Keywords

DIMENSIONS

Set this keyword to a two-element array [ w , h ] to specify that the selection box will have a width w and a height h , and will be centered about the coordinates [ x , y ] specified in the XY argument. The box occupies the rectangle defined by:

    (x-(w/2), y-(h/2)) - (x+(w/1), y+(h/2))

Any object which intersects this box is considered to be selected. By default, the selection box is 3 pixels by 3 pixels.

UNITS

Set this keyword to indicate the units of measure. Valid values are:


IDLgrWindow::SetCurrentCursor

The IDLgrWindow:: SetCurrentCursor procedure method sets the current cursor image to be used while positioned over a drawing area. IDLgrWindow is described above.

Calling Sequence

Obj -> [IDLgrWindow::] SetCurrentCursor, [,CursorName]

Arguments

CursorName

A string which specifies which built-in cursor to use. This argument is ignored if one of the keywords to this routine is set. This string can be one of the following:

Keywords

IMAGE [X and Macintosh Only]

Set this keyword to a 16x16 column bitmap, contained in a 16-element short integer vector, specifying the cursor pattern. The offset from the upper-left pixel to the point that is considered the `hot spot' can be provided via the HOTSPOT keyword.

MASK [X and Macintosh Only]

When the IMAGE keyword is set, the MASK keyword can be used to simultaneously specify the mask that should be used. In the mask, bits that are set indicate bits in the IMAGE that should be seen and bits that are not are "masked" out".

HOTSPOT [X and Macintosh Only]

Set this keyword to a two-element vector specifying the [ x , y ] pixel offset of the cursor "hot spot", the point which is considered to be the mouse position, from the upper left corner of the cursor image. This parameter is only applicable if IMAGE is provided. The cursor image is displayed top-down (the first row is displayed at the top).

STANDARD

Set this keyword to change the appearance of the cursor in IDL graphics windows to a standard system cursor.


IDLgrWindow::SetProperty

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

Calling Sequence

Obj -> [IDLgrWindow::] SetProperty

Arguments

There are no arguments for this method.

Keywords

Any keyword to IDLgrWindow::Init


IDLgrWindow::Show

The IDLgrWindow:: Show procedure method exposes or hides a window. IDLgrWindow is described above.

Calling Sequence

Obj -> [IDLgrWindow::] Show, Position

Arguments

Position

Set the Position argument equal to a non-zero value to expose the window. Set the Position argument equal to 0 (zero) to hide the window.

Keywords

There are no keywords for this method.