/usr/share/axiom-20170501/src/algebra/DROPT.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | )abbrev domain DROPT DrawOption
++ Author: Stephen Watt
++ Date Created: 1 March 1990
++ Date Last Updated: 31 Oct 1990, Jim Wen
++ Description:
++ DrawOption allows the user to specify defaults for the
++ creation and rendering of plots.
DrawOption() : SIG == CODE where
RANGE ==> List Segment Float
UNIT ==> List Float
PAL ==> Palette
POINT ==> Point(DoubleFloat)
SEG ==> Segment Float
SF ==> DoubleFloat
SPACE3 ==> ThreeSpace(DoubleFloat)
VIEWPT ==> Record(theta:SF, phi:SF, scale:SF, scaleX:SF, scaleY:SF,
scaleZ:SF, deltaX:SF, deltaY:SF )
SIG ==> SetCategory with
adaptive : Boolean -> %
++ adaptive(b) turns adaptive 2D plotting on if b is true, or off if b is
++ false. This option is expressed in the form \spad{adaptive == b}.
clip : Boolean -> %
++ clip(b) turns 2D clipping on if b is true, or off if b is false.
++ This option is expressed in the form \spad{clip == b}.
viewpoint : VIEWPT -> %
++ viewpoint(vp) creates a viewpoint data structure corresponding to the
++ list of values. The values are interpreted as [theta, phi, scale,
++ scaleX, scaleY, scaleZ, deltaX, deltaY]. This option is expressed
++ in the form \spad{viewpoint == ls}.
title : String -> %
++ title(s) specifies a title for a plot by the indicated string s.
++ This option is expressed in the form \spad{title == s}.
style : String -> %
++ style(s) specifies the drawing style in which the graph will be
++ plotted by the indicated string s. This option is expressed in the
++ form \spad{style == s}.
toScale : Boolean -> %
++ toScale(b) specifies whether or not a plot is to be drawn to scale;
++ if b is true it is drawn to scale, if b is false it is not. This
++ option is expressed in the form \spad{toScale == b}.
clip : List SEG -> %
++ clip([l]) provides ranges for user-defined clipping as specified
++ in the list l. This option is expressed in the form \spad{clip == [l]}
coordinates : (POINT -> POINT) -> %
++ coordinates(p) specifies a change of coordinate systems of point p.
++ This option is expressed in the form \spad{coordinates == p}.
pointColor : Float -> %
++ pointColor(v) specifies a color, v, for 2D graph points. This option
++ is expressed in the form \spad{pointColor == v}.
pointColor : PAL -> %
++ pointColor(p) specifies a color index for 2D graph points from the
++ spadcolors palette p. This option is expressed in the
++ form \spad{pointColor == p}.
curveColor : Float -> %
++ curveColor(v) specifies a color, v, for 2D graph curves.
++ This option is expressed in the form \spad{curveColor == v}.
curveColor : PAL -> %
++ curveColor(p) specifies a color index for 2D graph curves from the
++ spadcolors palette p.
++ This option is expressed in the form \spad{curveColor ==p}.
colorFunction : (SF -> SF) -> %
++ colorFunction(f(z)) specifies the color based upon the z-component of
++ three dimensional plots. This option is expressed in the
++ form \spad{colorFunction == f(z)}.
colorFunction : ((SF,SF) -> SF) -> %
++ colorFunction(f(u,v)) specifies the color for three dimensional plots
++ as a function based upon the two parametric variables. This option
++ is expressed in the form \spad{colorFunction == f(u,v)}.
colorFunction : ((SF,SF,SF) -> SF) -> %
++ colorFunction(f(x,y,z)) specifies the color for three dimensional
++ plots as a function of x, y, and z coordinates. This option is
++ expressed in the form \spad{colorFunction == f(x,y,z)}.
tubeRadius : Float -> %
++ tubeRadius(r) specifies a radius, r, for a tube plot around a 3D curve
++ is expressed in the form \spad{tubeRadius == 4}.
range : List SEG -> %
++ range([l]) provides a user-specified range l.
++ This option is expressed in the form \spad{range == [l]}.
range : List Segment Fraction Integer -> %
++ range([i]) provides a user-specified range i.
++ This option is expressed in the form \spad{range == [i]}.
ranges : RANGE -> %
++ ranges(l) provides a list of user-specified ranges l.
++ This option is expressed in the form \spad{ranges == l}.
space : SPACE3 -> %
++ space specifies the space into which we will draw. If none is given
++ then a new space is created.
var1Steps : PositiveInteger -> %
++ var1Steps(n) indicates the number of subdivisions, n, of the first
++ range variable. This option is expressed in the
++ form \spad{var1Steps == n}.
var2Steps : PositiveInteger -> %
++ var2Steps(n) indicates the number of subdivisions, n, of the second
++ range variable. This option is expressed in the
++ form \spad{var2Steps == n}.
tubePoints : PositiveInteger -> %
++ tubePoints(n) specifies the number of points, n, defining the circle
++ which creates the tube around a 3D curve, the default is 6.
++ This option is expressed in the form \spad{tubePoints == n}.
coord : (POINT->POINT) -> %
++ coord(p) specifies a change of coordinates of point p.
++ This option is expressed in the form \spad{coord == p}.
unit : UNIT -> %
++ unit(lf) will mark off the units according to the indicated list lf.
++ This option is expressed in the form \spad{unit == [f1,f2]}.
option : (List %, Symbol) -> Union(Any, "failed")
++ option() is not to be used at the top level;
++ option determines internally which drawing options are indicated in
++ a draw command.
option? : (List %, Symbol) -> Boolean
++ option?() is not to be used at the top level;
++ option? internally returns true for drawing options which are
++ indicated in a draw command, or false for those which are not.
CODE ==> add
import AnyFunctions1(String)
import AnyFunctions1(Segment Float)
import AnyFunctions1(VIEWPT)
import AnyFunctions1(List Segment Float)
import AnyFunctions1(List Segment Fraction Integer)
import AnyFunctions1(List Integer)
import AnyFunctions1(PositiveInteger)
import AnyFunctions1(Boolean)
import AnyFunctions1(RANGE)
import AnyFunctions1(UNIT)
import AnyFunctions1(Float)
import AnyFunctions1(POINT -> POINT)
import AnyFunctions1(SF -> SF)
import AnyFunctions1((SF,SF) -> SF)
import AnyFunctions1((SF,SF,SF) -> SF)
import AnyFunctions1(POINT)
import AnyFunctions1(PAL)
import AnyFunctions1(SPACE3)
Rep := Record(keyword:Symbol, value:Any)
length:List SEG -> NonNegativeInteger
-- these lists will become tuples in a later version
length tup == # tup
lengthR:List Segment Fraction Integer -> NonNegativeInteger
-- these lists will become tuples in a later version
lengthR tup == # tup
lengthI:List Integer -> NonNegativeInteger
-- these lists will become tuples in a later version
lengthI tup == # tup
viewpoint vp ==
["viewpoint"::Symbol, vp::Any]
title s == ["title"::Symbol, s::Any]
style s == ["style"::Symbol, s::Any]
toScale b == ["toScale"::Symbol, b::Any]
clip(b:Boolean) == ["clipBoolean"::Symbol, b::Any]
adaptive b == ["adaptive"::Symbol, b::Any]
pointColor(x:Float) == ["pointColorFloat"::Symbol, x::Any]
pointColor(c:PAL) == ["pointColorPalette"::Symbol, c::Any]
curveColor(x:Float) == ["curveColorFloat"::Symbol, x::Any]
curveColor(c:PAL) == ["curveColorPalette"::Symbol, c::Any]
colorFunction(f:SF -> SF) == ["colorFunction1"::Symbol, f::Any]
colorFunction(f:(SF,SF) -> SF) == ["colorFunction2"::Symbol, f::Any]
colorFunction(f:(SF,SF,SF) -> SF) == ["colorFunction3"::Symbol, f::Any]
clip(tup:List SEG) ==
length tup > 3 =>
error "clip: at most 3 segments may be specified"
["clipSegment"::Symbol, tup::Any]
coordinates f == ["coordinates"::Symbol, f::Any]
tubeRadius x == ["tubeRadius"::Symbol, x::Any]
range(tup:List Segment Float) ==
((n := length tup) > 3) =>
error "range: at most 3 segments may be specified"
n < 2 =>
error "range: at least 2 segments may be specified"
["rangeFloat"::Symbol, tup::Any]
range(tup:List Segment Fraction Integer) ==
((n := lengthR tup) > 3) =>
error "range: at most 3 segments may be specified"
n < 2 =>
error "range: at least 2 segments may be specified"
["rangeRat"::Symbol, tup::Any]
ranges s == ["ranges"::Symbol, s::Any]
space s == ["space"::Symbol, s::Any]
var1Steps s == ["var1Steps"::Symbol, s::Any]
var2Steps s == ["var2Steps"::Symbol, s::Any]
tubePoints s == ["tubePoints"::Symbol, s::Any]
coord s == ["coord"::Symbol, s::Any]
unit s == ["unit"::Symbol, s::Any]
coerce(x:%):OutputForm == x.keyword::OutputForm = x.value::OutputForm
x:% = y:% == x.keyword = y.keyword and x.value = y.value
option?(l, s) ==
for x in l repeat
x.keyword = s => return true
false
option(l, s) ==
for x in l repeat
x.keyword = s => return(x.value)
"failed"
|