view2D.spad line 397 [edit on github]
TwoDimensionalViewport creates viewports to display graphs.
axes(v, n, c)
displays the axes of the graph in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, with the axes color set to the given palette color c
.
axes(v, n, s)
displays the axes of the graph in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, if s
is "on", or does not display the axes if s
is "off".
close(v)
closes the viewport window of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, and terminates the corresponding process ID.
coerce(v)
returns the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport as output of the domain OutputForm.
connect(v, n, s)
displays the lines connecting the graph points in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, if s
is "on", or does not display the lines if s
is "off".
controlPanel(v, s)
displays the control panel of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, if s
is "on", or hides the control panel if s
is "off".
dimensions(v, x, y, width, height)
sets the position of the upper left-hand corner of the two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, to the window coordinate x
, y
, and sets the dimensions of the window to that of width
, height
. The new dimensions are not displayed until the function makeViewport2D is executed again for v
.
getGraph(v, n)
returns the graph which is of the domain GraphImage which is located in graph field n
of the given two-dimensional viewport, v
, which is of the domain TwoDimensionalViewport.
getPickedPoints(x)
returns a list of small floats for the points the user interactively picked on the viewport for full integration into the system, some design issues need to be addressed: e.g. how to go through the GraphImage interface, how to default to graphs, etc.
graphState(v, num, sX, sY, dX, dY, pts, lns, box, axes, axesC, un, unC, cP)
sets the state of the characteristics for the graph indicated by num
in the given two-dimensional viewport v
, of domain TwoDimensionalViewport, to the values given as parameters. The scaling of the graph in the x
and y
component directions is set to be sX
and sY
; the window translation in the x
and y
component directions is set to be dX
and dY
; The graph points, lines, bounding box
, axes
, or units will be shown in the viewport if their given parameters pts
, lns
, box
, axes
or un
are set to be 1
, but will not be shown if they are set to 0
. The color of the axes
and the color of the units are indicated by the palette colors axesC
and unC
respectively. To display the control panel when the viewport window is displayed, set cP
to 1
, otherwise set it to 0
.
graphStates(v)
returns and shows a listing of a record containing the current state of the characteristics of each of the ten graph records in the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport.
graphs(v)
returns a vector, or list, which is a union of all the graphs, of the domain GraphImage, which are allocated for the two-dimensional viewport, v
, of domain TwoDimensionalViewport. Those graphs which have no data are labeled "undefined", otherwise their contents are shown.
key(v)
returns the process ID number of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport.
makeViewport2D(v)
takes the given two-dimensional viewport, v
, of the domain TwoDimensionalViewport and displays a viewport window on the screen which contains the contents of v
.
makeViewport2D(
creates and displays a viewport window of the domain TwoDimensionalViewport whose graph field is assigned to be the given graph, gi
, lopt)
, of domain GraphImage, and whose options field is set to be the list of options, gi
lopt
of domain DrawOption.
move(v, x, y)
displays the two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, with the upper left-hand corner of the viewport window at the screen coordinate position x
, y
.
options(v, lopt)
takes the given two-dimensional viewport, v
, of the domain TwoDimensionalViewport and returns v
with it's
draw options modified to be those which are indicated in the given list, lopt
of domain DrawOption.
options(v)
takes the given two-dimensional viewport, v
, of the domain TwoDimensionalViewport and returns a list containing the draw options from the domain DrawOption for v
.
points(v, n, s)
displays the points of the graph in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, if s
is "on", or does not display the points if s
is "off".
putGraph(v,
sets the graph field indicated by gi
, n)n
, of the indicated two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, to be the graph,
of domain GraphImage. The contents of viewport, gi
v
, will contain
when the function makeViewport2D is called to create the an updated viewport gi
v
.
region(v, n, s)
displays the bounding box of the graph in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, if s
is "on", or does not display the bounding box if s
is "off".
reset(v)
sets the current state of the graph characteristics of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, back to their initial settings.
resize(v, w, h)
displays the two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, with a width of w
and a height of h
, keeping the upper left-hand corner position unchanged.
scale(v, n, sx, sy)
displays the graph in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, scaled by the factor sx
in the x
-coordinate direction and by the factor sy
in the y
-coordinate direction.
show(v, n, s)
displays the graph in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, if s
is "on", or does not display the graph if s
is "off".
title(v, s)
changes the title which is shown in the two-dimensional viewport window, v
of domain TwoDimensionalViewport.
translate(v, n, dx, dy)
displays the graph in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, translated by dx
in the x
-coordinate direction from the center of the viewport, and by dy
in the y
-coordinate direction from the center. Setting dx
and dy
to 0
places the center of the graph at the center of the viewport.
units(v, n, c)
displays the units of the graph in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, with the units color set to the given palette color c
.
units(v, n, s)
displays the units of the graph in field n
of the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, if s
is "on", or does not display the units if s
is "off".
update(v, gr, n)
drops the graph gr
in slot n
of viewport v
. The graph gr
must have been transmitted already and acquired an integer key.
viewport2D()
returns an undefined two-dimensional viewport of the domain TwoDimensionalViewport whose contents are empty.
write(v, s)
takes the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, and creates a directory indicated by s
, which contains the graph data files for v
.
write(v, s, lf)
takes the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, and creates a directory indicated by s
, which contains the graph data files for v
and the optional file types indicated by the list lf
.
write(v, s, f)
takes the given two-dimensional viewport, v
, which is of domain TwoDimensionalViewport, and creates a directory indicated by s
, which contains the graph data files for v
and an optional file type f
.