[vtkusers] vtkAxesTransformWidget uses

alican alican1812 at hotmail.com
Tue Oct 31 05:14:58 EDT 2017


I have had exactly the same problem with this code:

	vtkRenderer* renderer = vtkRenderer::New();
	renderer->SetBackground(0.0, 0.0, 0.0);
	vtkRenderWindow*	renderWindow = vtkRenderWindow::New();
	renderWindow->AddRenderer(renderer);
	vtkRenderWindowInteractor*	renderWindowInteractor =
vtkRenderWindowInteractor::New();
	renderWindowInteractor->SetRenderWindow(renderWindow);

	vtkConeSource*	coneSource = vtkConeSource::New();
	coneSource->Update();
	vtkPolyDataMapper*	coneMapper = vtkPolyDataMapper::New();
	coneMapper->SetInputConnection(coneSource->GetOutputPort());
	vtkActor*	coneActor = vtkActor::New();
	coneActor->SetMapper(coneMapper);
	coneActor->GetProperty()->SetColor(1, 1, 0);

	renderer->AddActor(coneActor);

	vtkInteractorStyleTrackballCamera*	style =
vtkInteractorStyleTrackballCamera::New();
	renderWindowInteractor->SetInteractorStyle(style);

	vtkAxesTransformRepresentation*	representation =
vtkAxesTransformRepresentation::New();
	vtkAxesTransformWidget*	transformWidget = vtkAxesTransformWidget::New();
	transformWidget->SetInteractor(renderWindowInteractor);
	transformWidget->SetRepresentation(representation);
	transformWidget->On();

	renderer->ResetCamera();
	renderWindow->Render();
	renderWindowInteractor->Start();

However, if I move *transformWidget->On()* to be the last line, 
after *renderWindowInteractor->Start() 
*
the problem disappears. Looks like a bug to me, as it makes the widget
pretty useless.




--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list