[Paraview] Python scripting question in 3.14
George Zagaris
george.zagaris at kitware.com
Mon Feb 27 22:02:11 EST 2012
Hi Tim,
I think you need to get your block as follows:
blk = vtkStructuredGrid.SafeDownCast( input.GetBlock(n) )
vtkMultiBlockDataSet is a generic container (i.e., not a
block-structured grid). Each block can be any concrete instance of
vtkDataObject.
Best,
George
On Mon, Feb 27, 2012 at 2:25 PM, Tim Gallagher <tim.gallagher at gatech.edu> wrote:
> Poking around, I have another question.
>
> In 3.12 and earlier, the blk type in the script portion I sent out would have been a vtkStructuredGrid object. But now it's a vtkPolyData object. When I look at the information for the data file, the hierarchy says each block is a "Structured (Curvilinear) Grid".
>
> Why is the data type returned different now from the vtkMultiBlockDataSet.GetBlock() call?
>
> Tim
>
> ----- Original Message -----
> From: "Tim Gallagher" <tim.gallagher at gatech.edu>
> To: "ParaView list" <paraview at paraview.org>
> Sent: Monday, February 27, 2012 2:09:37 PM
> Subject: [Paraview] Python scripting question in 3.14
>
> Hi,
>
> We had a programmable filter that started out like:
>
> from paraview import vtk
>
> input = self.GetInputDataObject(0, 0)
> output = self.GetOutputDataObject(0)
> ngls = 2
>
> if input.IsA("vtkMultiBlockDataSet"):
> nblk = input.GetNumberOfBlocks()
> print "nblk = ", nblk
> for n in range(nblk):
> blk = input.GetBlock(n)
> if blk is not None:
> i1, i2, j1, j2, k1, k2 = blk.GetExtent()
>
> which worked in 3.12. But trying it with the 3.14 build, the GetExtent() doesn't exist anymore. What do I do to replace it? I can't seem to find the corresponding function.
>
> Tim
> _______________________________________________
> 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 ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
> _______________________________________________
> 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 ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
More information about the ParaView
mailing list