@@ -0,0 +1,1802 @@
+#!/usr/bin/env python%0A%0Aimport vtk%0A%0Adef main():%0A    # PART 1 Make some Data.%0A    # Make a tree.%0A    root = vtk.vtkMultiBlockDataSet()%0A    %0A    branch = vtk.vtkMultiBlockDataSet()%0A    root.SetBlock(0, branch)%0A    %0A    # Make some leaves.%0A    leaf1 = vtk.vtkSphereSource()%0A    leaf1.SetCenter(0,0,0)%0A    leaf1.Update()%0A    branch.SetBlock(0, leaf1.GetOutput())%0A    %0A    leaf2 = vtk.vtkSphereSource()%0A    leaf2.SetCenter(1.75,2.5,0)%0A    leaf2.SetRadius(1.5)%0A    leaf2.Update()%0A    branch.SetBlock(1, leaf2.GetOutput())%0A    %0A    leaf3 = vtk.vtkSphereSource()%0A    leaf3.SetCenter(4,0,0)%0A    leaf3.SetRadius(2)%0A    leaf3.Update()%0A    root.SetBlock(1, leaf3.GetOutput())%0A    %0A    # PART 2 Do something with the data%0A    # a non composite aware filter, the pipeline will iterate%0A    edges = vtk.vtkExtractEdges()%0A    edges.SetInputData(root)%0A    %0A    # PART 3 Show the data%0A    # also demonstrate a composite aware filter%0A    # this filter aggregates all blocks into one polydata%0A    # this is handy for display, although fairly limited%0A    # see vtkCompositePolyDataMapper2 for something better%0A    polydata = vtk.vtkCompositeDataGeometryFilter()%0A    polydata.SetInputConnection(edges.GetOutputPort())%0A  %0A    %0A    # Create the Renderer, RenderWindow, and RenderWindowInteractor.%0A    renderer = vtk.vtkRenderer()%0A    renderWindow  = vtk.vtkRenderWindow()%0A    renderWindow.AddRenderer(renderer)%0A    renderWindowInteractor = vtk.vtkRenderWindowInteractor()%0A    renderWindowInteractor.SetRenderWindow(renderWindow)%0A    %0A    mapper = vtk.vtkPolyDataMapper()%0A    mapper.SetInputConnection(0, polydata.GetOutputPort(0))%0A    actor = vtk.vtkActor()%0A    actor.SetMapper(mapper)%0A%0A%09# Enable user interface interactor.%0A    renderer.AddActor(actor)%0A    renderWindowInteractor.Start()%0A%09%0Aif __name__ == '__main__':%0A    main()%0A

Create MultiBlockDataSet.py