[Paraview] setting graphical window size
David Doria
daviddoria at gmail.com
Thu May 7 07:42:16 EDT 2009
On Thu, May 7, 2009 at 1:28 AM, John <bitumen.surfer at gmail.com> wrote:
> Hi,
>
> I'm using to paraview to create screenshots of multiple sets of data
> (12+). Each dataset is located in a separate file and may have different
> boundary conditions or different surfaces. (i.e. they are not identical
> - although they *might* have elements in common and their domain size is
> the same). I've written a simple script (below) using python to set my
> camera angle the same between loading the state for each scenario
>
> However, I have one difficulty, if I have exited paraview or resized the
> windows (or .#%#@.. it crashed ) the size & aspect ratio of the window
> displaying my 3D view may change. This results in my screenshots have
> differing resolutions i.e. my first series had 1198x712 but my next was
> 1106x780. I know you can specify this resolution in the save screenshot
> dialog - however this is after the fact and some elements seem to differ
> based on the real size (i.e. legends)
>
> I can't seem to find an option to specify the size of this window, but I
> assume I may be able to via python ? can anyone help with this ?
>
> Also would love to know how to move the location of the orientation axes ?
>
> For reference, I am not a python programmer ( but can program C, C++,
> Fortran ... ) so forgive any style mistakes.
>
> Thanks, John
>
> My quick script to set camera state is: (iso_L.py)
> #!/usr/bin/env python
>
> from paraview.servermanager import *
> if not servermanager.ActiveConnection:
> connection = servermanager.Connect()
> view = servermanager.GetRenderView()
> camera = view.GetActiveCamera()
> view.CameraPosition=[0.5,-4,4]
> view.CameraFocalPoint=[2.915, 0, 0.821]
> view.CameraViewUp=[0, 0, 1]
> view.CameraViewAngle=30
> #view.ResetCamera()
> view.StillRender()
> _______________________________________________
>
Hi John,
Is it view.ViewSize you are looking for?
http://www.paraview.org/Wiki/ParaView/Python_Scripting#Take_a_Screenshot_of_a_VTP_File
That is in my "outside paraview" area, which means I've only tried it from a
terminal, running the script with
pvpython ./script.py
I'm not sure if it will work inside python, but let me know if it does / if
that's what you needed.
Thanks,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090507/f2c7fcd4/attachment.htm>
More information about the ParaView
mailing list