[vtkusers] SetInput and SetInputConnection

Preeti Bindu preetibindu at gmail.com
Tue Jul 13 13:21:03 EDT 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100713/b92bdeb8/attachment.htm>


More information about the vtkusers mailing list