-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grabWindowPixmap() broken for QCDATWidget #1276
Comments
Options are: make VisTrails feed a temporary filename to VCS, or directly get an in-memory buffer from VCS. |
Traceback as of 2.2.0-45, vistrails 2.2.0-12
Second attempt at exporting causes segmentation fault:
|
@doutriaux1 Is rendering to a memory buffer going to be supported in vcs? It looks like VCS plots have never been exportable in the spreadsheet since their introduction in 2011. |
This seems to work: diff --git a/Packages/vcs/Lib/VTKPlots.py b/Packages/vcs/Lib/VTKPlots.py
index 1c1f112..bd894b0 100644
--- a/Packages/vcs/Lib/VTKPlots.py
+++ b/Packages/vcs/Lib/VTKPlots.py
@@ -851,17 +851,18 @@ def gif(self,filename='noname.gif', merge='r', orientation=None, geometry='1600x
def png(self, file, width=None,height=None,units=None,draw_white_background = True, **args ):
+@ -854,13 +1583,14 @@ def png(self, file, width=None,height=None,units=None,draw_white_background = Tr
if self.renWin is None:
raise Exception,"Nothing to dump aborting"
- if not file.split('.')[-1].lower() in ['png']:
- file+='.png'
-
- try:
- os.remove(file)
- except:
- pass
+ if file is not None:
+ if not file.split('.')[-1].lower() in ['png']:
+ file+='.png'
+ try:
+ os.remove(file)
+ except:
+ pass
#if width is not None and height is not None:
# self.renWin.SetSize(width,height)
@@ -883,8 +884,16 @@ def png(self, file, width=None,height=None,units=None,draw_white_background = Tr
writer = vtk.vtkPNGWriter()
writer.SetInputConnection(imgfiltr.GetOutputPort())
- writer.SetFileName(file)
+
+ if file is not None:
+ writer.SetFileName(file)
+ else:
+ writer.WriteToMemoryOn()
writer.Write()
+ if file is not None:
+ return file
+ else:
+ return writer.GetResult() |
@remram44 I believe that's what bg=1 is for. |
Is it something cdat used to have? |
still does x.plot(data,bg=1) |
The saveToPNG() implementation in QCDATWidget doesn't correctly handle the case where the filename argument is None, which makes VCS fail.
I'm not sure what is expected here.
The text was updated successfully, but these errors were encountered: