From 4e987026148fe65c323afbc93cd560c07bf06b3f Mon Sep 17 00:00:00 2001 From: Yale AI Dept Date: Wed, 14 Jul 1993 13:08:00 -0500 Subject: Import to github. --- progs/demo/X11/graphics/manual | 454 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 454 insertions(+) create mode 100644 progs/demo/X11/graphics/manual (limited to 'progs/demo/X11/graphics/manual') diff --git a/progs/demo/X11/graphics/manual b/progs/demo/X11/graphics/manual new file mode 100644 index 0000000..17772f1 --- /dev/null +++ b/progs/demo/X11/graphics/manual @@ -0,0 +1,454 @@ +104 pgscriptver + +100 DefSpaceEx 100 DefCharEx 1 DefNormalHyphenationOn 100 +DefTypeColor (Times-Roman) DefTypeFace ENGLISH DefLanguage 12 DefPointSize +USE_POINTSIZE DefSetSize (@default) DefTypeResource + +LEFT DefJustifyFlags 2 DefBeginParaLeadValue ABSOLUTE DefBeginParaLeadMode 2 +DefEndParaLeadValue ABSOLUTE DefEndParaLeadMode 120 DefLeadValue +PROPORTIONAL DefLeadMode 1 46 0 TAB_LEFT 720 DefTab 1 46 0 +TAB_LEFT 2160 DefTab 1 46 0 TAB_LEFT 3600 DefTab 1 46 0 +TAB_LEFT 5040 DefTab 1 46 0 TAB_LEFT 6480 DefTab 1 46 0 +TAB_LEFT 7920 DefTab 1 46 0 TAB_LEFT 9360 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 0 46 0 TAB_LEFT 24480 DefTab 0 46 0 +TAB_LEFT 24480 DefTab 80 DefWSMN 100 DefWSNM 150 DefWSMX 110 +DefLSMX 100 DefLeaderEx 46 DefLeaderChar 0 DefFirstIndent 0 +DefLeftIndent 0 DefRightIndent 0 DefNumberingOn 0 DefNumberingType 0 +DefNumberingRestart 1 DefNumberingLevel 0 DefNumberingStyle 0 +DefNumberingTabAfter 1 DefNumberingShowAllLevels 1 DefNumberingStart 1 +DefNumberingIncrement () DefNumberingPrefix () DefNumberingSuffix (.) +DefNumberingSeparator (*default) DefParaResource + +0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 +DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResource + +0 DefPageDimensions 12240 DefPageWidth 15840 DefPageHeight 1440 +DefInsideMargin 1080 DefOutsideMargin 1080 DefTopMargin 1080 +DefBottomMargin 0 DefOrientation 0 DefPageStyle 1 DefColumns 360 +DefGutter (%default) DefMasterPage ResDefEnd + +0 DefFirstLeft 0 DefDocSetup 1 DefNumPages 1 AutoPage 1 +DefStartPageNum () DefPageNumPrefix 1 DefGraphicLocation document + +1 DefAutoPage +0 (%default) 1 DefPage +1 DefAutoPage +0 (%default) 2 DefPage + +POLY_OBJECT POLY_EMPTY | DefPolyType + +0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 +DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 0 +DefMasterRef +MP_CPSUCC_LINK MP_CPPRED_LINK POLY_COLUMN | | DefSLinksFlags 0 DefStreamSucc 0 +DefStreamPred +1440 1080 11160 1080 11160 14760 1440 14760 4 +POLY_OBJECT POLY_EMPTY | (%default) 0 1 TextPolygon + +POLY_OBJECT POLY_TEXT | DefPolyType + +0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 +DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 +DefMasterRef + +MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | +DefSLinksFlags 4 DefStreamSucc 0 DefStreamPred 3 DefTextHandle +1440 1080 11160 1080 11160 14760 1440 14760 4 +POLY_OBJECT POLY_TEXT | (1) 0 2 TextPolygon + +3 asciitextstream +<(Courier) cf ><9 cs>The Henderson Library-- +by Syam Gadde +and Bo Whong + +The Henderson Library is a toolkit with which one can use Functional Geometry, +as proposed by Peter Henderson in his paper "Functional Geometry". This is a s +cheme by which "Picture"s can be described in an abstract data type, and a numb +er of functions can be applied to it. This results in a very elegant method to + produce complex pictures from simple ones. The example Henderson uses is "Squ +are Limit" by M. C. Escher, which can be constructed with four simple pictures +. + +------------------------ +ADTs and Type Synonyms + +The Picture data type is composed of eight different types of pictures. They a +re: + +data +Picture = Nil - empty picture + | Flip Picture - picture flipped on the y-axis + | Beside Float Picture Float Picture - two pictures placed side by sid +e + - in accordance to the ratio of t +he + - two floats + | Above Float Picture Float Picture - two pictures placed one on top +of + - another in accordance to the ra +tio + - of the two floats + | Rot Picture - picture is rotated 90 degrees < +eop> + - counterclockwise + | File String - picture is stored as an externa +l + - file + | Overlay Picture Picture - two pictures are drawn such tha +t + - one lays on top of the other + | Grid Int Int SegList - picture type that contains the +list + - of picture's line segments alon +g + - with the size of the inital pic +ture + +The type synonyms are pretty much self explanatory. + + Hostname- a string of the hostname + Filename - a string of the filename + IntPoint - a tuple of integers repres +enting + - the coordinates of a point + + IntSegment - a tuple of Intpoints repre +senting + - the endpoints of a line se +gment + IntSegList - a list of IntSegments + Point - same as IntPoint except in + place of + - intergers, they are floating points + Segment - same as IntSegment except +in place + - of intergers, they are floating + - points + SegList - same as IntsegList except +in place + - of intergers, they are floating + - points + Vector - a tuple of floating points + to + - to represent a vector + Vtriple - a 3-tuple of Vectors + HendQuartet - a 4-tuple of Integers for the s +ize + - of the Henderson window + PEnv - a tuple of a Filename and a Pic +ture + - for storing already opened file +s in + - in order to save time and memor +y + - when a file needs to be opened +more + - than once + +------------------------------------------------------------------------------- +---- +Function: create (an exported function from the HendersonLib) + +The purpose of the create function is to provide the user with a function to +draw a picture from a graphics interface. The user may choose to create a pict +ure +file by inputing the the lines and points manually into a file or (s)he may cho +ose +to use the create function. + +Functionality of create: + create :: Hostname - Filaname - Int - Int - IO() + +create takes as input a hostname, a filename, and two integers for the size of +the +window to be opened. Two windows should appear, one for the input of lines and + +another showing the current position of the mouse. These windows will be label +ed +accordingly. +To draw a line on the file window, move the cursor to the desired position, the +n +hit any key on the keybroad. This point will be the beginning of the line segme +nt. +Next move the cursor to the position of where the user wants the end of the lin +e +segment to be, then hit any key from the keyboard again. A line should appear. + +The coordinates of the endpoints of each line drawn will also be printed out o +nto +standard output. +To signal completion of a file, press any button on the mouse. The user must < +eop> +remember though that this is only applicable after a completed drawing of a lin +e. +For example, pressing the mouse button will not work if one of the endpoints of + a +line is drawn but the other endpoint is not. create will not recognize the mous +e +button press event until a second endpoint is drawn. + +Advantages of create: + provides a quick and fun way to create a picture file. + +Disadvantages of create: + If the file does not exist, create will create the file and then store the pic +ture + to it. However, if the file exists, create will automatically delete the cont +ents + of that file before storing the new picture. + +------------------------------------------------------------------------------- +---- +Function: modify (an exported function from the HendersonLib) + +The purpose of the modify function is to provide the user with a function make + +additions to an already existing picture file using a graphics interface. The +user +may choose to modify the picture file by adding the the lines and points manual +ly +into the file or (s)he may choose to use the modify function. + +Functionality of modify: + modify :: Hostname - Filaname - IO() + +modify takes as input a hostname and a filename. Tow windows should appear. Th +e +size of the draw window will be the same as the x and y coordinates already in +the +file. These windows will be labeled accordingly. The existing picture will app +ear +first before any input is allowed. +To draw a line on the file window, move the cursor to the desired position, the +n +hit any key on the keybroad. This point will be the beginning of the line segme +nt. +Next move the cursor to the position of where the user wants the end of the lin +e +segment to be, then hit any key from the keyboard again. A line should appear. + +The coordinates of the endpoints of each line drawn will also be printed out o +nto +standard output. +To signal completion of a file, press any button on the mouse. The user must < +eop> +remember though that this is only applicable after a completed drawing of a lin +e. +For example, pressing the mouse button will not work if one of the endpoints of + a +line is drawn but the other endpoint is not. modify will not recognize the mou +se +button press event until a second endpoint is drawn. + +Advantages of modify: + provides a quick and fun way to modify a picture file without having to go int +o + the file and manually add on the coordinates of the additional lines + +Disadvantages of modify: + Existing lines can not be deleted and any additional lines, whether intentiona +l or + unintentional, will be appended to the picture and stored in the file. + +-------------------------------------------------------- +Function: sendToDraw + +Type of sendToDraw: + sendToDraw :: XWindow - XScreen - XDisplay - + XPixel - XPixel - Plot - IO() + +Usage: + sendToDraw win scn dis fg_color bg_color plt + +'sendToDraw' is the most primitive function in the part of the Henderson +library that deals with X windows, and therefore, can be used as a very +powerful tool. It draws a Plot plt (see 'plot' function) in the given XWindow< +eop> +win, and on the given XScreen and XDisplay scn and dis, drawing the lines in +the foreground color. This function allows the programmer to draw more than +one Picture to the same window. + +Arguments: + win - the XWindow in which to draw plt + scn - the screen which contains win + dis - the display which contains scn + fg_color - an XPixel the color of which the plt will be drawn in. Note that< +eop> +this allows the programmer to draw different plt's in different colors. + bg_color - unused, but required. +-------------------------------------------------------- +Function: plot + +Type of 'plot': + plot :: Picture - VTriple - PEnv - ((Plot, PEnv) - IO()) - IO() + +Usage: + plot pic (a,b,c) env func + +The 'plot' function is needed to create a Plot which would be normally sent to< +eop> +a function such as sendToDraw. 'plot' converts a Picture pic into a format +that sendToDraw can deal with. +'plot' also takes three vectors which specify the bounding box in which the +Picture is to be drawn. The first vector (a) specifies the upper left corner +of the bounding box. The next two vectors specify the bounding box itself, +with respect to the first vector. This allows for non-rectangular bounding +boxes. For example, the vector triple ((50,50), (100,0), (0,100)) specifies +the following bounding box: + + (0,0)---------------------------------- + | + | (50,50) + | _______________ (150,0) + | | | + | | | + | | | + | | | + | | | + | |_____________| (150,150) + | (0,150) + + +A vector triple of ((0,0), (100,300), (0,100)) would specify: + + (0,0)------------------------------------- + ||\ + || \ + || \ + (0,100)|| \ + |\ \ + | \ \ + | \ \ + | \ \ (100,300) + | \ | + | \ | + | \ | + | \| (100,400) + +Arguments: + pic - the Picture to be converted + a - a vector specifying the upper left corner of the bounding box +of the picture. + b - a vector understood to start at 'a' and specifying the upper edge of + +the bounding box. + c - a vector understood to start at 'a' and specifying the left edge of +the bounding box. +-------------------------------------------------------- +Function: draw + +Type of draw: + draw :: Hostname - Picture - VTriple - HendQuartet - IO() + +Usage: + draw host pic (a,b,c) (m,n,p,q) + +'draw' is a higher-level function than sendToDraw, and is useful to use when +the programmer wishes only to draw one Picture on the screen. This function +does most of the work that the programmer would normally have to do when using< +eop> +sendToDraw. 'draw' opens a window at host with upper left coordinates m and n< +eop> +(on an X server that lets the user position any child window of the root +window, these coordinates mean nothing), and with width p and height q. +'draw' then calls 'plot' on pic and (a,b,c) and sends the result to sendToDraw, + +which finally draws the picture to the window. + +Arguments: + host - host on which to open a display, i.e. "tucan:0" + pic - the Picture to be drawn + (a,b,c) - the vector triple specifying the bounding box to be sent to +plot (see 'plot' function) + (m,n,p,q) - upper left corner x (m), upper left corner y (n), width (p), + +and height (q), of window to be opened. + +----------------------------------------------------------- + +Module: SquareLimit + +This module is a sample user module that can be used to draw Square Limit, a wo +odcut by M. C. Escher. To draw "SquareLimit" on your host, run the dialogue: +final host +where 'host' is the host running X, such as "turtle:0". + +To draw a slightly more interesting picture, tun the dialogue: +skewedfinal host +and it will draw "SquareLimit" in a bounding box shaped as a diamond. + + + + +POLY_OBJECT POLY_TEXT | DefPolyType + +0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 +DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 +DefMasterRef + +MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | +DefSLinksFlags 0 DefStreamSucc 2 DefStreamPred 3 DefTextHandle +1440 1080 11160 1080 11160 14760 1440 14760 4 +POLY_OBJECT POLY_TEXT | (2) 0 4 TextPolygon + +BeginProfile +(Number of Pages) (5) DefProfileString +(Language) (ENGLISH) DefProfileString +(Version) (IslandWrite Version 2.3) DefProfileString +(Creation Date) (gadde May 7, 1993 3:55 PM) DefProfileString +(Text Formats) (default) DefProfileString +(Container Formats) (default) DefProfileString +(Page Formats) (default) DefProfileString +(Fonts) (Courier) DefProfileString +(Fonts) (Times-Roman) DefProfileString +(File Path) () DefProfileString +(External Contents) () DefProfileString +(Title) () DefProfileString +(Status) () DefProfileString +(Distribution List) () DefProfileString +(Preparer) () DefProfileString +(Owner) () DefProfileString +(Author) () DefProfileString +(Superseded Documents) () DefProfileString +EndProfile + +pgscriptdone -- cgit v1.2.3