That's because your superclass, vtkGraphAlgorithm is one of those classes that overrides the usual data creation passes and enforces the output to be the same type as the input. <br><br><br>In addition to what you have, please also try adding the following method :<br>
<br>  int vtkTestFilter::ProcessRequest(vtkInformation* request,<br>                                            vtkInformationVector** inInfoVec,<br>                                            vtkInformationVector* outInfoVec)<br>
{<br>  if(request->Has(vtkDemandDrivenPipeline::REQUEST_DATA_OBJECT()))<br>    {<br>    return vtkAlgorithm::ProcessRequest(request, inputVector, outputVector);<br>    }<br><br>  return this->Superclass::ProcessRequest(request, inputVector, outputVector);<br>

}<br><br><br><br><div class="gmail_quote">On Sat, May 29, 2010 at 8:08 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Sat, May 29, 2010 at 8:50 AM, Karthik Krishnan<br>
<<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>> wrote:<br>
> On Sat, May 29, 2010 at 1:10 AM, David Doria <<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>><br>
> wrote:<br>
>><br>
>> I want to make a filter in which I can specify the output type.<br>
><br>
> You would provide the method :<br>
><br>
>   FillOutputPortInformation( int port, vtkInformation *info )<br>
>     {<br>
>     if (.... && port == 0)<br>
>      {<br>
>      info->Set(vtkDataObject::DATA_TYPE_NAME(),<br>
> "vtkMutableUndirectedGraph");<br>
>      }<br>
>     if (....&& port == 0)<br>
>      {<br>
>      info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkMutableDirectedGraph");<br>
>      }<br>
>     }<br>
<br>
</div></div>Hm, I tried that:<br>
<a href="http://www.rpi.edu/%7Edoriad/VTK_List/OutputType/" target="_blank">http://www.rpi.edu/~doriad/VTK_List/OutputType/</a><br>
<br>
but it seems to still force the output type to match the input type.<br>
(even though I specify "ug", the output says "Output is type:<br>
vtkMutableUndirectedGraph" (where it should now be<br>
vtkUndirectedGraph)).<br>
<br>
Also, is it then acceptable to in RequestData SafeDownCast the output<br>
to a vtkGraph but assume you can still use functions from the subclass<br>
that was selected?<br>
<br>
Thanks,<br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br><br>