draw_xld ( : ContOut : WindowHandle, Rotate, Move, Scale, KeepRatio : )

Interactive drawing of a contour.

draw_xld returns a contour, which has been created interactively by the user in the window.

Directly after calling draw_xld you can add contour points by clicking with the left mouse button in the window at the desired positions. You delete the point appended last by pressing the Ctrl key. As soon as you add three contour points, 5 so-called pick points are displayed, one in the middle and 4 at the corners of the surrounding rectangle. By clicking on a pick point you can close the contour or open it again. If the contour is closed, the pick points are displayed in form of squares, otherwise they are shaped like a 'u'.

If the contour is closed you can 
- move contour points by clicking with the 
  left mouse button on a point marked by a rectangle and keep the mouse 
  button pressed while moving the mouse. 
- insert contour points by clicking with the left mouse button in the 
  vicinity of a line and then move the mouse to the position where you want 
  the new point to be placed.
- delete contour points by selecting the point which should be deleted with 
  the left mouse button and then press the Ctrl key.

By pressing the Shift key, you can switch into the transformation mode. In this mode you can rotate, move, and scale the contour as a whole, but only if you set the parameters Rotate, Move, and Scale, respectively, to true. Instead of the pick points, 3 symbols are displayed with the contour: a cross in the middle, an arrow to the right, if Rotate is set to true, and a double-headed arrow to the upper right, if Scale is set to true.
You can 
- move the contour by clicking the left mouse button on the cross in the 
  center and then dragging it to the new position.
- rotate it by clicking with the left mouse button on the arrow and then 
  dragging it, till the contour has the right direction.
- scale it by dragging the double arrow. To keep the ratio the parameter 
  KeepRatio has to be set to true.

Pressing the right mouse button terminates the procedure.


Parameters

ContOut (output_object)
xld_cont -> object
Modified contour.

WindowHandle (input_control)
window -> integer
Window_id.

Rotate (input_control)
string -> string
Enable rotation?
Default value: 'true'
List of values: 'true', 'false'

Move (input_control)
string -> string
Enable moving?
Default value: 'true'
List of values: 'true', 'false'

Scale (input_control)
string -> string
Enable scaling?
Default value: 'true'
List of values: 'true', 'false'

KeepRatio (input_control)
string -> string
Keep ratio while scaling?
Default value: 'true'
List of values: 'true', 'false'


Result

draw_xld returns 2 (H_MSG_TRUE), if the window is valid and the needed drawing mode (see set_insert) is available. If necessary, an exception handling is raised.


Parallelization Information

draw_xld is reentrant, local, and processed without parallelization.


Possible Predecessors

open_window


Possible Successors

reduce_domain, disp_region, set_colored, set_line_width, set_draw, set_insert


Alternatives

draw_rectangle2, draw_rectangle1, draw_rectangle2, draw_region


See also

gen_rectangle2, draw_circle, draw_ellipse, set_insert


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH