[vtkusers] creating a vtkSpline to transform within a pipeline

Anant Vemuri ajar108 at gmail.com
Fri Sep 14 06:02:03 EDT 2012

I am currently creating a spline using vtkSplineFilter. The points in the
spline are changing as new positions for points are generated. However, now
I want to put the position information into a vtkTransform and connect the
Spline being created within a pipeline so that, it gets updated when the
the transform changes.

currently I am doing this whenever I get new positions. Is it possible to
put this in a pipeline so that the points are updated using a vtktransform
when the transform changes. In vtkTransform there is a function called
"MultiplyPoint" and "TransformPoint", however both are not indicated to be

I am curious if anyone has tried to do this, or if anyone has suggestions
on this issue.

myspline is a class containing vtkPoints, vtkPolyLine, vtkPolyData etc.

    //   In the constructor for my spline class
    _points       = vtkSmartPointer< vtkPoints >::New();
    _polyLine     = vtkSmartPointer< vtkPolyLine >::New();
    _cells        = vtkSmartPointer< vtkCellArray >::New();
    _polyData     = vtkSmartPointer< vtkPolyData >::New();
    _splineFilter = vtkSmartPointer< vtkSplineFilter >::New();
    _tubeFilter   = vtkSmartPointer< vtkTubeFilter >::New();

    //   PIPELINE
    _splinefilter->SetInput( _polyData );
    _splinefilter->SetMaximumNumberOfSubdivisions( 48 );
    _tubeFilter->SetInputConnection( _splineFilter->GetOutputPort());
    _tubeFilter->SetNumberOfSides( 12 );
    _tubeFilter->SetRadius( 5.0 );
    _mapper->SetInputConnection( _tubeFilter->GetOutputPort() );

    // Updating for new vtkpoints

*    // I want to put this part into the pipeline if possible so that
    // i can apply a vtkTransform to lets say the _points and the spline
    // gets updated automatically. The updated _points that I get are*

    // absolute positions so I cannot appl
    vtkIdType k = 0;

    // __scanorder contains the order in which the points need to be
put into a spline
    // __positions contains the updated point locations
    for (int j = 0; j < __scanOrder.size(); j++)
         unsigned int __idx = __scanOrder[i][j]-1;
         double &__coord = __positions[__idx]->getCoordinate();

         splineObj->getPolyLine()->GetPointIds()->InsertNextId( k );

Thank you,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120914/7e5be1cd/attachment.htm>

More information about the vtkusers mailing list