TwoDimensionalViewport¶
view2D.spad line 397 [edit on github]
TwoDimensionalViewport creates viewports to display graphs.
- axes: (%, PositiveInteger, Palette) -> Void
axes(v, n, c)
displays the axes of the graph in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, with the axes color set to the given palette colorc
.
- axes: (%, PositiveInteger, String) -> Void
axes(v, n, s)
displays the axes of the graph in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, ifs
is “on”, or does not display the axes ifs
is “off”.
- close: % -> Void
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: % -> OutputForm
coerce(v)
returns the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport as output of the domain OutputForm.
- connect: (%, PositiveInteger, String) -> Void
connect(v, n, s)
displays the lines connecting the graph points in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, ifs
is “on”, or does not display the lines ifs
is “off”.
- controlPanel: (%, String) -> Void
controlPanel(v, s)
displays the control panel of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, ifs
is “on”, or hides the control panel ifs
is “off”.
- dimensions: (%, NonNegativeInteger, NonNegativeInteger, PositiveInteger, PositiveInteger) -> Void
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 coordinatex
,y
, and sets the dimensions of the window to that ofwidth
,height
. The new dimensions are not displayed until the function makeViewport2D is executed again forv
.
- getGraph: (%, PositiveInteger) -> GraphImage
getGraph(v, n)
returns the graph which is of the domain GraphImage which is located in graph fieldn
of the given two-dimensional viewport,v
, which is of the domain TwoDimensionalViewport.
- getPickedPoints: % -> List Point DoubleFloat
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.
- graphs: % -> Vector Union(GraphImage, undefined)
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.
- graphState: (%, PositiveInteger, DoubleFloat, DoubleFloat, DoubleFloat, DoubleFloat, Integer, Integer, Integer, Integer, Palette, Integer, Palette, Integer) -> Void
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 bynum
in the given two-dimensional viewportv
, of domain TwoDimensionalViewport, to the values given as parameters. The scaling of the graph in thex
andy
component directions is set to besX
andsY
; the window translation in thex
andy
component directions is set to bedX
anddY
; The graph points, lines, boundingbox
,axes
, or units will be shown in the viewport if their given parameterspts
,lns
,box
,axes
orun
are set to be1
, but will not be shown if they are set to0
. The color of theaxes
and the color of the units are indicated by the palette colorsaxesC
andunC
respectively. To display the control panel when the viewport window is displayed, setcP
to1
, otherwise set it to0
.
- graphStates: % -> Vector Record(scaleX: DoubleFloat, scaleY: DoubleFloat, deltaX: DoubleFloat, deltaY: DoubleFloat, points: Integer, connect: Integer, spline: Integer, axes: Integer, axesColor: Palette, units: Integer, unitsColor: Palette, showing: Integer)
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.
- key: % -> Integer
key(v)
returns the process ID number of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport.
- latex: % -> String
from SetCategory
- makeViewport2D: % -> %
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 ofv
.
- makeViewport2D: (GraphImage, List DrawOption) -> %
makeViewport2D(gi, lopt)
creates and displays a viewport window of the domain TwoDimensionalViewport whose graph field is assigned to be the given graph,gi
, of domain GraphImage, and whose options field is set to be the list of options,lopt
of domain DrawOption.
- move: (%, NonNegativeInteger, NonNegativeInteger) -> Void
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 positionx
,y
.
- options: % -> List 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 forv
.
- options: (%, List DrawOption) -> %
options(v, lopt)
takes the given two-dimensional viewport,v
, of the domain TwoDimensionalViewport and returnsv
with it's
draw options modified to be those which are indicated in the given list,lopt
of domain DrawOption.
- points: (%, PositiveInteger, String) -> Void
points(v, n, s)
displays the points of the graph in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, ifs
is “on”, or does not display the points ifs
is “off”.
- putGraph: (%, GraphImage, PositiveInteger) -> Void
putGraph(v, gi, n)
sets the graph field indicated byn
, of the indicated two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, to be the graph,gi
of domain GraphImage. The contents of viewport,v
, will containgi
when the function makeViewport2D is called to create the an updated viewportv
.
- region: (%, PositiveInteger, String) -> Void
region(v, n, s)
displays the bounding box of the graph in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, ifs
is “on”, or does not display the bounding box ifs
is “off”.
- reset: % -> Void
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: (%, PositiveInteger, PositiveInteger) -> Void
resize(v, w, h)
displays the two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, with a width ofw
and a height ofh
, keeping the upper left-hand corner position unchanged.
- scale: (%, PositiveInteger, Float, Float) -> Void
scale(v, n, sx, sy)
displays the graph in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, scaled by the factorsx
in thex
-coordinate direction and by the factorsy
in they
-coordinate direction.
- show: (%, PositiveInteger, String) -> Void
show(v, n, s)
displays the graph in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, ifs
is “on”, or does not display the graph ifs
is “off”.
- title: (%, String) -> Void
title(v, s)
changes the title which is shown in the two-dimensional viewport window,v
of domain TwoDimensionalViewport.
- translate: (%, PositiveInteger, Float, Float) -> Void
translate(v, n, dx, dy)
displays the graph in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, translated bydx
in thex
-coordinate direction from the center of the viewport, and bydy
in they
-coordinate direction from the center. Settingdx
anddy
to0
places the center of the graph at the center of the viewport.
- units: (%, PositiveInteger, Palette) -> Void
units(v, n, c)
displays the units of the graph in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, with the units color set to the given palette colorc
.
- units: (%, PositiveInteger, String) -> Void
units(v, n, s)
displays the units of the graph in fieldn
of the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, ifs
is “on”, or does not display the units ifs
is “off”.
- update: (%, GraphImage, PositiveInteger) -> Void
update(v, gr, n)
drops the graphgr
in slotn
of viewportv
. The graphgr
must have been transmitted already and acquired an integer key.
- viewport2D: () -> %
viewport2D()
returns an undefined two-dimensional viewport of the domain TwoDimensionalViewport whose contents are empty.
- write: (%, String) -> String
write(v, s)
takes the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, and creates a directory indicated bys
, which contains the graph data files forv
.
- write: (%, String, List String) -> String
write(v, s, lf)
takes the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, and creates a directory indicated bys
, which contains the graph data files forv
and the optional file types indicated by the listlf
.
- write: (%, String, String) -> String
write(v, s, f)
takes the given two-dimensional viewport,v
, which is of domain TwoDimensionalViewport, and creates a directory indicated bys
, which contains the graph data files forv
and an optional file typef
.