[vtkusers] Error using SetOutput()

John Platt jcplatt at dsl.pipex.com
Wed Sep 16 15:11:57 EDT 2009


Hi Dave,

This is the pipeline management problem I am trying to solve

                               g1 -> g2 -> ...
f1 -> [ f2 ] -> [ f3 ] ->  h1 -> h2 -> ...
                                j1 ->  j2 -> ...

where the filters in [] are optional. I want to be able to add/remove f2 & f3 without having to find g1, h1 & j1 to reset the input connection. I therefore create the output object for the chain f1 -> [ f2 ] -> [ f3 ]  and use SetOutput() on the last filter. This way, the input connection to filters g1, h1 & j1 only has to be set once.

This is a technique I used in VTK 4.2 with the 'old' pipeline architecture. Are there any other ways to achieve this effect?

Thanks for help.

John.

----- Original Message ----- 
  From: David E DeMarle 
  To: John Platt 
  Cc: vtkusers 
  Sent: Wednesday, September 16, 2009 6:34 PM
  Subject: Re: [vtkusers] Error using SetOutput()


  Are you sure you want to SetOutput? For the most part (that is everywhere other than within the filter which typically gets its own output from the executive and populates it) , filter outputs shouldn't be messed with for two reasons :

  * the next time the filter updates the output will be replaced

  * more than one thing can be connected to a given filter's output, so changing the output or its contents will cause inconsistency

  David E DeMarle
  Kitware, Inc.
  R&D Engineer
  28 Corporate Drive
  Clifton Park, NY 12065-8662
  Phone: 518-371-3971 x109



  On Tue, Sep 15, 2009 at 6:23 PM, John Platt <jcplatt at dsl.pipex.com> wrote:

    Hi,
    I am having trouble moving an output between filters using SetOutput() as follows.

    1. Single filter, f1.
        vtkPolyData* myOutput = vtkPolyData::New();
        f1->SetOutput( myOutput );

        vtkAppendPolyData* myAppend =  vtkAppendPolyData::New();
        myAppend->AddInput( myOutput );

    "myOutput" is displayed correctly.

    2. Append filter f2 to f1.
        f1->SetOutput( 0 );
        f2->SetInputConnection( f1->GetOutputPort() );
        f2->SetOutput( myOutput );

    "myOutput" does not appear to see the changes made by filter f2.

    3. Remove filter f2.
        f 2->Delete();
        f1->SetOutput( myOutput );

    ERROR: In /home/john/VTK/vtk-5.4.2/VTK/Filtering/vtkStreamingDemandDrivenPipeline.cxx, line 747
    vtkStreamingDemandDrivenPipeline : No maximum number of pieces has been set in the information for output port 0 on algorithm vtkf1"

    Any help on using SetOutput() would be greatly appreciated.

    Thanks.

    John.

    _______________________________________________
    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






------------------------------------------------------------------------------


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


More information about the vtkusers mailing list