1\Chapter{Graphic Sheets - Basic graphic operations} 2 3This chapter describes how graphics are accessed in {\XGAP} via the lowest 4library functions for graphic sheets. These functions are used in all other 5parts of {\XGAP} and you normally only need to know them if you want to 6display other things than graphic posets and subgroup lattices. 7 8%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9\Section{Graphic Sheet Objects} 10 11\FileHeader[1]{sheet} 12 13\Declaration{GraphicSheet} 14 15Here is the documentation for the operations to control the callback 16functions: 17 18\Declaration{InstallCallback} 19\Declaration{RemoveCallback} 20\Declaration{Callback} 21 22\FileHeader[2]{sheet} 23 24\Declaration{IsAlive} 25 26The following operations apply to graphic sheets: 27 28\Declaration{Close} 29\Declaration{Resize} 30\Declaration{WindowId} 31\Declaration{SetTitle} 32\Declaration{SaveAsPS} 33\Declaration{FastUpdate} 34 35%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 36\Section{Graphic Objects in Sheets} 37 38\FileHeader[1]{gobject} 39 40\Declaration{IsGraphicObject} 41 42\bigskip% 43 44*Constructors:* 45 46\Declaration{Box} 47\Declaration{Circle} 48\Declaration{Disc} 49\Declaration{Diamond} 50\Declaration{Rectangle} 51\Declaration{Line} 52\Declaration{Text} 53 54 55\bigskip% 56 57*Operations for graphic objects:* 58 59\Declaration{Connection} 60\Declaration{Disconnect} 61 62\Declaration{Draw} 63\Declaration{Delete}[gobject] 64\Declaration{Destroy} 65\Declaration{Revive} 66\Declaration{Move}[gobject] 67\Declaration{MoveDelta} 68\Declaration{PSString} 69\Declaration{PrintInfo} 70\Declaration{Recolor}[gobject] 71\Declaration{Reshape}[gobject] 72\>`\\in'{in!for graphic objects}@{`in'!for graphic objects} 73 74This infix operation needs a vector of two integers to its left and a graphic 75object to its right (``vector of two integers'' means a list of two 76integers e.g. `[15,9]'). It determines, if the position given by the two 77integer coordinates is inside (e.g. for boxes) or on (e.g. for lines) the 78graphic objects. Returns a boolean value. 79\Declaration{Change} 80\Declaration{Relabel}[gobject] 81\Declaration{SetWidth}[gobject] 82\Declaration{Highlight}[gobject] 83 84%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 85\Section{Colors in XGAP} 86 87\label{Color Models} 88 89\FileHeader[1]{color} 90 91\Declaration{COLORS} 92 93 94%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 95\Section{Operations for Graphic Objects} 96 97The following table gives an overview over the supported graphic objects and 98the functions which are applicable respectively: 99 100Here are the supported graphic object types: `Box', `Circle', `Disc', 101`Diamond', `Rectangle', `Line', `Text', `Vertex'. 102 103These functions apply to all graphic object types: 104`Draw', `Delete', `Destroy', `Revive', `Move', `MoveDelta', `PSString', 105`PrintInfo', `ViewObj', `Recolor', `Reshape', `\\in', `WindowId' 106 107In addition, the operation `Relabel' applies to objects of types `Line', 108`Text', and `Vertex'; the operation `SetWidth' applies to objects of types 109`Diamond', `Rectangle', `Circle', and `Line'. There is also `Change' for a 110`Line' and `Highlight' for a `Vertex'. 111 112 113%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 114\Section{Global Information} 115 116There are some global data structures which can and should be consulted if 117certain information is needed. The first (about color handling) was already 118described in section "Color Models". The second is for vertices: 119 120\>`VERTEX'{VERTEX!record}@{`VERTEX'!record} V 121 122 This globally bound record contains the following components: 123 124\beginitems 125`circle' & integer value for the vertex type ``circle'' 126 127`diamond' & integer value for the vertex type ``diamond'' 128 129`rectangle' & integer value for the vertex type ``rectangle'' 130 131`radius' & radius in pixels of a vertex on the screen 132 133`diameter' & diameter in pixels of a vertex on the screen 134\enditems 135 136\bigskip% 137 138The third structure is about the available fonts. 139 140\>`FONTS' V 141 142This globally bound record has the following components: `tiny', `small', 143`normal', `large', `huge' and `fonts'. The first 5 are itself records each 144for one available font. They have components `name' for the name of the font 145and `fontInfo', which is a list of 3 integers. The first is the maximal size 146of a character above the baseline in pixels, the second is the maximal size 147of a character below the baseline in pixels, and the third is the width 148in pixels of *all* characters, because it is always assumed, that the 149fonts are non-proportional. 150 151\Declaration{FontInfo} 152 153\bigskip% 154 155There is another global structure: 156 157\>`BUTTONS' V 158 159This record contains the following components: `left' and `right' contain a 160number for the left resp. right mouse button. `shift' and `ctrl' contain 161codes for the respective keys on the keyboard. 162 163\bigskip% 164 165You should always use these global data instead of hardwiring any integers into 166your code. 167