Skip to content

Commit

Permalink
Merge pull request #1016 from UV-CDAT/vector-graphics-buffer-size
Browse files Browse the repository at this point in the history
Increase the initial GL2PS feedback buffer size.
  • Loading branch information
doutriaux1 committed Feb 12, 2015
2 parents 268ee14 + 6897c5c commit c184be3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Packages/vcs/Lib/VTKPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,22 @@ def vectorGraphics(self, output_type, file, width=None, height=None, units=None)
raise Exception("Nothing on Canvas to dump to file")

gl = vtk.vtkGL2PSExporter()

# This is the size of the initial memory buffer that holds the transformed
# vertices produced by OpenGL. If you start seeing a lot of warnings:
# GL2PS info: OpenGL feedback buffer overflow
# increase it to save some time.
# ParaView lags so we need a try/except around this
# in case it is a ParaView build
try:
gl.SetBufferSize(50*1024*1024) # 50MB
except:
pass

# Since the vcs layer stacks renderers to manually order primitives, sorting
# is not needed and will only slow things down and introduce artifacts.
gl.SetSortToOff()

gl.SetInput(self.renWin)
gl.SetCompress(0) # Do not compress
gl.SetFilePrefix(".".join(file.split(".")[:-1]))
Expand Down

0 comments on commit c184be3

Please sign in to comment.