[vtk-developers] vtkSplineWidget2 exit interaction mode

Daniel Haehn haehn at bwh.harvard.edu
Mon Aug 16 12:32:10 EDT 2010


Hi,

I am placing a vtkSplineWidget2 with the following code:

  vtkSplineWidget2 * splineWidget = vtkSplineWidget2::New();

  splineWidget->SetInteractor(this->GetInteractor());
  splineWidget->SetCurrentRenderer(this->GetRenderer());

  // add observer for end interaction
  vtkAnnotationSplineWidgetCallback *myCallback = vtkAnnotationSplineWidgetCallback::New();
  myCallback->m_Node = splineNode;
  myCallback->m_Widget = splineWidget;
  splineWidget->AddObserver(vtkCommand::EndInteractionEvent,myCallback);
  myCallback->Delete();

  splineWidget->CreateDefaultRepresentation();
  vtkSplineRepresentation::SafeDownCast(splineWidget->GetRepresentation())->SetNumberOfHandles(5);

  vtkSplineRepresentation::SafeDownCast(splineWidget->GetRepresentation())->SetHandlePosition(0,splineNode->GetControlPointCoordinates(0));
  vtkSplineRepresentation::SafeDownCast(splineWidget->GetRepresentation())->SetHandlePosition(1,splineNode->GetControlPointCoordinates(1));
  vtkSplineRepresentation::SafeDownCast(splineWidget->GetRepresentation())->SetHandlePosition(2,splineNode->GetControlPointCoordinates(2));
  vtkSplineRepresentation::SafeDownCast(splineWidget->GetRepresentation())->SetHandlePosition(3,splineNode->GetControlPointCoordinates(3));
  vtkSplineRepresentation::SafeDownCast(splineWidget->GetRepresentation())->SetHandlePosition(4,splineNode->GetControlPointCoordinates(4));


The widget appears just fine.

But how do I disable the interaction mode? I want to be able to place seeds after the splineWidget was created but the complete interaction of the 3D Render window is taken over by the vtkSplineWidget2.

Thanks,
Daniel


More information about the vtk-developers mailing list