poIImagePlane SetUserTransform
Sets the 2D or 3D user transform for the image plane.
Syntax
Imageplane_handle SetUserTransformxformStr
Application
HyperView Tcl Modify
Description
The image plane maintains a separate user transform to track the position, rotation, and scaling applied to the image plane. This command allows you to set/modify the transform. SetUserTransformList does not alter any data regarding the alignment of a 3D image plane to a model. See GetAlignmentData, LocateBy3Points, and LocateBy2Points for additional information.
Inputs
- xformStr
- The new transform data. The format is different, depending on whether the image plane is in 3D mode or foreground/background mode. In 3D mode, the transform string consists of twelve floats, representing the rotation about X, Y, and Z, and the translation in X, Y, and Z. For foreground/background modes, the transform string consists of four floats, representing the X and Y scaling factor followed by the X and Y translation for the image.
Example
hwi OpenStack
if {[catch {
::post::GetPostHandle client_handle
hwi GetSessionHandle session_handle
client_handle GetImagePlaneCtrlHandle ipc_handle
set ipid1 [ipc_handle AddImagePlane Logo1]
ipc_handle GetImagePlaneHandle imageplane_handle $ipid1
imageplane_handle SetFileName g:/samples2/VideoOverlay/Altair_logo.jpg
imageplane_handle SetMode background
imageplane_handle SetCrop 0 0 0.9995 0.995
imageplane_handle SetFilterType ColorAlpha;
imageplane_handle SetFilterMode Equal
imageplane_handle SetColorAlphaTarget "255 255 255"
imageplane_handle SetColorAlphaTolerance 18
imageplane_handle SetMipMapMode Linear1
imageplane_handle SetMode 3D
imageplane_handle SetUserTransform "1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 43.82 43.38"
imageplane_handle ReleaseHandle;
set ipid2 [ipc_handle AddImagePlane Background]
ipc_handle GetImagePlaneHandle imageplane_handle $ipid2
imageplane_handle SetFileName g:/samples2/VideoOverlay/Ts_Tall_rock_and_clouds_1600x1200.jpg
imageplane_handle SetMode background
imageplane_handle SetUserTransform "0.997 0.649 0.0 -0.17"
imageplane_handle SetMaintainAspectRatio false
imageplane_handle ReleaseHandle
client_handle Draw
} result]} {
global errorInfo;
puts stderr $result;
puts "[session_handle GetError]";
puts stderr "*** Tcl TRACE ***";
puts stderr $errorInfo;
} else {
puts "No errors.";
puts "Warnings: ";
puts " [session_handle GetError]";
}
hwi CloseStack
Errors
Returns HW_InvalidHandle if the image plane handle is invalid, or HW_Error if the transform string is invalid.