From d00e25d854a5c9d4234b750000bbd01749fe4337 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Fri, 13 Jan 2017 23:21:38 +0000
Subject: [PATCH] Fix in importing VTKRendering

---
 trisurf/VTKRendering.py |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/trisurf/VTKRendering.py b/trisurf/VTKRendering.py
index 76ff9e7..44fe699 100644
--- a/trisurf/VTKRendering.py
+++ b/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

--
Gitblit v1.9.3