VTK显示.vtk格式文件

void ReadandShowVTKFile ()
{
vtkSmartPointer<vtkRenderer > aRenderer =
vtkSmartPointer<vtkRenderer >::New();
vtkSmartPointer<vtkRenderWindow > renWin =
vtkSmartPointer<vtkRenderWindow >::New();
renWin->AddRenderer (aRenderer); vtkSmartPointer<vtkRenderWindowInteractor > iren =
vtkSmartPointer<vtkRenderWindowInteractor >::New();
iren->SetRenderWindow (renWin); vtkSmartPointer<vtkPolyDataReader > vtkReader = vtkSmartPointer<vtkPolyDataReader >::New();
vtkReader->SetFileName ("polyline.vtk"); vtkSmartPointer<vtkPolyDataMapper > skinMapper = vtkSmartPointer<vtkPolyDataMapper >::New();
skinMapper->SetInputConnection (vtkReader-> GetOutputPort());
skinMapper->ScalarVisibilityOff (); vtkSmartPointer<vtkActor > skin =
vtkSmartPointer<vtkActor >::New();
skin->SetMapper (skinMapper); vtkSmartPointer<vtkCamera > aCamera =
vtkSmartPointer<vtkCamera >::New();
aCamera->SetViewUp (, , -);
aCamera->SetPosition (, , );
aCamera->SetFocalPoint (, , );
aCamera->ComputeViewPlaneNormal ();
aCamera->Azimuth (30.0);
aCamera->Elevation (30.0);
aCamera->Dolly (1.5); aRenderer->AddActor (skin);
aRenderer->SetActiveCamera (aCamera);
aRenderer->ResetCamera ();
aRenderer->SetBackground (., ., .);
aRenderer->ResetCameraClippingRange (); renWin->Render ();
iren->Initialize ();
iren->Start ();
}
上一篇:nodejs - json序列化&反序列化示例


下一篇:基于最简单的FFmpeg包封过程:视频和音频分配器启动(demuxer-simple)