[vtkusers] vtkDistanceWidget and vtkCanvas

Sebastien Jourdain sebastien.jourdain at kitware.com
Tue Jan 17 13:14:18 EST 2012


Just quickly... Did you add your widget actor into the renderer ?
Did you reset the camera to be sure it is looking in the right direction ?

Seb

On Tue, Jan 17, 2012 at 1:10 PM, Marco Sambin <m.sambin at gmail.com> wrote:
> Hi all.
> I am trying to use a vtkDistanceWidget in my vtkCanvas-derived class.
>
> In the constructor of my vtkCanvas-derived class, I have the following code:
>
> [...]
>    // Initialize the measurements widget
>    vtkDistanceWidget distWidget = new vtkDistanceWidget();
>    distWidget.SetInteractor(iren);
>    vtkPointHandleRepresentation2D handle = new
> vtkPointHandleRepresentation2D();
>    handle.GetProperty().SetColor(1, 0, 0);
>    vtkDistanceRepresentation2D rep = new vtkDistanceRepresentation2D();
>    rep.SetHandleRepresentation(handle);
>    rep.GetAxis().SetNumberOfMinorTicks(4);
>    rep.GetAxis().SetTickLength(9);
>    rep.GetAxis().SetTitlePosition(0.2);
>    distWidget.SetRepresentation(rep);
>    distWidget.On();
> [...]
>
> For now, my vtkCanvas is empty, and there is no other relevant code in
> the constructor.
>
> I cannot get the vtkDistanceWidget to work. Nothing appears on screen
> when I left-press on my vtkCanvas.
>
> Am I missing something fundamental in order to have the
> vtkDistanceWidget to work?
>
> Thanks in advance for any hint.
>
> Best regards,
>
> Marco
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list