'\" t
.\"     Title: SAVEVIEW
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 04/13/2022
.\"    Manual: BRL-CAD User Commands
.\"    Source: BRL-CAD
.\"  Language: English
.\"
.TH "SAVEVIEW" "nged" "04/13/2022" "BRL\-CAD" "BRL\-CAD User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
saveview \- Saves the current viewing parameters in the specified \fIfile\fR in the form of a shell script that will run the BRL\-CAD \fIrt\fR program as if it had been executed from within MGED using the \fBrt \-s512\fR command\&.
.SH "SYNOPSIS"
.HP \w'\fBsaveview\fR\ 'u
\fBsaveview\fR [\-e\ \fIcommand\fR] [\-l\ \fIlogfile\fR] [\-o\ \fIoutputfile\fR] [\-e\ \fIinputfile\fR] {\fIfile\fR} [\fIargs\fR]
.SH "DESCRIPTION"
.PP
Saves the current viewing parameters in the specified
\fIfile\fR
in the form of a shell script that will run the BRL\-CAD
\fIrt\fR
program as if it had been executed from within MGED using the
\fBrt \-s512\fR
command\&. Any
\fIargs\fR
included on the
\fBsaveview\fR
command line will be copied to the
\fIfile\fR
as options to the
\fIrt\fR
program\&. If the
\fIfile\fR
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:
.sp
.if n \{\
.RS 4
.\}
.nf
#!/bin/sh
rt \-M \e
 \-o test\&.rt\&.pix\e
 $*\e
 model\&.g\e
 \*(Aqobject1\*(Aq \*(Aqobject2\*(Aq \e
 2>> test\&.rt\&.log\e
 <<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
.fi
.if n \{\
.RE
.\}
.PP
When this script is executed, the image will be stored in
\fItest\&.rt\&.pix\fR, and all messages and errors generated by the
\fIrt\fR
program will be stored in
\fItest\&.rt\&.log \fR\&. The above script will produce an image of
\fIobject1\fR
and
\fIobject2 \fR
from the BRL\-CAD database named
\fImodel\&.g\fR\&. The
\fIviewsize\fR,
\fIorientation\fR, and
\fIeye_pt\fR
parameters reproduce the view displayed by MGED when the
\fBsaveview\fR
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
\fIrt\fR
options\&. Typically, a \-s option might be used to set the image size (the default is 512 pixels square)\&. See the
\fIman\fR
page on
\fIrt\fR
for details on available options\&.
.PP
If you have a
\fIsaveview\fR
script and wish to change MGED to that view, merely cut\-and\- paste, or
\fIsource\fR, the viewsize, orientation, and eye_pt lines from the
\fI saveview\fR
file into MGED\&.
.PP
The following options are valid for this command:
.PP
\fI\-e command\fR
.RS 4
Makes the script run the specified
\fIcommand\fR
instead of the default of rt
.RE
.PP
\fI\-l logfile\fR
.RS 4
Makes the script direct log output to the specified
\fIlogfile\fR
instead of to the default of
\fIfile\fR\&.log (\fIfile\fR
is the inputfile basename)\&.
.RE
.PP
\fI\-o outputfile\fR
.RS 4
Makes the script output the image to the specified
\fIoutputfile\fR
instead of to the default of
\fIfile\fR\&.pix (\fIfile\fR
is the inputfile basename)\&.
.RE
.PP
\fI\-i inputfile\fR
.RS 4
Makes the script load data from
\fIinputfile\fR
instead of from the default of the currently opened database\&.
.RE
.SH "EXAMPLES"
.PP
The example shows the use of the
\fBsaveview\fR
command to create a file that will contain a script to run the
\fIrt\fR
program and create a color\-shaded image of the current MGED display\&.
.PP
\fBExample\ \&1.\ \&Save current viewing parameters in a specified file in the form of a shell script to run the BRL-CAD \fIrt\fR program.\fR
.PP

mged>\fBsaveview script\&.rt \-s1024\fR
.PP
Creates (or appends to) a file named
\fIscript\&.rt\fR
that will contain a POSX shell script for running the
\fIrt\fR
program and create a color\-shaded image of the current MGED display\&. The image produced will be 1024 pixels square due to the additional
\fB\-s1024\fR
arg specified after the script name\&. Additional args are passed to
\fIrt\fR\&.
.SH "AUTHOR"
.PP
BRL\-CAD Team
.SH "BUG REPORTS"
.PP
Reports of bugs or problems should be submitted via electronic mail to
devs@brlcad\&.org
