Is there any method to setup vtkSplineWidget2 as not pickable ? I have tried following methods:
pSplineRepresentation->DragableOff();
pSplineRepresentation->ClosedOff();
pSplineRepresentation->PickableOff();
However, I still can to drag and move the spline widget. Here is the entire code:
if (NULL == m_pSpline->GetInteractor())
{
m_pSpline->SetInteractor(m_pInteractor);
m_pSpline->SetCurrentRenderer(m_pRenderer);
m_pSpline->CreateDefaultRepresentation(); // create default representation
vtkSplineRepresentation* pSplineRepresentation = vtkSplineRepresentation::SafeDownCast(m_pSpline->GetRepresentation());
pSplineRepresentation->SetNumberOfHandles(5);
pSplineRepresentation->SetHandlePosition(0, 0, 0, 0);
pSplineRepresentation->SetHandlePosition(1, 0.1, 0.1, 0.1);
pSplineRepresentation->SetHandlePosition(2, 0.5, 0.5, 0.5);
pSplineRepresentation->SetHandlePosition(3, 0.8, 0.8, 0.8);
pSplineRepresentation->SetHandlePosition(4, 10, 10, 10);
pSplineRepresentation->SetLineColor(0.9, 0.3, 0.3);
pSplineRepresentation->GetLineProperty()->SetLineWidth(4);
pSplineRepresentation->DragableOff();
pSplineRepresentation->PickableOff();
pSplineRepresentation->BuildRepresentation();
vtkSplineWidgetCallback* pCallback = vtkSplineWidgetCallback::New();
pCallback->SetView(this);
m_pSpline->AddObserver(vtkCommand::StartInteractionEvent, pCallback);
m_pSpline->AddObserver(vtkCommand::InteractionEvent, pCallback);
m_pSpline->AddObserver(vtkCommand::EndInteractionEvent, pCallback);
pCallback->Delete();
}
I have used wrongly these methods: DragableOff, ClosedOff, PickableOff ? Or is referring to something else ?