zoukankan      html  css  js  c++  java
  • 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 (0, 0, -1);
         aCamera->SetPosition (0, 1, 0);
         aCamera->SetFocalPoint (0, 0, 0);
         aCamera->ComputeViewPlaneNormal ();
         aCamera->Azimuth (30.0);
         aCamera->Elevation (30.0);
         aCamera->Dolly (1.5);
    
         aRenderer->AddActor (skin);
         aRenderer->SetActiveCamera (aCamera);
         aRenderer->ResetCamera ();
         aRenderer->SetBackground (.2, .3, .4);
         aRenderer->ResetCameraClippingRange ();
    
         renWin->Render ();
         iren->Initialize ();
         iren->Start ();
    }
  • 相关阅读:
    JS实现 div拖拽 限制在屏幕内
    国际化配置simple_form
    simple_form模板templates erb haml
    git rolify
    rails模板生成bootstrap格式的simple_form的erb文件
    rails生成器生成自定义controller模板
    ubuntu 终端常用命令(转)
    Ruby for Rails笔记
    Java基础
    javascript ybmiaov
  • 原文地址:https://www.cnblogs.com/mothe123/p/4275070.html
Copyright © 2011-2022 走看看