<!-- Converted by db4-upgrade version 1.0 -->

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="saveview">

<refmeta>
  <refentrytitle>SAVEVIEW</refentrytitle>
  <manvolnum>nged</manvolnum>
  <refmiscinfo class="source">BRL-CAD</refmiscinfo>
  <refmiscinfo class="manual">BRL-CAD User Commands</refmiscinfo>
</refmeta>

<refnamediv xml:id="name">
  <refname>saveview</refname>
  <refpurpose>Saves the current viewing parameters in the specified <emphasis>file</emphasis>
	in the form of a shell script that will run the BRL-CAD <emphasis>rt</emphasis> program as if it had been
	executed from within MGED using the <command>rt -s512</command> command.</refpurpose>
  </refnamediv>

<!-- body begins here -->
<refsynopsisdiv xml:id="synopsis">
  <cmdsynopsis sepchar=" ">
    <command>saveview</command>    
    <arg choice="req" rep="norepeat"><replaceable>file</replaceable></arg>
    <arg choice="opt" rep="norepeat"><replaceable>args</replaceable></arg>
  </cmdsynopsis>
</refsynopsisdiv>

<refsection xml:id="description"><info><title>DESCRIPTION</title></info>
  
  <para>Saves the current viewing parameters in the specified <emphasis>file</emphasis>
	in the form of a shell script that will run the BRL-CAD <emphasis>rt</emphasis> program as if it had been
	executed from within MGED using the <command>rt -s512</command> command.  Any <emphasis>args</emphasis> 	included on the <command>saveview</command> command line will be copied to the <emphasis>file</emphasis> as 	options to the <emphasis>rt</emphasis> program. If the <emphasis>file</emphasis> already exists, the script 	will be appended to it. This is useful in setting up images to be raytraced later. The default script 	produced by "saveview test.rt" looks like:</para>

<blockquote>
<literallayout class="normal">
#!/bin/sh
rt -M \
 -o test.rt.pix\
 $*\
 model.g\
 'object1' 'object2' \
 2&gt;&gt; test.rt.log\
 &lt;&lt;EOF
viewsize 2.780320739746094e+02;
orientation 2.480973490458727e-01 4.765905732660483e-01
7.480973490458729e-01 3.894348305183902e-01;
eye_pt 1.234152656421214e+02 7.220202900588745e+01
3.845765464924686e+01;
start 0; clean;
end;
EOF
</literallayout>
</blockquote>  
<para> When this script is executed, the image will be stored in <emphasis>test.rt.pix</emphasis>, and all 	messages and errors generated by the <emphasis>rt</emphasis> program will be stored in <emphasis>test.rt.log	</emphasis>. The above script will produce an image of <emphasis>object1</emphasis> and <emphasis>object2	</emphasis> from the BRL-CAD database named <emphasis>model.g</emphasis>. The <emphasis>viewsize</emphasis>, 	<emphasis>orientation</emphasis>, and <emphasis>eye_pt</emphasis> parameters reproduce the view displayed by 	MGED when the <command>saveview</command> command was executed. The presence of $* in the script causes 	any additional command-line options given when the script is invoked to be interpreted as additional 	<emphasis>rt</emphasis> options. Typically, a -s option might be used to set the image size (the default 	is 512 pixels square). See the <emphasis>man</emphasis> page on <emphasis>rt</emphasis> for details on 	available options.
</para>

<para>If you have a <emphasis>saveview</emphasis> script and wish to change MGED to that view, merely cut-and-
	paste, or <emphasis>source</emphasis>, the viewsize, orientation, and eye_pt lines from the <emphasis>	saveview</emphasis> file into MGED.
</para>

<para>Related MGED commands are <command>preview</command>, for viewing the effects of an entire animation
	script, and <command>savekey</command>.  Related BRL-CAD programs are <emphasis>tabsub</emphasis> and 	<emphasis>tabinterp</emphasis>. 
</para>
</refsection>

<refsection xml:id="examples"><info><title>EXAMPLES</title></info>
  
  <para>The example shows the use of the <command>saveview</command> command to create a file that will contain a 	script to run the <emphasis>rt</emphasis> program and create a color-shaded image of the current MGED 	display.
   </para>
         
  <example><info><title>Save current viewing parameters in a specified file in the form of a shell script to run the BRL-CAD 	<emphasis>rt</emphasis> program.</title></info>
    
    <para>
      <prompt>mged&gt;</prompt><userinput>rt_script -s1024</userinput>
    </para>
    <para>Creates (or appends to) a file named <emphasis>rt_script</emphasis> that will contain a script to run 	the <emphasis>rt</emphasis> program and create a color-shaded image of the current MGED display. The image
	produced will be 1024 pixels square.
    </para>
  </example>
 
</refsection>

<info><corpauthor>BRL-CAD Team</corpauthor></info>

<refsection xml:id="bug_reports"><info><title>BUG REPORTS</title></info>
  
  <para>
    Reports of bugs or problems should be submitted via electronic
    mail to &lt;devs@brlcad.org&gt;, or via the "cadbug.sh" script.
  </para>
</refsection>
</refentry>
