'\" t
.\"     Title: db
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 04/13/2022
.\"    Manual: BRL-CAD MGED Commands
.\"    Source: BRL-CAD
.\"  Language: English
.\"
.TH "DB" "nged" "04/13/2022" "BRL\-CAD" "BRL\-CAD MGED 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"
db \- Provides an interface to a number of database manipulation routines\&.
.SH "SYNOPSIS"
.HP \w'\fBdb\fR\ 'u
\fBdb\fR {\fIcommand\fR} [\fIarguments\fR]
.SH "DESCRIPTION"
.PP
Provides an interface to a number of database manipulation routines\&. Note that this command always operates in units of millimeters\&. The
\fIcommand\fR
must be one of the following with appropriate arguments:
.PP
\fImatch [regular_exp]\fR
.RS 4
Returns a list of all objects in that database that match the list of regular expressions\&.
.RE
.PP
\fIget shape_or_path [attribute]\fR
.RS 4
Returns information about the primitive shape at the end of the
\fIshape_or_path\fR\&. If a path is specified, the transformation matrices encountered along that path will be accumulated and applied to the leaf shape before displaying the information\&. If no
\fIattribute\fR
is specified, all the details about the shape are returned\&. If a specific
\fIattribute\fR
is listed, then only that information is returned\&.
.RE
.PP
\fIput shape_name shape_type attributes\fR
.RS 4
Creates shape named
\fIshape_name\fR
of type
\fIshape_type\fR
with attributes as listed in
\fIattributes\fR\&. The arguments to the
\fIput\fR
command are the same as those returned by the
\fIget\fR
command\&.
.RE
.PP
\fIadjust shape_name attribute new_value1 [new_value2 new_value3\&.\&.\&.]\fR
.RS 4
Modifies the shape named
\fIshape_name\fR
by adjusting the value of its
\fIattribute\fR
to the
\fInew_values\fR\&.
.RE
.PP
\fIform object_type\fR
.RS 4
Displays the format used to display objects of type
\fIobject_type\fR\&.
.RE
.PP
\fItops\fR
.RS 4
Returns all top\-level objects\&.
.RE
.PP
\fIclose\fR
.RS 4
Closes the previously opened database and deletes the associated command\&.
.RE
.SH "EXAMPLES"
.PP
The following examples show the uses of the
\fBdb\fR
command to list various objects and attributes from the database, as well as to create new TGC shapes, adjust a vertex attribute, and display command formats\&.
.PP
\fBExample\ \&1.\ \&List all objects in the database that end with ".s"\fR
.PP
mged> \fBdb match *\&.s\fR
.RS 4
Gets a list of all objects in the database that end with \&.s\&.
.RE
.PP
\fBExample\ \&2.\ \&List all attributes and their values for \fIcone\&.s\fR\fR
.PP

mged>\fBdb get cone\&.s\fR
.PP
Gets a list of all the attributes and their values for shape
\fIcone\&.s\fR\&.
.PP
\fBExample\ \&3.\ \&Get the value of the vertex attribute of \fIcone\&.s\fR\fR
.PP

mged>\fBdb get cone\&.s V\fR
.PP
Gets the value of the
\fIV\fR
(vertex) attribute of shape
\fIcone\&.s\fR
.PP
\fBExample\ \&4.\ \&Create a new TGC shape named \fInew_cone\&.s\fR with specified attributes.\fR
.PP

mged>\fBdb put new_cone\&.s tgc V {0 0 0} H {0 0 1} A {1 0 0} B {0 1 0} C {5 0 0} D {0 5 0}\fR
.PP
Creates a new TGC shape named
\fInew_cone\&.s\fR
with the specified attributes\&.
.PP
\fBExample\ \&5.\ \&Adjust the vertex attribute of \fInew_cone\&.s\fR to a given value.\fR
.PP

mged>\fBdb adjust new_cone\&.s V {0 0 10}\fR
.PP
Adjusts the
\fIV\fR
(vertex) attribute of
\fInew_cone\&.s\fR
to the value {0 0 10}\&.
.PP
\fBExample\ \&6.\ \&Display the format used by the get and put commands for the TGC shape type.\fR
.PP

mged>\fBdb form tgc\fR
.PP
Displays the format used by the
\fBget\fR
and
\fBput\fR
commands for the TGC shape type\&.
.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
