Skip to content

Commit

Permalink
Increase the initial GL2PS feedback buffer size.
Browse files Browse the repository at this point in the history
To prevent having to resize and rerender multiple times when a very large
amount of data is pushed through (see #517), start with a 50MB buffer.

This buffer size is sufficient to store the 1M triangles used in the #517
example.
  • Loading branch information
David C. Lonie committed Feb 9, 2015
1 parent 60b5589 commit 4873893
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Packages/vcs/Lib/VTKPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,13 @@ 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.
gl.SetBufferSize(50*1024*1024) # 50MB

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

0 comments on commit 4873893

Please sign in to comment.