update_window_poseT_update_window_poseUpdateWindowPoseUpdateWindowPoseupdate_window_pose (算子)

名称

update_window_poseT_update_window_poseUpdateWindowPoseUpdateWindowPoseupdate_window_pose — 修改三维绘图的姿态。

签名

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

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

void UpdateWindowPose(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 HString& Mode) const

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

void HWindow::UpdateWindowPose(double LastRow, double LastCol, double CurrentRow, double CurrentCol, const char* Mode) const

void HWindow::UpdateWindowPose(double LastRow, double LastCol, double CurrentRow, double CurrentCol, const wchar_t* Mode) const   ( Windows only)

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)

def update_window_pose(window_handle: HHandle, last_row: Union[float, int], last_col: Union[float, int], current_row: Union[float, int], current_col: Union[float, int], mode: str) -> None

描述

算子 update_window_poseupdate_window_poseUpdateWindowPoseUpdateWindowPoseUpdateWindowPoseupdate_window_pose provides an easy way to modify the pose of the height field displayed by disp_objdisp_objDispObjDispObjDispObjdisp_obj if the paint mode is set to '3d_plot'"3d_plot""3d_plot""3d_plot""3d_plot""3d_plot" using set_paintset_paintSetPaintSetPaintSetPaintset_paint

Two window coordinates (LastRowLastRowLastRowLastRowlastRowlast_row,LastColLastColLastColLastCollastCollast_col) and (CurrentRowCurrentRowCurrentRowCurrentRowcurrentRowcurrent_row, CurrentColCurrentColCurrentColCurrentColcurrentColcurrent_col) are transformed into rotation, scaling, or movement depending on ModeModeModeModemodemode. 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_pixGetMpositionSubPixGetMpositionSubPixGetMpositionSubPixget_mposition_sub_pix or get_mbutton_sub_pixget_mbutton_sub_pixGetMbuttonSubPixGetMbuttonSubPixGetMbuttonSubPixget_mbutton_sub_pix to obtain this coordinates directly.

If ModeModeModeModemodemode is set to 'rotate'"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 WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle. The circular arc between this two projections corresponds to the rotation applied to the height field.

If ModeModeModeModemodemode is set to 'scale'"scale""scale""scale""scale""scale", zooming is reduced if CurrentRowCurrentRowCurrentRowCurrentRowcurrentRowcurrent_row is greater than LastRowLastRowLastRowLastRowlastRowlast_row and increased if CurrentRowCurrentRowCurrentRowCurrentRowcurrentRowcurrent_row is smaller than LastRowLastRowLastRowLastRowlastRowlast_row

If ModeModeModeModemodemode is set to 'move'"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 ModeModeModeModemodemode is set to 'move_plane'"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.

执行信息

参数

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (输入控制)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

窗口句柄。

LastRowLastRowLastRowLastRowlastRowlast_row (输入控制)  point.y HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Row coordinate of the first point.

LastColLastColLastColLastCollastCollast_col (输入控制)  point.x HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Column coordinate of the first point.

CurrentRowCurrentRowCurrentRowCurrentRowcurrentRowcurrent_row (输入控制)  point.y HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Row coordinate of the second point.

CurrentColCurrentColCurrentColCurrentColcurrentColcurrent_col (输入控制)  point.x HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Column coordinate of the second point.

ModeModeModeModemodemode (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Navigation mode.

默认值: 'rotate' "rotate" "rotate" "rotate" "rotate" "rotate"

值列表: 'move'"move""move""move""move""move", 'move_plane'"move_plane""move_plane""move_plane""move_plane""move_plane", 'rotate'"rotate""rotate""rotate""rotate""rotate", 'scale'"scale""scale""scale""scale""scale"

示例(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

可能的前趋

set_paintset_paintSetPaintSetPaintSetPaintset_paint, open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window, get_mposition_sub_pixget_mposition_sub_pixGetMpositionSubPixGetMpositionSubPixGetMpositionSubPixget_mposition_sub_pix, get_mbutton_sub_pixget_mbutton_sub_pixGetMbuttonSubPixGetMbuttonSubPixGetMbuttonSubPixget_mbutton_sub_pix

可能的后继

disp_imagedisp_imageDispImageDispImageDispImagedisp_image

另见

unproject_coordinatesunproject_coordinatesUnprojectCoordinatesUnprojectCoordinatesUnprojectCoordinatesunproject_coordinates

模块

基础