[Paraview] Re: Programmable Filter: UpdateProgress and input for Threshold

Berk Geveci berk.geveci at kitware.com
Fri Nov 16 07:48:07 EST 2007


I am not 100% sure but I am guessing this is a limitation of custom
filters. I would consider custom filters in development stage. We have
several significant improvement to make before they are fully
functional. I hope to have it done by 3.4 but it may be delayed until
3.6.

-berk

On 11/16/07, Jerome Robert <jeromerobert at users.sf.net> wrote:
> ok my first question was so stupid (i and numCells are integer not float). Any idea for the second one ?
>
> On Thu, 15 Nov 2007 09:51:42 +0100, Jerome Robert <jeromerobert at users.sf.net> wrote:
> > Hi all,
> >
> > I wrote the following programmable filter in Paraview 3.2:
> >
> > from math import sqrt
> > pdi = self.GetInput()
> > pdo = self.GetOutput()
> > newData = paraview.vtkDoubleArray()
> > newData.SetName("Max length edge")
> > numCells = pdi.GetNumberOfCells()
> > self.SetProgressText("Max length edge")
> >
> > for i in range(0, numCells):
> >        cell = pdi.GetCell(i)
> >        value = max([ cell.GetEdge(i).GetLength2() for i in [0, 1, 2]])
> >        newData.InsertNextValue(sqrt(value))
> >        self.UpdateProgress(i/numCells)
> >
> > pdo.GetCellData().AddArray(newData)
> >
> > So I have 2 problems and questions:
> >
> > - SetProgressText and UpdateProgress calls seems to be not taken into
> > account (i.e. the progress bar stay grey). Is it because it's not yet
> > supported or because my script is wrong ?
> > - If I use this script in a Programmable filter, I can use its output as
> > input for Threshold or Histogram filters. If I create a Custom Filter from
> > this Programmable filter, it CANNOT be used as input for Threshold or
> > Histogram. Why ?
> >
> > Regards,
> >
> > Jerome
>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list