标签:style c t size tar sp width art get color int
#include <vtk-5.10/vtkSmartPointer.h>
#include <vtk-5.10/vtkRenderWindow.h>
#include <vtk-5.10/vtkRenderer.h>
#include <vtk-5.10/vtkCylinderSource.h>
#include <vtk-5.10/vtkPolyDataMapper.h>
#include <vtk-5.10/vtkActor.h>
#include <vtk-5.10/vtkRenderWindowInteractor.h>
#include <vtk-5.10/vtkInteractorStyleTrackballCamera.h>
int main()
{
vtkSmartPointer<vtkCylinderSource> cylinder=vtkSmartPointer<vtkCylinderSource>::New();
cylinder->SetHeight(3.0);
cylinder->SetRadius(1.0);
cylinder->SetResolution(10);
vtkSmartPointer<vtkPolyDataMapper> polydata=vtkSmartPointer<vtkPolyDataMapper>::New();
polydata->SetInputConnection(cylinder->GetOutputPort());
vtkSmartPointer<vtkActor> cylinderActor=vtkSmartPointer<vtkActor>::New();
cylinderActor->SetMapper(polydata);
vtkSmartPointer<vtkRenderer> render=vtkSmartPointer<vtkRenderer>::New();
render->AddActor(cylinderActor);
render->SetBackground(0.1, 0.2, 0.4);
vtkSmartPointer<vtkRenderWindow> renderWindow=vtkSmartPointer<vtkRenderWindow >::New();
renderWindow->AddRenderer(render);
renderWindow->SetSize(640, 480);
vtkSmartPointer<vtkRenderWindowInteractor> renderwindowInteractor=vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderwindowInteractor->SetRenderWindow(renderWindow);
vtkSmartPointer<vtkInteractorStyleTrackballCamera> interactorStyle =vtkSmartPointer<vtkInteractorStyleTrackballCamera>::New();
renderwindowInteractor->SetInteractorStyle(interactorStyle);
renderwindowInteractor->Initialize();
renderwindowInteractor->Start();
std::cin.get();
return 0;
}
标签:style c t size tar sp width art get color int
原文地址:http://www.cnblogs.com/gujianhan/p/3702057.html