SclDragRectCentreCorner
Overview
Uses interactive graphical feedback to define a rectangle by defining its centre and a corner location using the mouse.
Synopsis
SclDragRectCentreCorner $prompt x1 y1 z1 x2 y2 z2
Description
Displays a prompt to instruct the user what action must be performed.
The user initiates the drag feedback by depressing the mouse button. Dragging the mouse with the button depressed causes the rectangle to adjust in size in accordance with the mouse motion.
On release of the mouse button the coordinates of the rectangle centre and the coordinates of the button release point are returned in the appropriate variables.
This command only operates in frames that have 2D or 3D graphics viewports present.
Arguments
- prompt
- x1, y1, z1
- x2, y2, z2
Pass by value. The text that will be displayed to instruct the user to perform the mouse click and drag action.
Pass by reference. Names of the variables that will acquire the values of the location where the mouse button is initially depressed, i.e. the centre of the rectangle. These coordinates are real world values, i.e. they are not screen pixel coordinates, with the Z value being on the plane onto which the image is being projected.
Pass by reference. Names of the variables that will acquire the values of the location where the mouse button is released, i.e. a corner of the rectangle. These coordinates are real world values, i.e. they are not screen pixel coordinates, with the Z value being on the plane onto which the image is being projected.
Returns
The SclDragRectCentreCorner command returns $SCL_OK if successful and $SCL_ERROR if escape is pressed.
Examples
set prompt "Create a rectangle using the mouse to click and drag" set status [SclDragRectCentreCorner $prompt x1 y1 z1 x2 y2 z2] puts "status=$status, centre position x, y, z= $x1 $y1 $z1, corner position x, y, \ z=$x2 $y2 $z2"