MantisBT - VTK
View Issue Details
0002974VTK(No Category)public2006-03-18 17:062016-08-12 09:54
bryan 
Dave DeMarle 
normalmajoralways
closedmoved 
 
 
0002974: vtkProgrammableSource doesn't work with StructuredGrids
vtkProgrammableSource, used from the python bindings, apparently cannot product valid StructuredGrid datasets. The GetStructuredGridOutput() method returns a StructuredGrid object which cannot be rendered.

The script below illustrates this. This script should create a 25-by-25 grid. However, nothing is rendered, even though the output of the Source appears correct (when 'printed').

By contrast, if I create a StructuredGrid manually and use the same function to create the pointSet, it works fine.

Only tested this on linux so far. The problem is the same on VTK-4.2 & 5.0.0

Below is the example (python) code:
------------------------------------------
import vtk

source = vtk.vtkProgrammableSource()
def Execute():
    grid = source.GetStructuredGridOutput()
    points = vtk.vtkPoints()

    nx,ny = 25,25
    
    for i in xrange(nx):
        for j in xrange(ny):
            points.InsertNextPoint(i/5.0,j/5.0,0.0)
            
    grid.SetDimensions(nx,ny,1)
    grid.SetPoints(points)

source.SetExecuteMethod(Execute)
    
map = vtk.vtkDataSetMapper()
map.SetInput(source.GetStructuredGridOutput())

act = vtk.vtkActor()
act.SetMapper(map)

ren = vtk.vtkRenderer()
ren.AddActor(act)

renwin = vtk.vtkRenderWindow()
renwin.AddRenderer(ren)

iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renwin)
iren.Start()
No tags attached.
Issue History
2008-11-30 09:12Mathieu MalaterreAssigned ToMathieu Malaterre => David Cole
2011-01-19 09:57David ColeAssigned ToDavid Cole =>
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2013-06-05 17:48Jean-Christophe Fillion-RobinNote Added: 0030953
2013-07-22 19:20Dave DeMarleNote Added: 0031221
2013-07-22 19:20Dave DeMarleStatusbacklog => expired
2013-07-22 19:20Dave DeMarleAssigned To => Dave DeMarle
2016-08-12 09:54Kitware RobotNote Added: 0036845
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0030953)
Jean-Christophe Fillion-Robin   
2013-06-05 17:48   
Does the problem still occur with VTK 5.10 ? VTK 6 ?
(0031221)
Dave DeMarle   
2013-07-22 19:20   
The problem was that you needed to announce the structured extent in the request information pass. If you that doesn't work in 6.0.0, please reopen.
(0036845)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.