[prev in list] [next in list] [prev in thread] [next in thread]
List: vtkusers
Subject: Re: [vtkusers] How to make a filter operate on either mutable
From: David Doria <daviddoria+vtk () gmail ! com>
Date: 2010-03-31 20:16:45
Message-ID: i2hc19fcadc1003311316pc4010ad7v918e2eda1c16cac4 () mail ! gmail ! com
[Download RAW message or body]
On Wed, Mar 31, 2010 at 2:13 PM, Jeff Baumes <jeff.baumes@kitware.com> wrote:
> I see. Yes, in this case you need to specify the output type (directed
> or undirected graph) since the input is not a graph. I think you
> should override FillOutputPortInformation() to specify this, rather
> than overriding RequestDataObject(), although perhaps you should
> override both in this case.
>
> Jeff
Hi Jeff,
Yes, I forgot to mention that the input isn't always a vtkGraph to my
vtkGraphAlgorith m filters.
Case 1: The input IS a graph
You are right. In the case that FillInputInformation is not
re-implemented (the input is a vtkGraph) then you are correct, it
works as expected out of the box.
Case 2: The input is not a vtkGraph
I tried NOT re-implementing RequestData object and only
re-implementing FillOutputPortInformation as:
int vtkMeshToGraph::FillOutputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
// now add our info
info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkMutableUndirectedGraph");
return 1;
}
but got the error:
vtkStreamingDemandDrivenPipeline (0x8a22a80): Algorithm
vtkMeshToGraph(0x8a229e8) returned failure for request: vtkInformation
(0x8a25e38)
With both FillOutputPortInformation AND RequestDataObject
re-implement, it worked fine. But it also worked fine with ONLY
RequestDataObject re-implemented.
Oh, the mysteries of the pipeline... haha
Thanks,
David
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic