[vtkusers] Bypassing filters in a pipeline

John Platt jcplatt at lineone.net
Tue Nov 30 12:38:01 EST 2004


Hi Steve,

If you are developing in C++, you can derive a new class from FilterA
and override the Execute() method. Call the base class Execute() to
filter, or shallow copy the input to the output to bypass -

void MyFilterA::Execute()
{
   if ( m_bFilterOn )
   {
      FilterA::Execute();
   }
   else
   {
      vtkPolyData* input = this->GetInput();
      if ( !input )
         vtkErrorMacro(<<"No input, cannot Execute.");

      vtkPolyData* output = this->GetOutput();
      output->ShallowCopy( input );
   }
}

If the output is of a different type to the input, a little more work is
required in the copying.

I find this very useful in simplifying the GUI development. It is easy
to implement so I am not sure why the idea was dropped.

HTH

John.


-----Original Message-----
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On
Behalf Of Steven Boyd
Sent: 28 November 2004 04:50
To: vtk
Subject: [vtkusers] Bypassing filters in a pipeline

Hi,

I was reading a posting thread from December 1999 about eliminating a 
"Bypass" feature in VTK.  It appears that the discussion resulted in 
this being eliminated.  My question is then, if I have the following 
pipeline:

Input -> FilterA -> FilterB -> FilterC -> Output

With my GUI control, do I have to adjust input/output connections of 
filters as I activate or deactivate different combinations?

Is there another way to rearrange the pipeline from a GUI control?  If 
others have another suggestion how to bypass filters, please let me
know.

Regards,

Steve

-- 
Steven Boyd, PhD

Assistant Professor
Department of Mechanical and Manufacturing Engineering
University of Calgary
2500 University Drive, N.W.
Calgary, Alberta, Canada, T2N 1N4

tel. 1.403.220.4173  fax. 1.403.282.8406  skboyd at ucalgary.ca
-------------------------------------------------------------------


_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list