[vtk-developers] A Widget Related Question

Charl P. Botha c.p.botha at its.tudelft.nl
Fri May 17 06:50:06 EDT 2002

On Fri, May 17, 2002 at 12:33:02AM +0100, John Biddiscombe wrote:
> Apologies, I appeared to be suffering from "not being able to read the
> code-itis" when I posted my question. I notice the implicit functions are
> there already and I understand the need for the ShallowCopy, so I don't
> immediately want to modify any code.
> However, I'm tempted to suggest this...
> vtk3Dwidget -> vtkPolyDataSourceWidget -> vtkBoxWidget
>                                        -> vtkLineWidget
>                                        -> vtkSphereWidget
>                                        -> vtkPlaneWidget
>                                        -> etc
> as then certain "bookkeeping" code can be unified between all of them (and
> it'd make my life easier as I can write a single base class wrapper with the
> complex bits in - and derive the rest from it). This may also prove to be
> advantageous from your "RealiseGeometry" point of view.
> Comments?
> JB
> Charl. I presume you've modified your local copy of PlaneWidget to add the
> functions you need already?

Yes, I've modified my local copy.  Maybe adding some kind of
RealiseGeometry() abstract method to vtkPolyDataSourceWidget would be handy.
Child classes would have to implement this and it's function would be to
move all handles and visual elements to reflect the new underlying geometry
of the PolyDataSource (or somesuch).  This would be applicable to all 3d
widgets that can encapsulate their whole state (or at least the state they
represent) in a vtkPolyDataSource (or sources).

BTW, in my local copy of PlaneWidget I've added the method and it simply
calls PlaneSource->Update() and this->PositionHandles().  In my application,
I modify the PlaneWidget by calling Set{Origin,Point1,Point2} and when I
call RealiseGeometry(), it moves and configures to the desired position,
size and orientation, handles and all.


charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/

More information about the vtk-developers mailing list