draw_xld_mod ( ContIn : ContOut : WindowHandle, Rotate, Move, Scale, KeepRatio, Edit : )

Interactive modification of a contour.

draw_xld_mod returns a contour, which has been interactively modified by the user in the window.

You can modify the contour in two ways: by editing the contour itself, e.g., by inserting or moving contour points, or by transforming the contour as a whole, e.g., by rotating moving or scaling it. Note that you can only edit a contour if Edit is set to true. Similarly, you can only rotate, move or scale it if Rotate, Move, and Scale, respectively, are set to true.

draw_xld_mod starts in the transformation mode. In this mode, the contour is displayed together with 3 symbols: 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. To switch into the edit mode, press the Shift key; by pressing it again, you can switch back into the transformation mode.

Transformation Mode
- To move the contour, click with the left mouse button on the cross in the 
  center and then drag it to the new position´, i.e., keep the mouse button 
  pressed while moving the mouse.
- To rotate it, click with the left mouse button on the arrow and then drag it, 
  till the contour has the right direction.
- Scaling is achieved by dragging the double arrow. 
  To keep the ratio the parameter KeepRatio has to be set to true.

Edit Mode
In this mode, the contour is display together with 5 pick points, which are 
located in the middle and at the corners of the surrounding rectangle. If 
the contour is closed, the pick points are displayed as squares, otherwise 
shaped like a 'u'. By clicking on a pick point, you can close an open 
contour and vice versa. Depending on the state of the contour, you can 
perform different modifications.
Open contours (pick points shaped like a 'u')
- To append points, click with the left mouse button in the window and a new 
  point is added at this position. 
- You can delete the point appended last by pressing the Ctrl key.
- To move or insert points, you must first close the contour by clicking on 
  one of the pick points.
Closed contours (square pick points)
- To move a point, click with the left mouse button on a point marked by a 
  rectangle and then drag it to the new position.
- To insert a point, click 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.
- To delete a point, select the point which should be deleted with the left 
  mouse button and then press the Ctrl key.

Pressing the right mouse button terminates the procedure.


Parameters

ContIn (input_object)
xld_cont -> object
Input contour.

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'

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


Result

draw_xld_mod 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_mod 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