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.<div>
<br></div><div>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 pipelined. </div>
<div><br></div><div>I am curious if anyone has tried to do this, or if anyone has suggestions on this issue.</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px">myspline is a class containing vtkPoints, vtkPolyLine, vtkPolyData etc.</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"> // 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
_cells->InsertNextCell(_polyLine);
_polyData->SetPoints(_points);
_polyData->SetLines(_cells);
_splinefilter->SetInput( _polyData );
_splinefilter->SetMaximumNumberOfSubdivisions( 48 );
_tubeFilter->SetInputConnection( _splineFilter->GetOutputPort());
_tubeFilter->SetNumberOfSides( 12 );
_tubeFilter->SetRadius( 5.0 );
_tubeFilter->SetCapping(true);
_mapper->SetInputConnection( _tubeFilter->GetOutputPort() );
_actor->SetMapper(_mapper);
_actor->GetProperty()->SetLineWidth(4);
//----------------------------------------------------------------
// Updating for new vtkpoints</pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#006600"><b> // 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</b></font></pre><pre style="margin-top:0px;margin-bottom:0px"> // absolute positions so I cannot appl
splineObj->getPoints()->Reset();
splineObj->getPolyLine()->GetPointIds()->Reset();
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->getPoints()->InsertNextPoint(__coord[0],__coord[1],__coord[2]);
splineObj->getPolyLine()->GetPointIds()->InsertNextId( k );
k++;
}
splineObj->getCellArray()->Reset();
splineObj->getCellArray()->InsertNextCell(splineObj->getPolyLine());
splineObj->getPolyData()->Modified();</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Thank you,</pre><pre style="margin-top:0px;margin-bottom:0px">Anant.</pre>
</div>