先记三个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
- // 总共10种交互方式 下面是八种
- // vtkInteractorStyleTrackballCamera *style = //常用的方式 移动摄像机
- // vtkInteractorStyleTrackballCamera::New();
- // iren->SetInteractorStyle(style);
- // vtkInteractorStyleTrackballActor *style = //移动对象
- // vtkInteractorStyleTrackballActor::New();
- // iren->SetInteractorStyle(style);
- // For a 3-button mouse, the left button is for rotation, the right button for zooming,
- //the middle button for panning, and ctrl + left button for spinning.
- //(With fewer mouse buttons, ctrl + shift + left button is for zooming,
- //and shift + left button is for panning.)
- // vtkInteractorStyleUnicam *style = //只有放大和平移的功能
- // vtkInteractorStyleUnicam::New();
- // iren->SetInteractorStyle(style);
- // vtkInteractorStyleUser *style = //没有鼠标响应 主要用于用户自定义的操作
- // vtkInteractorStyleUser::New();
- // iren->SetInteractorStyle(style);
- // vtkInteractorStyleTerrain *style =
- // vtkInteractorStyleTerrain::New();
- // iren->SetInteractorStyle(style);
- /*
- vtkInteractorStyleSwitch *style =
- vtkInteractorStyleSwitch::New();
- iren->SetInteractorStyle(style);
- */
- // vtkInteractorStyleFlight *style =
- // vtkInteractorStyleFlight::New();
- // iren->SetInteractorStyle(style);
- // vtkInteractorStyleRubberBandZoom *style=vtkInteractorStyleRubberBandZoom::New();
- // iren->SetInteractorStyle(style);
- // vtkInteractorStyleSwitch *style=vtkInteractorStyleSwitch::New();
- // iren->SetInteractorStyle(style);
- // vtkInteractorStyleJoystickCamera *style=vtkInteractorStyleJoystickCamera::New();
- // iren->SetInteractorStyle(style);
- // vtkInteractorStyleJoystickActor *style=vtkInteractorStyleJoystickActor::New();
- // iren->SetInteractorStyle(style);