I had some code whose input and output was like this:<br><br>Scanner-&gt;SetScene(vtkPolyData*);<br>vtkPolyData* output = Scanner-&gt;GetOutputPolyData();<br><br>I changed my class to inherit from public vtkPolyDataAlgorithm, and I added this function (the &quot;information&quot; bits were stolen from vtkTransformPolyDataFilter)<br>
<br>int vtkLidarScanner::RequestData(vtkInformation *vtkNotUsed(request),<br>        vtkInformationVector **inputVector,<br>  vtkInformationVector *outputVector)<br>{<br>  // get the info objects<br>    vtkInformation *inInfo = inputVector[0]-&gt;GetInformationObject(0);<br>
    vtkInformation *outInfo = outputVector-&gt;GetInformationObject(0);<br><br>  // get the input and ouptut<br>    vtkPolyData *input = vtkPolyData::SafeDownCast(<br>            inInfo-&gt;Get(vtkDataObject::DATA_OBJECT()));<br>
    vtkPolyData *output = vtkPolyData::SafeDownCast(<br>            outInfo-&gt;Get(vtkDataObject::DATA_OBJECT()));<br><br>    this-&gt;SetScene(input);<br>    std::cout &lt;&lt; *input &lt;&lt; std::endl;<br>    <br>    this-&gt;PerformScan();<br>
    <br>    output = this-&gt;GetOutputPolyData();<br><br>    return 1;<br>}<br><br>The cout of the input seems that it was received correctly, and the cout of the output seems that it was built correctly. I am then trying to use the class with:<br>
<br>    Scanner-&gt;SetInput(reader-&gt;GetOutput());<br>    vtkSmartPointer&lt;vtkXMLPolyDataWriter&gt; writer = vtkSmartPointer&lt;vtkXMLPolyDataWriter&gt;::New();<br>    writer-&gt;SetFileName(OutputFilename.c_str());<br>
    writer-&gt;SetInput(Scanner-&gt;GetOutput());<br>    writer-&gt;Write();<br><br>But the file that is written is empty. Is there anything else I have to do to get this to work as an algorithm filter?<br><br clear="all">
Thanks,<br><br>David<br>