[vtkusers] SetInput and SetInputConnection

Prashanth prashanth.dumpuri at Vanderbilt.Edu
Tue Jul 13 13:48:18 EDT 2010


Preeti - Thanks. I tried your suggestion and I still get the same error
message. ("Attempt to get input information vector from input port index 0
for algorithm vtkMyClass(0x622a50), which has 0 input ports.")

David - Thanks as well. I will look at the link you posted and see if that
helps. And if that does not then I'll post my class and the test filter
for the class.

Thanks again to both of you
Prashanth

> Prashanth,
>
> For my VTK Pipeline using vtkPolyData I simply call
>
> ObjName->SetInputConnection(dataObjName->GetOutputPort());
>
> This creates a connection between the output of the object from which your
> data is going to be used and the input to the object where you desire the
> data. The only problem that might arise in this case is the datatype which
> you can change using vtkImageShiftScale.h
>
> Hope it helps,
>
> On Tue, Jul 13, 2010 at 1:12 PM, David Doria
> <daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
>> wrote:
>
>> On Tue, Jul 13, 2010 at 12:29 PM, Prashanth
>> <prashanth.dumpuri at vanderbilt.edu> wrote:
>> > All,
>> >   I wrote a class in 2004 that was derived from vtkPolyDataSource. My
>> > class accepts vtkPolyData as an Input, processes it and outputs a
>> > vtkPolyData. The class worked fine in VTK 4.x. We recently migrated to
>> > VTK 5.x and the class is not working. I get the following error
>> > message:
>> >
>> >  "Attempt to get input information vector from input port index 0 for
>> > algorithm vtkMyClass(0x622a50), which has 0 input ports."
>> >
>> > So to fix that in the Constructor of the class, I defined the
>> > NumberOfInputPorts to 1, set the NumberOfInput Connections to 1 on the
>> 0th
>> > port and have also filled the input port information on the 0th port
>> using
>> > the input vtkPolyData. I now get a Segmentation fault with no
>> > error/warning/debug messages.
>> >
>> > I know I'm missing something with regards to the change in the VTK
>> > pipeline. Any help and suggestions will be greatly appreciated.
>> >
>> > Thanks
>> > Prashanth
>>
>> Maybe you can take a look at this:
>>
>> http://www.vtk.org/Wiki/VTK/Examples/Developers/vtkPolyDataAlgorithm_Filter
>>
>> And see if you can tell what changed? If not, I'm sure someone will be
>> able to help you directly. Maybe you can post a shell of your class
>> code (preferably compilable) that produces the error?
>>
>> 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
>>
>
>
>
> --
> Regards,
> Preeti Bindu
>





More information about the vtkusers mailing list