[vtk-developers] Widgets within Widgets & vtkHandleWidget

Will Schroeder will.schroeder at kitware.com
Fri Dec 12 06:37:27 EST 2003


t 06:02 AM 12/12/2003, John Biddiscombe wrote:

>Can anyone tell me if there's any reason why I can't create a
>vtkButtonWidget, then have several of these living inside a
>vtkTransferFunctionWidget and have the button clicks received by the
>button and passed into the trfnWidget via the appropriate mechanism.
>(Then the widget can for example toggle betwwn log/lin display of
>histograms etc)
>
>I'm pondering this and someone may heve tried something similar and can
>possibly save me some time.


This is definitely doable as long as you are careful. You can use the 
observer mechanism to allow the vtkTransferFunctionWidget to watch the 
instances of vtkButtonWidget. When the button is selected the 
vtkTransferFunctionWidget can be updated (via the callback echanism) as 
necessary.

I suspect you guys are ahead of me on this, but I had a thought related to 
vtkButtonWidget. I was thinking that a class like vtkHandleWidget could be 
created to be used by all widgets to create handles. This thing could have 
modes to constrain it to 2D, or a plane, a line, within a bounding box, 
etc. It would also allow setting an input polydata and/or texture. And of 
course you could set the properties (selected and unselected). Subclasses 
of vtkHandleWidget could have different shapes (selected and unselected 
shapes) and/or constraint behavior. This approach might greatly simplify 
some of the current widgets since they spend a lot of time managing all 
this stuff. Thoughts? My major concern is that if adopted, it would affect 
the API of the current widget set.

Will






More information about the vtk-developers mailing list