enterPolygon
enterPolygon( [?promptsl_promptList] [?pointsl_pointList] [?wantPointsx_pointLimit] [?forms_form] [?addPointProct_addProcName] [?delPointProct_delProcName] [?initProct_initProcName] [?doneProct_doneProcName] [?formProct_formProcName] [?dontDrawg_dontDraw] [?alwaysMapg_alwaysMap] [?acceptStringg_acceptString] [?acceptNumberg_acceptNumber] [?noInfixg_noInfix] [?cmdNamet_cmdName] [?cursorx_cursor ] ) =>l_point_list/nil
Description
Digitizes a polygon in the current window.
The function does not allow entry of points that result in a self-intersecting polygon. It also removes any co-linear points.
Arguments
|
List of points to start the polygon. If specified, all points are adjusted. If the list terminates with a point identical to the first point, the adjusted points are returned with no further interaction. If not, the given points are displayed with connecting lines, and a rubberbanding line is drawn from the last point to the current cursor position. Each successive point entered causes a new permanent segment between that point and the previous point. The function terminates when a point identical to the first point is entered or when the function is explicitly terminated with finishEnterFun or cancelEnterFun. |
|
|
Maximum number of points to be specified. If the x_pointLimit argument is supplied, the function returns the list of points after it reaches this number. In this case, the last two points do not need to be identical to terminate the function. |
|
|
Options form created with |
|
|
Name of the SKILL function to be called when a point is entered. |
|
|
Name of the SKILL function to be called when a point is deleted. |
|
|
Name of the SKILL function to be called immediately after the enterfunction is started and before any data entry. |
|
|
Name of the SKILL function to be called when the enterfunction is terminated. |
|
|
Name of the SKILL function to be called when the options form is displayed. |
|
|
Determines whether or not to immediately display the options form. |
|
|
Determines whether or not to accept string input without terminating the enterfunction. |
|
|
Determines whether or not to accept numeric input without terminating the enterfunction. |
|
|
Name you associate with the enterfunction. If the command name is set, it can be accessed with |
|
|
An integer argument that will default to an appropriate cursor. For example, |
|
Value Returned
|
The list of points that have been entered. If the function is terminated by returning to the initial point, that point appears at the beginning and at the end of the returned list. |
|
Retrieve data through the callback procedure t_doneProcName instead of using the return value for this enterfunction.
Examples
Displays the prompt Enter the first point on the prompt line. When you enter point p1 the prompt changes to Enter the next point. No rubber band line appears between p1 and the current cursor location because the dontDraw flag is specified.
procedure( polyDone( w done pts )
if( done then
printf("Polygon entered was %L.\n" pts)
dbCreatePolygon( w->editCellView
list( "cut" "drawing" )
pts )
else
println("Polygon entry aborted.")
)
)
enterPolygon( ?prompts
list( "Enter the first point."
"Enter the next point." )
?doneProc "polyDone"
?dontDraw t
)
Enter point p2. The prompt reads the same—“Enter the next point”—because the second prompt in the list is used for any points after the first. Continue with p3. Now enter p4 at the same location as p1. doneProc creates the polygon on the cut drawing layer and prints out the points entered. Here p4 is the same point as p1.
The polygon entered was ( p1 p2 p3 p4).
The enterfunction returns the point list:
( p1 p2 p3 p4 )

Related Topics
Return to top