[vtkusers] vtkAssembly::SetVisiblity(int)

Eric E. Monson emonson at cs.duke.edu
Thu Jul 8 10:02:10 EDT 2010


Hey Sebastian,

Well, it works for me. Here's a Python example where setting visibility to False gives a blank window, but setting it to True gives a cube and a sphere:

# -------------------------------
import vtk

sphere = vtk.vtkSphereSource()
mapper1 = vtk.vtkPolyDataMapper()
mapper1.SetInputConnection(sphere.GetOutputPort())
actor1 = vtk.vtkActor()
actor1.SetMapper(mapper1)

cube = vtk.vtkCubeSource()
mapper2 = vtk.vtkPolyDataMapper()
mapper2.SetInputConnection(cube.GetOutputPort())
actor2 = vtk.vtkActor()
actor2.SetMapper(mapper2)
actor2.SetPosition(1,1,1)

assemb = vtk.vtkAssembly()
assemb.AddPart(actor1)
assemb.AddPart(actor2)
assemb.SetVisibility(True)

ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)

ren.AddActor(assemb)
ren.ResetCamera()
renWin.Render()
iren.Start()
# -------------------------------

Maybe there's something else happening with yours? What version of VTK and platform are your using?

Talk to you later,
-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Jul 8, 2010, at 9:26 AM, Barth, Sebastian wrote:

> Hello vtkusers,
> 
> I have a vtkAssembly that controls some vtkActors. Everything works fine with rotating and translating the vtkActors with the vtkAssembly.
> If I want to use vtkAssembly::SetVisibility(false) or vtkAssembly::SetVisibilityOff() nothing happens. The actors ignore the visibility of its assembly.
> 
> Is this a bug or a wanted behavior?
> How can I set all of the props added to the assembly set invisible or visible?
> 
> Thanks a lot!
> 
> Best Regards,
> Sebastian Barth
> _______________________________________________
> 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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list