<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:10pt;font-family:Sans Serif">
<p>Hi vtk-fans </p>
<p></p>
<p>How can I get the input and output vtkAlgorithm-objects of a vtkAlgorithm-object ?</p>
<p>I try to write an easy function for removing vtkAlgorithm-objects from a visualisation-pipeline like the following. But inputObj and outputObj is always null. </p>
<p></p>
<p>        Greetings</p>
<p>                Jens</p>
<p></p>
<p>////////////////////////////////////////////////////////////////</p>
<p>////        removing a vtkAlgorithm-obj form its</p>
<p>//// visualisation pipeline.</p>
<p>////////////////////////////////////////////////////////////////</p>
<p>bool removeAlgorithm( vtkAlgorithm* algo )</p>
<p>{</p>
<p>        vtkInformation* inputInfo = algo->GetInputPortInformation(0);</p>
<p>        vtkInformation* outputInfo = algo->GetOutputPortInformation(0);</p>
<p></p>
<p>        // get the input- and output-vtkAlgorithm of algo </p>
<p>        vtkAlgorithm inputObj = vtkAlgorithm::SafeDownCast( </p>
<p> outputInfo->Get(</p>
<p> vtkDataObject::DATA_OBJECT()));</p>
<p>        vtkAlgorithm outputObj = vtkAlgorithm::SafeDownCast( </p>
<p> inputInfo->Get(</p>
<p> vtkDataObject::DATA_OBJECT()));</p>
<p></p>
<p>        // rechain the algorithms</p>
<p>        if(inputObj && outputObj) {</p>
<p>                inputObj->RemoveAllInputs();</p>
<p>                inputObj->SetInputConnection( outputObj->GetOutputPort() );</p>
<p>                alog->Delete();</p>
<p>                return true;</p>
<p>        }</p>
<p>        return false;</p>
<p>}</p>
<p></p>
<p></p>
<p></p>
<p></p>
</body></html>