[vtk-developers] vtkImagePlaneWidget: bug and feature request

Prabhu Ramachandran prabhu_r at users.sf.net
Wed Jun 22 07:54:55 EDT 2005


Hi,

I've been playing with the excellent vtkImagePlaneWidget.  Thanks for
this class!  I noticed a couple of bugs.

The {Get,Set}{Left,Right}ButtonAutoModifier methods are defined
incorrectly IMHO.  This is the current definition:

  vtkSetClampMacro(LeftButtonAutoModifier,int, SHIFT_MODIFIER, CONTROL_MODIFIER);

Should not this read like so?

  vtkSetClampMacro(LeftButtonAutoModifier,int, NO_MODIFIER, CONTROL_MODIFIER);


The other problem is with the GetCursorData method.

  int GetCursorData(double xyzv[4]);

This is not wrapped nicely for scripting languages due to its
signature.  I propose that we add three methods like so:

  // Returns the status of the cursor data; 1 -- if valid, 0 -- if invalid.
  int GetCursorDataStatus();

  vtkGetVectorMacro(CurrentCursorPosition,double,3);
  vtkGetMacro(CurrentImageValue,double);


A user can then check the status of the cursor before they obtain the
cursor data via the current cursor position and the image value.  This
should make it possible to use the cursor position and image value
from scripting languages without changing the existing C++ API.

Feature request
---------------

I find that with interactive widgets, it is handy to know when the
slice's position has been changed.  To this end I think it is handy to
sprinkle a few this->Modified() calls so that users can listen to the
ModifiedEvent and note any changes to the slice position.

I've attached a patch incorporating these changes.  Thanks.

cheers,
prabhu

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ipw.patch
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20050622/fbc8a442/attachment.ksh>


More information about the vtk-developers mailing list