[vtk-developers] Slider Widget enhancement for integral values

Bill Lorensen bill.lorensen at gmail.com
Sun Nov 22 11:43:04 EST 2009


Folks,

David Doria and I recently added an example on the wiki to illustrate
the 3D slider widget.

http://www.vtk.org/Wiki/Slider#Slider.cxx

This example controls the theta and phi resolution of a sphere source.
These resolutions are integer values, while the Slider's value is a
continuous double. I would like to add a member variable,
SliderValueIsIntegral, that when set, rounds the slider's value to the
nearest integral value.

The changes are to vtkSliderRepresentation, so the behaviour will work
for both the 2D and 3D sliders.

  // Description:
  // Indicate whether the slider value is an integral number. Default
  // is Off. If On, the slider value will be rounded to the nearest
  // integral value.
  vtkSetMacro(SliderValueIsIntegral,int);
  vtkGetMacro(SliderValueIsIntegral,int);

I'm looking for comments/suggestions on the functionality and name choice.

Bill



More information about the vtk-developers mailing list