HALCON Reference Manual 10.0.2
Table of Contents / Graphics / Window ClassesClassesClasses | | | Operators

update_window_poseupdate_window_poseupdate_window_poseUpdateWindowPoseUpdateWindowPose (Operator)

Name

update_window_poseupdate_window_poseupdate_window_poseUpdateWindowPoseUpdateWindowPose — Modify the pose of a 3D plot.

Signature

update_window_pose( : : WindowHandle, LastRow, LastCol, CurrentRow, CurrentCol, Mode : )

Herror update_window_pose(const Hlong WindowHandle, double LastRow, double LastCol, double CurrentRow, double CurrentCol, const char* Mode)

Herror T_update_window_pose(const Htuple WindowHandle, const Htuple LastRow, const Htuple LastCol, const Htuple CurrentRow, const Htuple CurrentCol, const Htuple Mode)

Herror update_window_pose(const HTuple& WindowHandle, const HTuple& LastRow, const HTuple& LastCol, const HTuple& CurrentRow, const HTuple& CurrentCol, const HTuple& Mode)

void HWindow::UpdateWindowPose(const HTuple& LastRow, const HTuple& LastCol, const HTuple& CurrentRow, const HTuple& CurrentCol, const HTuple& Mode) const

void HOperatorSetX.UpdateWindowPose(
[in] VARIANT WindowHandle, [in] VARIANT LastRow, [in] VARIANT LastCol, [in] VARIANT CurrentRow, [in] VARIANT CurrentCol, [in] VARIANT Mode)

void HWindowX.UpdateWindowPose(
[in] VARIANT LastRow, [in] VARIANT LastCol, [in] VARIANT CurrentRow, [in] VARIANT CurrentCol, [in] BSTR Mode)

static void HOperatorSet.UpdateWindowPose(HTuple windowHandle, HTuple lastRow, HTuple lastCol, HTuple currentRow, HTuple currentCol, HTuple mode)

void HWindow.UpdateWindowPose(HTuple lastRow, HTuple lastCol, HTuple currentRow, HTuple currentCol, string mode)

void HWindow.UpdateWindowPose(double lastRow, double lastCol, double currentRow, double currentCol, string mode)

Description

The operator update_window_poseupdate_window_poseupdate_window_poseUpdateWindowPoseUpdateWindowPose provides an easy way to modify the pose of the height field displayed by disp_objdisp_objdisp_objDispObjDispObj if the paint mode is set to '3d_plot'"3d_plot""3d_plot""3d_plot""3d_plot" using set_paintset_paintset_paintSetPaintSetPaint.

Two window coordinates (LastRowLastRowLastRowLastRowlastRow,LastColLastColLastColLastCollastCol) and (CurrentRowCurrentRowCurrentRowCurrentRowcurrentRow, CurrentColCurrentColCurrentColCurrentColcurrentCol) are transformed into rotation, scaling, or movement depending on ModeModeModeModemode. This window coordinates must be provided with respect to the current image part. As a consequence, this coordinates are subpixel coordinates. Given the current image part (row1,column1,row2,column2), the upper left corner corresponds to the coordinate (row1 - 0.5, col1 - 0.5). Accordingly, the bottom right corner corresponds to the coordinate (row2 - 0.5, col2 - 0.5). Use get_mposition_sub_pixget_mposition_sub_pixget_mposition_sub_pixGetMpositionSubPixGetMpositionSubPix or get_mbutton_sub_pixget_mbutton_sub_pixget_mbutton_sub_pixGetMbuttonSubPixGetMbuttonSubPix to obtain this coordinates directly.

If ModeModeModeModemode is set to 'rotate'"rotate""rotate""rotate""rotate", the height field is rotated using a virtual trackball model. Both points are projected on a sphere centered in the center of the window WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle. The circular arc between this two projections corresponds to the rotation applied to the height field.

If ModeModeModeModemode is set to 'scale'"scale""scale""scale""scale", zooming is reduced if CurrentRowCurrentRowCurrentRowCurrentRowcurrentRow is greater than LastRowLastRowLastRowLastRowlastRow and increased if CurrentRowCurrentRowCurrentRowCurrentRowcurrentRow is smaller than LastRowLastRowLastRowLastRowlastRow.

If ModeModeModeModemode is set to 'move'"move""move""move""move", the input points are projected onto the plane through the center of the height field parallel to the viewing plane. The center of the height field is moved in this plane by the distance between both projections.

If ModeModeModeModemode is set to 'move_plane'"move_plane""move_plane""move_plane""move_plane", the input points are projected on the plane given by height zero. The height field is moved in this plane by the distance between both projections.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Window identifier.

LastRowLastRowLastRowLastRowlastRow (input_control)  point.y HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the first point.

LastColLastColLastColLastCollastCol (input_control)  point.x HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the first point.

CurrentRowCurrentRowCurrentRowCurrentRowcurrentRow (input_control)  point.y HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the second point.

CurrentColCurrentColCurrentColCurrentColcurrentCol (input_control)  point.x HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the second point.

ModeModeModeModemode (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Navigation mode.

Default value: 'rotate' "rotate" "rotate" "rotate" "rotate"

List of values: 'rotate'"rotate""rotate""rotate""rotate", 'scale'"scale""scale""scale""scale", 'move'"move""move""move""move", 'move_plane'"move_plane""move_plane""move_plane""move_plane"

Example (HDevelop)

* Interactive display of a height field
dev_set_paint ('3d_plot')
while (1)
  dev_set_check ('~give_error')
  get_mposition_sub_pix (WindowHandle, Row, Column, Button)
  dev_set_check ('give_error')
  if (ButtonDown and (Button=0))
    ButtonDown := false
  endif
  if (not(Button=0))
    if (ButtonDown)
      if (Button = 1)
        mode := 'rotate'
      endif
      if (Button = 4)
        mode := 'scale'
      endif
      if (Button = 5)
        mode := 'move'
      endif
      update_window_pose (WindowHandle, lastRow, lastCol, Row, Column, mode)
    else
      if (Button = 2)
        break
      endif
      ButtonDown := true
    endif
    lastCol := Column
    lastRow := Row
  endif
  dev_display (Image)
endwhile

Possible Predecessors

set_paintset_paintset_paintSetPaintSetPaint, open_windowopen_windowopen_windowOpenWindowOpenWindow, get_mposition_sub_pixget_mposition_sub_pixget_mposition_sub_pixGetMpositionSubPixGetMpositionSubPix, get_mbutton_sub_pixget_mbutton_sub_pixget_mbutton_sub_pixGetMbuttonSubPixGetMbuttonSubPix

Possible Successors

disp_imagedisp_imagedisp_imageDispImageDispImage

See also

unproject_coordinatesunproject_coordinatesunproject_coordinatesUnprojectCoordinatesUnprojectCoordinates

Module

Foundation


Table of Contents / Graphics / Window ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH