next up previous contents index
Next: Layers Up: Main Functions 3 Previous: Main Functions 3   Contents   Index

Grid

(int) ShowGrid(on, win)
This function sets whether or not the grid is shown in a window. If the first argument is nonzero, the grid will be shown, otherwise the grid will not be shown. The second argument is an integer representing the drawing window: 0 for the main window, and 1-4 for sub-windows. The change will not be visible until the window is redrawn (one can call Redraw). If success, 1 is returned, or 0 is returned if the window does not exist.

(int) ShowAxes(style, win)
This function sets the axes presentation style in physical mode windows. The first argument is an integer 0-2, where 0 suppresses drawing of axes, 1 indicates plain axes, and 2 (or anything else) indicates axes with a box at the origin. The second argument is an integer representing the drawing window: 0 for the main window, 1-4 for sub-windows. Axes are never shown in electrical mode windows. On success, 1 is returned. If the window does not exist or is not showing a physical view, 0 is returned. The change will not be visible until the window is redrawn (one can call Redraw).

(int) SetGrid(interval, snap, win)
This function sets the grid parameters for the window indicated by the third argument, which is 0 for the main window or 1-4 for the sub-windows. The interval argument sets the grid line spacing, in microns. The snap number supplies the number of snap points per grid interval if positive, or the number of grid intervals per snap point if negative. Values from -10 - 10 are accepted for this parameter. Values of 0.01 or larger are valid for the interval, if not 0. Either argument can be 0, in which case the present parameter is retained.

For electrical mode windows, the snap points must be on multiples of one micron. If not, this function returns 0 and the grid is unchanged. The function also returns 0 if the window argument does not correspond to an existing window. The return is 1 if the operation succeeds.

The function does not redraw the window. The Redraw function can be called to redraw the window if necessary.

(real) GetGridInterval(win)
This function returns the grid interval in microns for the grid in the window indicated by the argument, which is 0 for the main window or 1-4 for the sub-windows. The function fails if the argument does not correspond to an existing window.

(int) GetGridSnap(win)
This function returns the snap number for the grid in the window specified by the argument, which is 0 for the main window or 1-4 for the sub-windows. The snap number determines the number of snap coordinates between grid intervals if positive, or grid intervals per snap coordinate if negative. The function fails if the argument does not correspond to an existing window.

(int) SetGridStyle(style, win)
This function sets the line style used for grid rendering. The first argument is an integer mask that defines the on-off pattern. The pattern starts at the most significant `1' bit and continues through the least significant bit, and repeats. Set bits are rendered as the visible part of the pattern. If the style is 0, a dot is shown at each grid point. Passing -1 will give continuous lines. The second argument is an integer representing the drawing window: 0 for the main window, 1-4 for sub-windows. The function returns 1 on success, 0 if the window does not exist. The change will not be visible until the window is redrawn (one can call Redraw).

(int) GetGridStyle(win)
This function returns the line style mask used for rendering the grid in the given window. The mask has the interpretation described in the description of SetGridStyle. The argument is an integer representing the window: 0 for the main window, and 1-4 for sub-windows. If the window does not exist, 0 is returned.

(int) SetGridCrossSize(xsize, win)
This applies only to grids with style 0 (dot grid). The xsize is an integer 0-6 which indicates tne number of pixels to draw in the four compass directions around the central pixel. Thus, for nonzero values, the ``dot'' is rendered as a small cross. The second argument is an integer representing the drawing window: 0 for the main window, 1-4 for subwindows. The function returns 1 on success, 0 if the window does not exist or the style is nonzero. The change will not be visible until the window is redrawn (one can call Redraw).

(int) GetGridCrossSize(win)
This returns an integer 0-6, which will be nonzero only for grid style 0 (dot grid), and if the ``dots'' are being rendered as small crosses via a call to SetGridCrossSize or otherwise. The argument is an integer representing the window: 0 for the main window, and 1-4 for subwindows. If the window does not exist, 0 is returned.

(int) SetGridOnTop(ontop, win)
This function sets whether the grid is shown above or below rendered objects. If the first argument is nonzero, the grid will be shown above rendered objects. The second argument is an integer representing the drawing window: 0 for the main window and 1-4 for sub-windows. The function returns 1 on success, 0 if the window does not exist. The change will not be visible until the window is redrawn (one can call Redraw).

(int) GetGridOnTop(win)
This function returns 1 is the grid is shown on top of objects. The argument is an integer representing the drawing window: 0 for the main window and 1-4 for sub-windows. If the grid is shown below rendered objects, 0 is returned. If the window does not exist, -1 is returned.

(int) ClipToGrid(coord, win)
The first argument to this function is a coordinate in microns. The return value is the coordinate, in microns, snapped to the nearest snap point of the grid of the window given in the second argument. The second argument is 0 for the main window, or 1-4 for the sub-windows. The function fails if the window argument does not correspond to an existing window.

Note that this function must be called twice for an x,y coordinate pair. This function ignores the edge-snapping modes, only taking into account the grid resolution and snap values.


next up previous contents index
Next: Layers Up: Main Functions 3 Previous: Main Functions 3   Contents   Index
Stephen R. Whiteley 2012-04-01