[vtkusers] Question about EdgeVisibility (i.e. it doesn't seem to be implemented)

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Mon Oct 13 05:01:37 EDT 2003


N Smethurst wrote:
> hi all
> 
> Anyone know why it isn't, and if there are plans to do so? I was kind of 
> hoping to be able to visualise surfaces with the surface and wireframe 
> representation at the same time.
> 
> Unfortunately, although the EdgeVisibility variable is defined in the 
> property super-class, it isn't used anywhere. Rather strange don't you 
> think?
> 
> Would it be difficult to implement? If there are no plans for doing something 
> for edge visibility in VTK CVS, I was thinking that perhaps I could create 
> my own property class modified from vtkProperty, which has the edge 
> visibility functionality.
> 

I guess you can use 2 mappers:

import vtk
from vtk.util.colors import *
from vtk.util.misc import vtkGetDataRoot

VTK_DATA_ROOT = vtkGetDataRoot()

reader = vtk.vtkSTLReader()
reader.SetFileName(VTK_DATA_ROOT + "/Data/42400-IDGH.stl")

# Create the RenderWindow, Renderer and both Actors
ren1 = vtk.vtkRenderer ()

renWin1 = vtk.vtkRenderWindow ()
renWin1 .AddRenderer (ren1)

dsm1 = vtk.vtkPolyDataMapper ()
dsm1.SetInput (reader.GetOutput())

dsm2 = vtk.vtkPolyDataMapper ()
dsm2.SetInput (reader.GetOutput())

actor1 = vtk.vtkActor ()
actor1 .SetMapper (dsm1)

actor2 = vtk.vtkActor ()
actor2 .SetMapper (dsm2)

actor1.GetProperty().SetColor (red)
actor2.GetProperty().SetRepresentationToWireframe()

# Add the actors to the renderer, set the background and size
ren1.AddActor (actor1)
ren1.AddActor (actor2)

iren = vtk.vtkRenderWindowInteractor ()
iren .SetRenderWindow (renWin1)

renWin1.Render()

iren.Start()


HTH
mathieu




More information about the vtkusers mailing list