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 fieldnof 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 fieldnof the given two-dimensional viewport,v, which is of domain TwoDimensionalViewport, ifsis “on”, or does not display the axes ifsis “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 fieldnof the given two-dimensional viewport,v, which is of domain TwoDimensionalViewport, ifsis “on”, or does not display the lines ifsis “off”.
- controlPanel: (%, String) -> Void
controlPanel(v, s)displays the control panel of the given two-dimensional viewport,v, which is of domain TwoDimensionalViewport, ifsis “on”, or hides the control panel ifsis “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 fieldnof 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 bynumin the given two-dimensional viewportv, of domain TwoDimensionalViewport, to the values given as parameters. The scaling of the graph in thexandycomponent directions is set to besXandsY; the window translation in thexandycomponent directions is set to bedXanddY; The graph points, lines, boundingbox,axes, or units will be shown in the viewport if their given parameterspts,lns,box,axesorunare set to be1, but will not be shown if they are set to0. The color of theaxesand the color of the units are indicated by the palette colorsaxesCandunCrespectively. To display the control panel when the viewport window is displayed, setcPto1, 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,loptof 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 returnsvwith it'sdraw options modified to be those which are indicated in the given list,loptof domain DrawOption.
- points: (%, PositiveInteger, String) -> Void
points(v, n, s)displays the points of the graph in fieldnof the given two-dimensional viewport,v, which is of domain TwoDimensionalViewport, ifsis “on”, or does not display the points ifsis “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,giof domain GraphImage. The contents of viewport,v, will containgiwhen 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 fieldnof the given two-dimensional viewport,v, which is of domain TwoDimensionalViewport, ifsis “on”, or does not display the bounding box ifsis “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 ofwand 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 fieldnof the given two-dimensional viewport,v, which is of domain TwoDimensionalViewport, scaled by the factorsxin thex-coordinate direction and by the factorsyin they-coordinate direction.
- show: (%, PositiveInteger, String) -> Void
show(v, n, s)displays the graph in fieldnof the given two-dimensional viewport,v, which is of domain TwoDimensionalViewport, ifsis “on”, or does not display the graph ifsis “off”.
- title: (%, String) -> Void
title(v, s)changes the title which is shown in the two-dimensional viewport window,vof domain TwoDimensionalViewport.
- translate: (%, PositiveInteger, Float, Float) -> Void
translate(v, n, dx, dy)displays the graph in fieldnof the given two-dimensional viewport,v, which is of domain TwoDimensionalViewport, translated bydxin thex-coordinate direction from the center of the viewport, and bydyin they-coordinate direction from the center. Settingdxanddyto0places 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 fieldnof 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 fieldnof the given two-dimensional viewport,v, which is of domain TwoDimensionalViewport, ifsis “on”, or does not display the units ifsis “off”.
- update: (%, GraphImage, PositiveInteger) -> Void
update(v, gr, n)drops the graphgrin slotnof viewportv. The graphgrmust 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 forvand 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 forvand an optional file typef.