SclDragPoint and SclDragPointConstrained
Overview
Provide feedback to define the displacement of a point from an existing position to a new position.
Note that the actual coordinates of the point are not changed. This function just returns the difference in X,Y and Z values only.
Synopsis
SclDragPoint $PointHandle $PromptText delx dely delz
SclDragPointConstrained $PointHandle $PromptText $Constraint delx dely delz
Description
The text in the PromptText argument is displayed to instruct the user to take the necessary action required to select and drag a point to a new location.
This command is only appropriate for use in a window that contains a 3D Graphics component.
The delta values that are returned to define the change in the X,Y and Z values from the current location of the point to the location where the mouse button is released.
The constrained variant restricts the freedom of the movement to be in a particular plane or direction.
Arguments
- PointHandle
- PromptText
- Constraint
- XYZ
- XY, YZ, XZ
- X, Y, Z
- delx, dely, delz
Passed by reference. The unique handle to the selected point is returned in this variable. This handle may be used in subsequent Scl commands to modify the coordinates or other attributes of the point.
Passed by value. The value of this argument is displayed in the graphics prompting region to instruct the user to perform the actions to select and move the point.
The movement of the point to its new location may be constrained to be only in a plane of interest or to just a direction of interest. Permitted values include:
Three degrees of freedom. Movement may be in any direction and is the same as using SclDragPoint.
Two degrees of freedom. Movement will only occur in the specified plane.
One degree of freedom. Movement will only occur in the specified direction.
Passed by reference. These variables are assigned the X, Y and Z values of change in location of the selected point.
Returns
The SclDragPoint command returns $SCL_OK if successful and $SCL_ERROR if escape is pressed.
Examples
# Drag a point with 3 degrees of freedom
set status [SclDragPoint point "Drag a point to a new location" delx dely delz]
if { $status == $SCL_OK } {
puts "Point coordinates = ($delx, $dely, $delz)"
} else {
puts "Error draging point - probably cancelled by user"
}
# drag a point in the XY plane only
set status [SclDragPointConstrained point "Drag a point to a new location" XY \
delx dely delz]
if { $status == $SCL_OK } {
puts "Point coordinates = ($delx, $dely, $delz)"
} else {
puts "Error draging point - probably cancelled by user"
}
# drag a point in the Z direction only
set status [SclDragPointConstrained point "Drag a point to a new location" Z \
delx dely delz]
if { $status == $SCL_OK } {
puts "Point coordinates = ($delx, $dely, $delz)"
} else {
puts "Error draging point - probably cancelled by user"
}