Permalink
Browse files

Merge pull request #12784 from rwcarlsen/peacock-vtk8

fix peacock for vtk8
  • Loading branch information...
aeslaughter committed Jan 30, 2019
2 parents b3f6f0a + 6228648 commit 6608f3ba40b2c12e174fa5f39d7a4bc89ac02be7
@@ -17,6 +17,7 @@
import misc
import mooseutils

VTK_MAJOR_VERSION = vtk.vtkVersion.GetVTKMajorVersion()

class RenderWindow(base.ChiggerObject):
"""
@@ -39,7 +40,6 @@ def getOptions():
opt.add('offscreen', False, "Enable offscreen rendering.")
opt.add('chigger', False, "Places a chigger logo in the lower left corner.")
opt.add('smoothing', False, "Enable VTK render window smoothing options.")
opt.add('multisamples', None, "Set the number of multi-samples.", vtype=int)
opt.add('antialiasing', 0, "Number of antialiasing frames to perform "
"(set vtkRenderWindow::SetAAFrames).", vtype=int)

@@ -220,12 +220,6 @@ def update(self, **kwargs):
self.__vtkwindow.SetPolygonSmoothing(smooth)
self.__vtkwindow.SetPointSmoothing(smooth)

if self.isOptionValid('antialiasing'):
self.__vtkwindow.SetAAFrames(self.getOption('antialiasing'))

if self.isOptionValid('multisamples'):
self.__vtkwindow.SetMultiSamples(self.getOption('multisamples'))

if self.isOptionValid('size'):
self.__vtkwindow.SetSize(self.getOption('size'))

@@ -235,6 +229,13 @@ def update(self, **kwargs):
n = self.__vtkwindow.GetNumberOfLayers()
for result in self._results:
renderer = result.getVTKRenderer()
if self.isOptionValid('antialiasing'):
if VTK_MAJOR_VERSION < 8:
self.__vtkwindow.SetAAFrames(self.getOption('antialiasing'))
else:
renderer.SetUseFXAA(True)
self.__vtkwindow.SetMultiSamples(self.getOption('antialiasing'))

if not self.__vtkwindow.HasRenderer(renderer):
self.__vtkwindow.AddRenderer(renderer)
if result.needsUpdate():
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
import sys, os
import signal

0 comments on commit 6608f3b

Please sign in to comment.