vtk初学者:vtk图像窗位和窗框鼠标操作

 先记三个vtk鼠标操作的类,用于用鼠标对vtk窗口中视图进行操作

vtkSmartPointer<vtkInteractorStyleTrackballActor> style = vtkSmartPointer<vtkInteractorStyleTrackballActor>::New();

vtkSmartPointer<vtkInteractorStyleUnicam> style2 = vtkSmartPointer<vtkInteractorStyleUnicam>::New();
vtkSmartPointer<vtkInteractorStyleTrackballCamera> style3 = vtkSmartPointer<vtkInteractorStyleTrackballCamera>::New();

     interactor->SetInteractorStyle(style);        //定义一下,连接下交互类就OK了
     interactor->SetInteractorStyle(style2);
    interactor->SetInteractorStyle(style3);

2018 7/25

 

  1. // 总共10种交互方式 下面是八种  
  2. //   vtkInteractorStyleTrackballCamera *style = //常用的方式 移动摄像机  
  3. //     vtkInteractorStyleTrackballCamera::New();  
  4. //   iren->SetInteractorStyle(style);  
  5. // vtkInteractorStyleTrackballActor *style = //移动对象  
  6. //    vtkInteractorStyleTrackballActor::New();  
  7. // iren->SetInteractorStyle(style);  
  8. // For a 3-button mouse, the left button is for rotation, the right button for zooming,   
  9. //the middle button for panning, and ctrl + left button for spinning.   
  10. //(With fewer mouse buttons, ctrl + shift + left button is for zooming,   
  11.     //and shift + left button is for panning.)  
  12.   
  13. //   vtkInteractorStyleUnicam *style = //只有放大和平移的功能  
  14. //     vtkInteractorStyleUnicam::New();  
  15. //   iren->SetInteractorStyle(style);  
  16.   
  17. //   vtkInteractorStyleUser *style =   //没有鼠标响应 主要用于用户自定义的操作  
  18. //     vtkInteractorStyleUser::New();  
  19. //   iren->SetInteractorStyle(style);  
  20. //   vtkInteractorStyleTerrain *style =   
  21. //     vtkInteractorStyleTerrain::New();  
  22. //   iren->SetInteractorStyle(style);  
  23. /* 
  24. vtkInteractorStyleSwitch *style =  
  25.     vtkInteractorStyleSwitch::New(); 
  26. iren->SetInteractorStyle(style); 
  27. */  
  28. //   vtkInteractorStyleFlight *style =   
  29. //     vtkInteractorStyleFlight::New();  
  30. //   iren->SetInteractorStyle(style);  
  31. // vtkInteractorStyleRubberBandZoom *style=vtkInteractorStyleRubberBandZoom::New();  
  32. // iren->SetInteractorStyle(style);  
  33. // vtkInteractorStyleSwitch *style=vtkInteractorStyleSwitch::New();  
  34. //     iren->SetInteractorStyle(style);  
  35. //     vtkInteractorStyleJoystickCamera *style=vtkInteractorStyleJoystickCamera::New();  
  36. // iren->SetInteractorStyle(style);  
  37. // vtkInteractorStyleJoystickActor *style=vtkInteractorStyleJoystickActor::New();  
  38. // iren->SetInteractorStyle(style);  

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值