[vtkusers] polyLineWidget?

Dean Inglis dean.inglis at camris.ca
Thu Jun 30 12:09:31 EDT 2005


Hi Lars,

there are two existing widgets that may help:
http://www.vtk.org/doc/nightly/html/classvtkImageTracerWidget.html

and
http://www.vtk.org/doc/nightly/html/classvtkSplineWidget.html

with the spline widget, if you want straight line
segments between handles, you might do:
<snip>
  if ( linearize )
    {
    int res = m_splineWdget->GetNumberOfHandles();
    int closed = m_spline->GetClosed();
    res = closed ? res : res - 1;  
    m_splineWdget->SetResolution( res );
    }
<snip>


HTH,
Dean


Hi,

I'm trying to create something like a polyLineWidget, i.e. an object
with several points connected by lines and the interactive property that
 one can move the points and the lines connecting them follow. (Hope I
could make clear what I mean.)

Anybody with an idea or solution?

What I have done so far (without success):
* Using a list of pointWidgets and creating a polyLine from the
coordinates of the pointWidgets
* Using  a list of lineWidgets and taking point2 of a previous
lineWidget as point1 of the next lineWidget

In both cases I can move the points, but the lines connecting them don't
 follow, because I didn't manage to create a proper pipeline.

Another solution would be to use a splineWidget with the spline function
set to a linear function. But that doesn't seem to be implemented, right?

Thanks for any help

Lars
 




More information about the vtkusers mailing list