Table of Contents

Class: _vdisp ..\subs.py

Super class for displays - this contains all the useful instance methods for the displays. (Note the static methods usually use these.) This class should only be instantiated indirectly using the makeDisplay(), makeDisplay2D(), or makeDisplay3D() methods!!

Methods   
__init__
addData
addMaps
addShape
addTitle
drawLine
drawString
enableRubberBandBoxZoomer
getDisplayMaps
getDisplayScalarMaps
makeCube
maximizeBox
moveLine
moveShape
rotateBox
saveDisplay
setAspectRatio
setAspects
setBackgroundColor
setBoxColor
setBoxOn
setBoxSize
setCursorColor
setForegroundColor
setPointMode
setPointSize
showAxesScales
showDisplay
zoomBox
  __init__ 
__init__ ( self )

  addData 
addData (
        self,
        name,
        data,
        constantMaps=None,
        renderer=None,
        ref=None,
        )

Add VisAD <data> to the display <disp>. Use a reference <name>. If there are ConstantMaps, also add them. If there is a non-default Renderer, use it as well. Finally, you can supply a pre-defined DataReference as <ref>.

Returns the DataReference

  addMaps 
addMaps ( self,  maps )

Add list/tuple <maps> mappings to the <display>. These determine what scalars will appear along what axes. See makeMaps, below.

  addShape 
addShape (
        self,
        type,
        scale=.1,
        color=None,
        index=None,
        autoScale=1,
        )

Add a shape for this display. Parameters: <type> of shape (cross,triangle,square, solid_square,solid_triangle, or a VisADGeometryArray. <scale> = relative size for the shape. <color> = color name (e.g., "green") <index> = the index of the shape to replace with this one. If autoScale is true, the shape will be scaled.

Returns an index to this shape. (For use with moveShape.)

  addTitle 
addTitle (
        self,
        string,
        center=1,
        font="timesrb",
        color=None,
        size=None,
        offset=.1,
        index=None,
        )

Put a title onto this display. The title is centered just above the VisAD box. Use offset to move it up/down. Set the text color with color, and if this is a replacement for a previous title, then index is the value previously returned.

Return the shape index for later adjustments...

  drawLine 
drawLine (
        self,
        points,
        color=None,
        mathtype=None,
        style=None,
        width=None,
        )

Draw lines on this display. <points> is a 2 or 3 dimensional, list/tuple of points to connect as a line, ordered as given in the <mathtype>. Default <mathtype> is whatever is mapped to the x,y (and maybe z) axis. <color> is the line color ("red" or java.awt.Color; default=white), <style> is the line style (e.g., "dash"), and <width> is the line width in pixels.

Return a reference to this line.

  drawString 
drawString (
        self,
        string,
        point,
        color=None,
        center=0,
        font="futural",
        start=[ 0., 0., 0.],
        base=[.1, 0., 0.],
        up=[ 0.,.1, 0.],
        size=None,
        )

Draw a string of characters on this display. <string> is the string of characters. <point> is the starting location for the string drawing, expressed as a list/tuple of 2 or 3 values (x,y,z). <color> is the color (e.g., "red" or java.awt.Color; default = white). <center> if true will center the string. <font> defiles the HersheyFont name to use. <start> defines the relative location of the starting point (x,y,z; default = 0,0,0). <base> defines the direction that the base of the string should point (x,y,z; default= along x-axis). <up> defines the direction of the vertical stroke for each character (default = along y-axis). <size> is the relative size. Returns the index to the shape of the text (useful for moving).

  enableRubberBandBoxZoomer 
enableRubberBandBoxZoomer ( self,  useKey )

Method to attach a Rubber Band Box zoomer to this display. Once attached, it is there foreever! The useKey parameter can be 0 (no key), 1(CTRL), 2(SHIFT)

  getDisplayMaps 
getDisplayMaps ( self,  includeShapes=0 )

Return a list of the type mappings for the <display>. The list elements are ordered: x,y,z,display. If <includeShapes> is true, then mappings for Shape will be appended. The <display> may be a Display, or the name of a plot() window.

  getDisplayScalarMaps 
getDisplayScalarMaps ( self,  includeShapes=0 )

Return a list of the scalarmaps mappings for this display. The list elements are ordered: x,y,z,display. If <includeShapes> is true, then mappings for Shape will be appended. The <display> may be a Display, or the name of a plot() window.

  makeCube 
makeCube ( self )

Turn the VisAD box for this display into a cube with no perspective (no vanishing point. Useful for aligning vertically-stacked data.

  maximizeBox 
maximizeBox ( self,  clip=1 )

Set the size of the VisAD box for the <display> to 95%. If <clip> is true, the display will be clipped at the border of the box; otherwise, data displays may spill over.

  moveLine 
moveLine (
        self,
        lref,
        points,
        )

move the referenced line to the new points

  moveShape 
moveShape (
        self,
        index,
        coord,
        )

Move the shape pointed to by <inx>, to the <coordinates> which is a list of values in the same order as returned by getDisplayMaps.

  rotateBox 
rotateBox (
        self,
        azimuth,
        declination,
        )

Rotate the 3D display box to the azimuth angle (0-360) and declination angle (all in degrees). Code from Unidata.

  saveDisplay 
saveDisplay ( self,  filename )

Save the display <disp> as a JPEG, given the filename to use.

  setAspectRatio 
setAspectRatio ( self,  ratio )

Set the aspect <ratio> for this display. The ratio is expressed as the fractional value for: width/height.

  setAspects 
setAspects (
        self,
        x,
        y,
        z,
        )

Set the relative sizes of each axis in this display.

  setBackgroundColor 
setBackgroundColor ( self,  c )

Set the background color to color (which may be a java.awt.Color, or a string with the name in it (like green)

  setBoxColor 
setBoxColor ( self,  c )

Set the box color to color (which may be a java.awt.Color, or a string with the name in it (like green)

  setBoxOn 
setBoxOn ( self,  on )

Turn the wire frame box on or off.

  setBoxSize 
setBoxSize (
        self,
        percent=.70,
        clip=1,
        showBox=1,
        snap=0,
        )

Set the size of the VisAD box for the <display> as a percentage (fraction). The default is .70 (70%). If <clip> is true, the display will be clipped at the border of the box; otherwise, data displays may spill over. If <showBox> is true, the wire-frame will be shown; otherwise, it will be turned off. If <snap> is true, the box will be reoriented to an upright position.

  setCursorColor 
setCursorColor ( self,  c )

Set the cursor color to color (which may be a java.awt.Color, or a string with the name in it (like green)

  setForegroundColor 
setForegroundColor ( self,  c )

Set the foreground color to color (which may be a java.awt.Color, or a string with the name in it (like green)

  setPointMode 
setPointMode ( size,  on )

Turn on (on=true) point mode for some renderings; otherwise these objects may be shown as lines or texture maps.

  setPointSize 
setPointSize ( self,  size )

Set the size of points (1,2,3...) to use in this display.

  showAxesScales 
showAxesScales ( self,  on )

Turn on the axes labels for this display if on is true

  showDisplay 
showDisplay (
        self,
        width=300,
        height=300,
        title="VisAD Display",
        bottom=None,
        top=None,
        panel=None,
        right=None,
        left=None,
        )

Quick display of this display in a separate frame. <width> and <height> give the dimensions of the window; <title> is the text string for the titlebar, <bottom> is a panel to put below the <display>, <top> is a panel to put above the <display>, and <panel> is the panel to put everything into (default is to make a new one, and display it). Additionally, you may put panels on the <right> and <left>.

  zoomBox 
zoomBox ( self,  factor )

Zoom the display by factor (1.0 does nothing...). Related: setBoxSize().


Table of Contents

This document was automatically generated on Wed Feb 26 13:00:02 2003 by HappyDoc version 2.1