Python wrapper for running instances of trisurf-ng
Samo Penic
2017-01-13 d00e25d854a5c9d4234b750000bbd01749fe4337
trisurf/VTKRendering.py
@@ -1,9 +1,10 @@
import os,sys
from . import trisurf
if sys.version_info<(3,0):
try:
   from vtk import *
except:
   print("Vtk rendering works if you manually install vtk7 for python3")
   exit(1)
class MultiRender:
   def __init__(self,args,host):
@@ -51,7 +52,7 @@
      output = reader.GetOutput()
      scalar_range = output.GetScalarRange()
      mapper = vtkDataSetMapper()
      mapper.SetInput(output)
      mapper.SetInputData(output)
      mapper.SetScalarRange(scalar_range)
      # Create the Actor
@@ -103,10 +104,9 @@
      interactor = vtkRenderWindowInteractor()
      interactor.SetRenderWindow(self.renderer_window)
      interactor.Initialize()
       interactor.AddObserver("TimerEvent", self.RenderUpdate)
      interactor.AddObserver("TimerEvent", self.RenderUpdate)
      timerIDR = interactor.CreateRepeatingTimer(1000)
      interactor.Start()
      return
   def lastVTU(self):
@@ -131,7 +131,7 @@
      output = reader.GetOutput()
      scalar_range = output.GetScalarRange()
      mapper = vtkDataSetMapper()
      mapper.SetInput(output)
      mapper.SetInputData(output)
      mapper.SetScalarRange(scalar_range)
      # Create the Actor