Difference between revisions of "Get View"

From PyMOLWiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 
===DESCRIPTION===
 
===DESCRIPTION===
+
'''get_view''' returns and optionally prints out the current view information in a format which can be embedded into a command script and can be used in subsequent calls to '''set_view'''.
  "get_view" returns and optionally prints out the current view
+
 
  information in a format which can be embedded into a command
+
If a log file is currently open, get_view will not write the view matrix to the screen unless the "output" parameter is 2.
  script and can be used in subsequent calls to "set_view".
+
 
 
  If a log file is currently open, get_view will not write the view
 
  matrix to the screen unless the "output" parameter is 2.
 
 
 
===USAGE===  
 
===USAGE===  
  get_view
+
get_view
+
 
 
===PYMOL API===
 
===PYMOL API===
<source lang="python">
+
<source lang="python">
  cmd.get_view(output=1,quiet=1)
+
cmd.get_view(output=1,quiet=1)
 
    
 
    
  my_view= cmd.get_view()
+
my_view= cmd.get_view()
</source>
+
</source>
  
  output control:
+
output control:
 
+
*0 = output matrix to screen
      0 = output matrix to screen
+
*1 = don't output matrix to screen
      1 = don't output matrix to screen
+
*2 = force output to screen even if log file is open
      2 = force output to screen even if log file is open
+
*3 = return formatted string instead of a list
      3 = return formatted string instead of a list
 
 
          
 
          
 
===API USAGE===
 
===API USAGE===
<source lang="python">
+
<source lang="python">
  cmd.get_view(0) # zero option suppresses output (LEGACY approach)
+
cmd.get_view(0) # zero option suppresses output (LEGACY approach)
  cmd.get_view(quiet=1) # suppresses output using PyMOL's normal "quiet" parameter.
+
cmd.get_view(quiet=1) # suppresses output using PyMOL's normal "quiet" parameter.
</source>
+
</source>
+
 
 
===NOTES===
 
===NOTES===
    Contents of the view matrix
+
Contents of the view matrix
      0  -  8 = 3x3 rotation matrix which transforms model to camera space
+
*0  -  8 = 3x3 rotation matrix which transforms model to camera space
      9  - 11 = camera position (in model space and relative to the origin of rotation)
+
*9  - 11 = camera position (in model space and relative to the origin of rotation)
      12 - 14 = origin of rotation (in model space)
+
*12 - 14 = origin of rotation (in model space)
      15      = front plane distance from the camera
+
*15      = front plane distance from the camera
      16      = rear plane distance from the camera
+
*16      = rear plane distance from the camera
      17      = orthoscopic flag  
+
*17      = orthoscopic flag  
 
   
 
   
 
===SEE ALSO===
 
===SEE ALSO===
    [[Cmd set_view]]
+
[[set_view]]
+
 
 
[[Category:Commands|get_view]]
 
[[Category:Commands|get_view]]

Revision as of 14:53, 10 January 2006

DESCRIPTION

get_view returns and optionally prints out the current view information in a format which can be embedded into a command script and can be used in subsequent calls to set_view.

If a log file is currently open, get_view will not write the view matrix to the screen unless the "output" parameter is 2.

USAGE

get_view

PYMOL API

cmd.get_view(output=1,quiet=1)
   
my_view= cmd.get_view()

output control:

  • 0 = output matrix to screen
  • 1 = don't output matrix to screen
  • 2 = force output to screen even if log file is open
  • 3 = return formatted string instead of a list

API USAGE

cmd.get_view(0) # zero option suppresses output (LEGACY approach)
cmd.get_view(quiet=1) # suppresses output using PyMOL's normal "quiet" parameter.

NOTES

Contents of the view matrix

  • 0 - 8 = 3x3 rotation matrix which transforms model to camera space
  • 9 - 11 = camera position (in model space and relative to the origin of rotation)
  • 12 - 14 = origin of rotation (in model space)
  • 15 = front plane distance from the camera
  • 16 = rear plane distance from the camera
  • 17 = orthoscopic flag

SEE ALSO

set_view