[Paraview] vtkStringArray and CopyStructure

Yves Rogez yves.rogez at obs.ujf-grenoble.fr
Mon Aug 12 10:37:23 EDT 2013


Hi,

I'm trying to pass string arrays stored in vtkPolyData sets through the 
pipeline, using Python programmable filters.
Below is a sample code :

In a ProgrammableSource1 :

    /output=self.GetOutput()/

    /
    /

    /points=vtk.vtkPoints()/

    /points.SetNumberOfPoints(1)/

    /points.SetPoint(0,0,0,0)/

    /
    /

    /stra=vtk.vtkStringArray()/

    /stra.SetName("hop")/

    /stra.Allocate(1)/

    /stra.InsertNextValue("hop")/

    /
    /

    /output.SetPoints(points)/

    /output.GetPointData().AddArray(stra)/

In a directly connected ProgrammableFilter1 :

/
//        input=self.GetInput()/

//

/output=self.GetOutput()/

//

/
/

//

/output.SetPoints(input.GetPoints())/

//

/output.GetPointData().CopyStructure(input.GetPointData())/

//

/
/

//

/print input.GetPointData().GetArray("hop")/


The result of the 'print' call at the end is "None", but should not be 
in my understanding. If we do the exact same thing with a 
vtkDoubleArray, it works.

Any idea on this issue ?

Thanks,

Yves

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130812/a1ec1ee6/attachment.htm>


More information about the ParaView mailing list