Python wrapper for running instances of trisurf-ng
Samo Penic
2017-01-13 8b7022dd45f354a416867c257f8bdc254afe4e14
Changes of VTKRendering due to possibility to compile VTK7
2 files modified
20 ■■■■■ changed files
trisurf/VTKRendering.py 11 ●●●● patch | view | raw | blame | history
trisurf/tsmgr.py 9 ●●●●● patch | view | raw | blame | history
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
@@ -130,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
trisurf/tsmgr.py
@@ -15,7 +15,8 @@
else:
    from urlparse import urlparse
    from vtk import *
    from . import VTKRendering
from . import VTKRendering
#import io
from IPython import embed
@@ -257,9 +258,9 @@
def preview_vtu(args,host):
    #only for localhost at the moment
    if sys.version_info>=(3,0):
        print("Preview works only with python 2.7")
        exit(1)
    #if sys.version_info>=(3,0):
    #    print("Preview works only with python 2.7")
    #    exit(1)
    if host['name'] == socket.gethostname():
        VTKRendering.Renderer(args,host)