[vtkusers] How to make vtkLogoWidget undraggable

Cory Quammen cory.quammen at kitware.com
Mon Dec 21 11:04:19 EST 2015


Skimming the code in vtkLogoWidget's parent class vtkBorderRepresentation,
it looks like there is no way to disable dragging at the moment.

One could change the code in
vtkBorderRepresentation::WidgetInteraction(double eventPos[2]) in the
switch statement case for vtkBorderRepresentation::Inside to also check if
dragable is set to off, e.g.

    case vtkBorderRepresentation::Inside:

      if ( this->Moving* && this->Dragable*)
        {
        par1[0] = par1[0] + delX;
        par1[1] = par1[1] + delY;
        par2[0] = par2[0] + delX;

        par2[1] = par2[1] + delY;

        }
      break;

Note the change in bold. Would you want to give this a try and see if that
works?

Thanks,
Cory

On Mon, Dec 21, 2015 at 10:44 AM, vincentrivola <vincentrivola at hotmail.com>
wrote:

> To give you more information, here is part of the code:
>
>
> vincentrivola wrote
> >                       File logoFile = new
> File(getClass().getResource(fileName).toURI());
> >                       vtkPNGReader pngReader = new vtkPNGReader();
> >                       pngReader.SetFileName(logoFile.getPath());
> >                       pngReader.Update();
> >
> >                       vtkLogoRepresentation logoRepresentation = new
> vtkLogoRepresentation();
> >                       logoRepresentation.SetImage(pngReader.GetOutput());
> >                       logoRepresentation.SetPosition(posX,0.85);
> >                       logoRepresentation.SetPosition2(0.15, 0.15);
> >
>  logoRepresentation.GetImageProperty().SetOpacity(1.0);
> >                       logoRepresentation.SetDragable(0);
> >                       logoRepresentation.SetPickable(0);
> >                       logoRepresentation.SetProportionalResize(1);
> >                       logoRepresentation.SetPickingManaged(false);
> >
> >                       vtkLogoWidget logoWidget = new vtkLogoWidget();
> >                       logoWidget.SetRepresentation(logoRepresentation);
> >
>  logoWidget.SetInteractor(panel3d.getRenderWindowInteractor());
> >                       logoWidget.On();
>
> As you can see I also tried to disable selection, picking and draggability
> on the vtkLogoRepresentation element, but it does not change anything.
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/How-to-make-vtkLogoWidget-undraggable-tp5735607p5735611.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151221/ff05fbf8/attachment.html>


More information about the vtkusers mailing list