本文整理汇总了C#中vtkRenderWindow.GetInteractor方法的典型用法代码示例。如果您正苦于以下问题:C# vtkRenderWindow.GetInteractor方法的具体用法?C# vtkRenderWindow.GetInteractor怎么用?C# vtkRenderWindow.GetInteractor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vtkRenderWindow
的用法示例。
在下文中一共展示了vtkRenderWindow.GetInteractor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadSTL
/// <summary>
/// 读取stl文件,并在窗口进行显示,并设置全局变量originalMesh
/// </summary>
private void ReadSTL()
{
//Path to vtk data must be set as an environment variable
//VTK_DATA_ROOT=""
vtkSTLReader reader = vtkSTLReader.New();
reader.SetFileName(FileFullName);
reader.Update();
mapper = vtkPolyDataMapper.New();
mapper.SetInputConnection(reader.GetOutputPort());
actor = vtkActor.New();
actor.SetMapper(mapper);
//get a reference to the renderwindow of our renderWindowControll
renderWindow = renderWindowControl1.RenderWindow;
//renderer
renderer = renderWindow.GetRenderers().GetFirstRenderer();
//移除之前所有prop
renderer.RemoveAllViewProps();
//set background color
renderer.SetBackground(0.2, 0.3, 0.4);
//add our actor to the renderer
renderer.AddActor(actor);
originalMesh = vtkPolyData.New();
originalMesh.DeepCopy(reader.GetOutput());
tb_numOfPoint.Text = originalMesh.GetNumberOfPoints().ToString();
//creat a cell picker
picker = vtkCellPicker.New();
vtkRenderWindowInteractor iren = renderWindow.GetInteractor();
iren.SetPicker(picker);
renderer.ResetCamera();
renderWindow.Render();
}