[Paraview] problem when trying to display points using programmable filter

Laurent Paul laurent.paul at uclouvain.be
Thu Mar 29 06:02:59 EDT 2012


Dear users,

I try to compute points, lines, axes using the programmable filter from 
5 points acquired by a PointSource.
I select the 5 pointsource, compute axis but paraview simply crashes 
when I InsertNextCell on the output.
This happens when I get several InputData using GetInputDataObject().
If I get only one input using GetPolyDataInput(), the line is well 
displayed. Is there a trick?

Thanks for your help,
Laurent.

Here is my code:

A = self.GetInputDataObject(0, 0)
B = self.GetInputDataObject(0, 1)
C = self.GetInputDataObject(0, 2)
D = self.GetInputDataObject(0, 3)
E = self.GetInputDataObject(0, 4)
Point1 = A.GetPoint(0)
print Point1
Point2 = B.GetPoint(0)
print Point2
Point3 = C.GetPoint(0)
print Point3
Point4 = D.GetPoint(0)
print Point4

newPts = vtk.vtkPoints()

#Do some computations (NewPoint1 and NewPoint2) and add it to the newPts
newPts.InsertPoint(0, NewPoint1)
newPts.InsertPoint(1, NewPoint2)

NewLine = vtk.vtkLine()
NewLine.GetPointIds().SetNumberOfIds(2)
NewLine.GetPointIds().SetId(0,0)
NewLine.GetPointIds().SetId(1,1)

output =  self.GetPolyDataOutput()
output.SetPoints(newPts)
# Crash here... don't know why
output.InsertNextCell(NewLine.GetCellType(), NewLine.GetPointIds())



More information about the ParaView mailing list