Commit 5cbf2e5d2cbd21f88740f9aae2089bccf1ab1607

Authored by Thiago Franco de Moraes
1 parent ac56cedc
Exists in inv3.0.1

It wasn't showing surface when opening a inv3 proj

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
invesalius/data/surface.py
@@ -351,6 +351,7 @@ class SurfaceManager(): @@ -351,6 +351,7 @@ class SurfaceManager():
351 surface_dict = pubsub_evt.data 351 surface_dict = pubsub_evt.data
352 for key in surface_dict: 352 for key in surface_dict:
353 surface = surface_dict[key] 353 surface = surface_dict[key]
  354 +
354 # Map polygonal data (vtkPolyData) to graphics primitives. 355 # Map polygonal data (vtkPolyData) to graphics primitives.
355 normals = vtk.vtkPolyDataNormals() 356 normals = vtk.vtkPolyDataNormals()
356 normals.SetInputData(surface.polydata) 357 normals.SetInputData(surface.polydata)
@@ -358,14 +359,14 @@ class SurfaceManager(): @@ -358,14 +359,14 @@ class SurfaceManager():
358 normals.AutoOrientNormalsOn() 359 normals.AutoOrientNormalsOn()
359 # normals.GetOutput().ReleaseDataFlagOn() 360 # normals.GetOutput().ReleaseDataFlagOn()
360 361
361 - # Improve performance 362 + # Improve performance
362 stripper = vtk.vtkStripper() 363 stripper = vtk.vtkStripper()
363 - stripper.SetInputData(normals.GetOutput()) 364 + stripper.SetInputConnection(normals.GetOutputPort())
364 stripper.PassThroughCellIdsOn() 365 stripper.PassThroughCellIdsOn()
365 stripper.PassThroughPointIdsOn() 366 stripper.PassThroughPointIdsOn()
366 367
367 mapper = vtk.vtkPolyDataMapper() 368 mapper = vtk.vtkPolyDataMapper()
368 - mapper.SetInputData(stripper.GetOutput()) 369 + mapper.SetInputConnection(stripper.GetOutputPort())
369 mapper.ScalarVisibilityOff() 370 mapper.ScalarVisibilityOff()
370 mapper.ImmediateModeRenderingOn() # improve performance 371 mapper.ImmediateModeRenderingOn() # improve performance
371 372