[vtkusers] How to make 2d zooming in visualisation
Lodron, Gerald
Gerald.Lodron at joanneum.at
Tue Oct 23 02:32:55 EDT 2012
Hi
I am not able to display a 2d image with a vtkPolyData and Zooming, what do I make wrong:
vtkSmartPointer<vtkRenderer> oRenderer = vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkRenderWindow> oRendererWindow = vtkSmartPointer<vtkRenderWindow>::New();
vtkSmartPointer<vtkRenderWindowInteractor> oRendererWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
vtkSmartPointer<vtkPolyDataMapper2D> oMapper = vtkSmartPointer<vtkPolyDataMapper2D>::New();
vtkSmartPointer<vtkImageMapper> oImgMapper = vtkSmartPointer<vtkImageMapper>::New();
vtkSmartPointer<vtkInteractorStyleImage> oStyle = vtkSmartPointer<vtkInteractorStyleImage>::New();
//vtkSmartPointer<vtkInteractorStyleRubberBand2D> oStyle = vtkSmartPointer<vtkInteractorStyleRubberBand2D>::New();
//vtkSmartPointer<vtkInteractorStyleRubberBandZoom> oStyle = vtkSmartPointer<vtkInteractorStyleRubberBandZoom>::New();
/*
vtkSmartPointer<vtkActor2D> oActor = vtkSmartPointer<vtkActor2D>::New();
vtkSmartPointer<vtkActor2D> oImgActor = vtkSmartPointer<vtkActor2D>::New();
oMapper->SetInput( oPoly );
oRandMapper->SetInput( oRandPoly );
oImgMapper->SetInput( oTarget );
oMapper->ScalarVisibilityOff();
double dColor[3] = {1,0,0};
oActor->GetProperty()->SetColor( dColor );
oActor->GetProperty()->SetPointSize( 2.0 );
oActor->SetMapper( oMapper );
oImgActor->SetInput(oTarget);
oRenderer->AddActor2D( oImgActor );
oRenderer->AddActor2D( oActor );
oRenderer->SetBackground( 1, 1, 1 );
oRendererWindow->AddRenderer( oRenderer );
oRendererWindow->SetSize( 640, 480 );
oRendererWindowInteractor->SetRenderWindow( oRendererWindow );
oRendererWindowInteractor->SetInteractorStyle( oStyle );
oRendererWindow->Render();
oRendererWindowInteractor->Initialize();
oRendererWindowInteractor->Start();
thanks for help
More information about the vtkusers
mailing list