Disable caption widget anchor point picking and dragging

Hi,

I am trying to disable anchor point picking and dragging for a caption widget. I found this article on stack overflow:

The responses seem to indicate that the proposed solutions do not necessarily work. Is there a correct way to accomplish this?

Thanks,
Kent

Hello,

Did you try those?

regards,

Paulo

Hi,

I did try those suggestions, but they do not work.

I also tried the following without success:

vtkCaptionWidget->GetRepresentation->DragableOff();

If there are many (>10) captions in the scene eventually a green “+” cursor will appear in the scene and if you press the left mouse button and drag, one of the caption glyphs will move away from its anchor point. For some reasons, having transparency on seems to make it more likely to happen.
Regards,
Kent

Hello,

Did you try subclassing vtkCaptionWidget? Most of vtk*Widget classes are utility classes that have several VTK objects in them. So, you likely need to add some methods do disable the individual scene objects (e.g. the “+” handle) one-by-one. You can identify them by looking into the vtkCaptionWidget.h/.cpp files.

void MyVtkCaptionWidget::disableHandleInteraction()
{
    this->HandleWidget->EnableAxisConstraintOff();
    this->HandleWidget->EnableTranslationOff();
    this->HandleWidget->AllowHandleResizeOff();
    this->HandleWidget->SetEnabled( 0 );
}

I hope this helps,

Paulo

Hi,

None of these methods were effective. EnableTranslationOff() is not defined in the version of VTK used in my company.

I also tried KeyPressActivationOff(), but it didn’t work either. After creating several captions, I hover over the arrows and sometimes a “hand” cursor appears. If I hold the mouse down, one of the caption vectors will start to move as I drag the mouse. Not even the one that the mouse was close to at the time.

Any other suggestions?

Thanks,
Kent