There are two types of commands in partiview
:
Control Commands and Data Commands.
Probably the most important difference between the two is that Control
Commands return feedback to the user, whereas Data Commands
are interpreted without comment. The command window expects
to receive Control Commands. However, it is possible to
enter a Data Command where a Control Command is expected,
using the add
command prefix. (Likewise, a control command
may be given where data is expected, using the eval
prefix.)
(see partibrains.c::specks_parse_args)
Control Commands are accepted in the Command window, and in some other contexts.
Generally, partiview
gives a response to every Control Command,
reporting the (possibly changed) status.
Typically, if parameters are omitted, the current state is reported.
Some commands apply to particles in the current group (see Object group commands); others affect global things, such as time or display settings.
Data Commands can also be given, if prefixed with add
.
Read a file containing Data Commands (typical suffix .cf
or .speck
).
Run an arbitrary unix command (invoked via /bin/sh) as a subprocess of partiview
.
Its standard output is interpreted as a stream of control commands.
Thus partiview
can be driven externally, e.g. to record an animation
(using the snapshot
command), or to provide additional GUI controls.
Several async
commands can run concurrently.
Enter a Data Command where a Control Command is expected, e.g. in the text input box. For example,
add 10 15 -1 text blahadds a new label "blah" at 10 15 -1, or
add kira myrun.outloads a starlab output file.
Processes that control command just as if the eval
prefix weren't there.
Provided for symmetry: wherever either a control command or a data command
is expected, entering eval
control-command ensures that it's
taken as a control command.
Determines the list of directories where all data files, color maps, etc.
are sought. See the filepath
entry under
Data Commands.
Partiview
can load multiple groups of particles,
each with independent display settings, colormaps, etc.
When more than one group is loaded, the Group Row appears on the GUI,
with one toggle-button for each group. Toggling the button turns
display of that group on or off. Right-clicking turns the group unconditionally on,
and selects that group as the current one for other GUI controls.
Many Control Commands apply to the currently selected group.
Groups always have names of the form gN for some small positive N; each group may also have an alias.
Select group gN. Create a new group if it doesn't already exist.
Assign name alias to group gN.
Likewise, select object objectname, which may be either an alias name or gN.
Either form may be used as a prefix to any control command
to act on the specified group, e.g. object fred poly on
Invoke the given control-command in all groups. For example, to turn display of group 3 on and all others off, use:
gall off
g3 on
Enable display of currently selected group (as it is by default).
Turn off display of current group.
View commands affect the view; they aren't specific to data groups.
Angular field of view (in degrees) in Y-direction.
Set point of interest. This is the center of rotation in
[o]rbit
and [r]otate
modes. Also, in [o]rbit
mode,
translation speed is proportional to the viewer's distance from this point.
The optional RADIUS (also set by censize
) determines the size
of the marker crosshair, initially 1 unit.
Set size of point-of-interest marker.
Report the 3-D camera position and forward direction vector.
Clipping distances. The computer graphics setup always requires drawing only objects in some finite range of distances in front of the viewpoint. Both values must be strictly positive, and their ratio is limited; depending on the graphics system in use, distant objects may appear to blink if the FAR/NEAR ratio exceeds 10000 or so.
To set the far clip range without changing the near, use a non-numeric
near clip value, e.g. clip - 1000
.
Get or set the current position (XYZ) and/or viewing (RxRyRz) angle.
Read a Wavefront (.wf
) file describing a path through space.
Synonym for readpath.
Play the currently loaded (from readpath
/rdata
) camera animation
path, at speed times normal speed,
skipping frames as needed to keep up with wall-clock time.
(Normal speed is 30 frames per second.)
With "f" suffix, displays every speed-th frame, without regard to real
time.
Get or set the current frame the frameno-th.
Ensures the display is updated, as before taking a snapshot.
Probably only useful in a stream of control commands from an async
subprocess.
Set window background color (three R G B numbers or one grayscale value).
Set point of interest. This is the center of rotation in
[o]rbit
and [r]otate
modes. And, in [o]rbit
mode,
translation speed is proportional to the viewer's distance from this point.
The optional RADIUS (also set by censize
) determines the size
of the marker crosshair, initially 1 unit.
Set size of point-of-interest marker.
Focal length: distance from viewer to a typical object of interest.
This affects stereo display (see below) and navigation: the speed of
motion in [t]ranslate
and [f]ly
modes is proportional to this
distance.
Stereo display. Also toggled on/off by typing 's'> key in graphics window.
Where hardware allows it,
green or red/blue glasses.
Useful separation values might be 0.02 to 0.1, or -0.02 to -0.1 to swap
eyes. See also stereo glasses
selects
CrystalEyes-style stereo. All systems should be capable of
stereo redcyan
, which requires wearing redfocallen
command, which gives the distance to
a typical object of interest: left- and right-eye images of an object
at that distance will coincide on the screen.
Set parameters for future snapshot
commands.
FILESTEM may be a printf format string with frame number as
argument, e.g. snapset pix/%04d.ppm
, generating image names
of pix/0000.ppm
, pix/0001.ppm
, etc.
If FILESTEM contains no % sign, then .%03d.ppm.gz
is
appended to it, so snapset ./pix/fred
yields snapshot images named ./pix/fred.000.ppm.gz
etc.
Frame number FRAMENO (default 0) increments with each snapshot taken.
Capture a snapshot image of the current view.
Use snapset
to specify the output image name.
Default format is snap.%03d.tif
.
Partiview
generally invokes the ImageMagick program convert(1)
,
which must be installed and be on the user's $PATH. Convert
determines
the type of image (jpeg, sgi, bmp, etc.) based on the file suffix.
Convert
is not needed if the snapset
FILESTEM ends in
.ppm.gz
(invokes gzip rather than convert) or .ppm
(no external program required).
These commands affect how particles (in the current group) are displayed.
All particle luminosities (as specified by lum
command)
are scaled by the product of two factors:
a lumvar-specific factor given by slum
,
and a global factor given by psize
.
So the intrinsic brightness of a particle is
value-specified-by-lum
* slum-for-current-lumvar
* psize-scalefactor.
Data-field specific luminosity scale factor, for current choice of
lumvar as given by the lum
command.
A slumfactor is recorded independently for each data field, so
if data fields mass
and energy
were defined, one might say
lum mass
slum 1000
lum energy
slum 0.25
having chosen each variable's slumfactor for useful display,
and then freely switch between lum mass
and lum energy
without having to readjust particle brightness each time.
Specify how particles are colored.
Generally, a linear function of some data field of each particle
becomes an index into a colormap (see cmap
, cment
).
Use data field colorvar (either a name as set by datavar
or a 0-based integer column number) to determine color.
Map minval to color index 1, and maxval to
the next-to-last entry in the colormap (Ncmap-2).
The 0th and last (Ncmap-1) colormap entry are used for
out-of-range data values.
If minval and maxval are omitted, the actual range of values is used.
Don't consider field colorvar as a continuous variable; instead, it's integer-valued, and mapped one-to-one with color table slots. Data value N is mapped to color index N+baseval.
Once the exact
tag is set, it's sticky. To interpret
it as a continuous, scalable variable again, use -exact
.
Show all particles as color R G B, each value in range 0 to 1, independent of any data fields.
Specify how particles' intrinsic luminosity is computed: a linear function of some data field of each particle.
Map values of data field lumvar (datavar
name or
field number) to luminosity.
The (linear) mapping takes field value minval to
luminosity 0 and maxval to luminosity 1.0.
If minval and maxval are omitted, the actual range of values is mapped to the luminosity range 0 to 1.
Note that the resulting luminosities are then scaled by
the psize
and slum
scale factors, and further
scaled according to distance as specified by fade
, to compute
apparent brightness of points.
Specify constant particle luminosity L independent of any data field values.
Determines how distance affects particles' apparent brightness (or "size").
The default fade planar
gives 1/r^2 light falloff, with r measured
as distance from the view plane. fade spherical
is also 1/r^2,
but with r measured as true distance from the viewpoint.
fade linear
refdist gives 1/r light falloff -- not physically
accurate, but useful to get a limited sense of depth.
fade const
refdist gives constant apparent brightness
independent of distance, and may be appropriate for orthographic views.
The refdist for linear and const modes is that distance r at which apparent brightness should match that in the 1/r^2 modes -- a distance to a "typical" particle.
Turn display of points on or off. With no argument, toggles display.
Turn display of points on or off. With no argument, toggles display.
Turn display of textures on or off. With no argument, toggles.
Turn display of label text on or off. With no argument, toggles.
Scale size of all textures relative to their polygons.
A scale factor of 0.5 (default) make the texture square
just fill its polygon, if polysides
is 4.
Report setting of polyorivar
data-command, which see.
Report setting of texturevar
data-command, which see.
Toggle label axes. When on, and when labels are displayed, shows a
Number of sides a polygon should have
see also ptsize
makes more sense than fast
.
Get or set the alpha value.
For time-dependent data, advance datatime by this many time units per wall-clock second.
For time-varying data, sets current timestep number. Real-valued times are meaningful for some kinds of data including those from starlab; for others, times are rounded to nearest integer.
If preceded with a plus or minus sign, adds that amount to current time.
(note that fspeed
has been deprecated)
viewing control options for kira (starlab)
formatted data that have been read in with
the kira
Data Command.
Show or hide center-of-mass nodes for multiple stars.
With on
, show CM nodes for each level in a binary tree.
With root
, show only the top-level CM node for each multiple.
Show circles around multiple stars; on
and root
as above.
Show lines connecting pairs of stars at each binary-tree level
in a multiple group. With cross
, also show a perpendicular
line -- a tick mark -- which crosses at the CM point,
and whose length is tickscale
(default 0.5) times the
true separation of the pair.
With tick
, just show the tick-mark with no connecting line.
Determines 3-D size of circles when kira ring on
.
With kira size sep
, ring diameter is scalefactor * instanteous
separation. With kira size semi
, ring radius is scalefactor * a
(the semimajor axis of the two-body system, or |a|
for
unbound orbits). Using semi
gives typically more stable-looking
rings, though they will pop if they become marginally (un-)bound.
Default: kira size semi 1.5
.
Another way to set the scale factor for kira size
above.
Sets screen-space (pixel) size limits on rings.
They'll never get smaller than radius minpix nor larger than
maxpix, regardless of true 3-D size. Thus even vanishingly
tight binaries can always be visibly marked.
Default: kira span 2 50
.
As particle id moves through time, move the viewpoint in the
same way, so that (if you don't move the view by navigation)
the particle remains fixed in apparent position.
kira track off
disables tracking, and kira track on
re-enables it.
Use the p
key or mouse button 2 to pick a particle
(or CM node if kira node on
) to see its numeric id.
Transient center-of-mass nodes (shown if kira node on
)
can be tracked while they exist.
For asynchronously-loaded data (currently only ieee
data command),
say whether wait for current data step to be loaded.
(If not, then keep displaying previous data while loading new.)
Load (ascii) filename with RGB values, for coloring particles.
The color
command selects which data field is mapped to color index
and how.
Display only a 3D subregion of the data -- the part lying within the clipbox.
Specified by coordinate range.
Specified by center and "radius" of the box. Note no spaces after the commas!
off
Disable clipping. The entire dataset is again visible.
on
Re-enable a previously defined clipbox setting.
Display a subset of particles, chosen by the value of
some data field. Each thresh
command overrides
settings from previous commands, so it cannot be used to
show unions or intersections of multiple criteria.
For that, see the only
command. However, unlike only
,
the thresh
criterion applies to time-varying data.
Display only those particles where
minval <= field field <= maxval.
The field may be given by name (as from datavar
)
or by field number.
<
maxval
>
minval Show only particles where field is <= or >= the given threshold.
Disable or re-enable a previously specified threshold.
Erase all particles in this group. Useful for reloading on the fly.
Display a random subset (every N-th) of all particles.
E.g. every 1
shows all particles, every 2
shows about half of them.
Reports current subsampling factor, and the current total number of particles.
Generates a (numerical) histogram of values of datafield,
which may be a named field (as from datavar
) or a field index.
Divides the value range (either minval..maxval
or the actual range of values for that field) into nbuckets
equal buckets (11 by default). Uses logarithmically-spaced
intervals if -l
(so long as the data range doesn't include zero).
If a clipbox is defined, use -c
to count only
particles within it. If a thresh
or only
subset is defined, use -t
to count only the chosen subset.
Reports 3D extent of the data.
Report names and value ranges (over all particles in current group) of all named data fields.
Turn box display off or on; or display boxes but hide all particles.
Color boxes using that colormap.
Each box's level number (set by -l
option of box
data-command,
default 0) is the color index.
Get or set the given box-colormap index. E.g. boxcment 0
reports the color of boxes created with no -l
specified.
Label boxes by id number
(set by -n
option of box
data-command).
Toggle or set box axes display mode.
BEGIN CAVEMENU pos P1 P2 wall P1 hid [P1] show [P1] h [P1] demandfps [P1] font help ? END CAVEMENU
(see also partibrains.c::specks_read)
Lines starting with #
will be skipped. The following Data Commands
can be placed in a data file.
Control Commands can be given, if prefixed with the eval
command.
read a speck
formatted file. Recursive, commands can nest. (strtok ok??)
read a speck
formatted file.
read a IEEEIO formatted file, with optional timestep number (0 based). Support for this type of data must be explicitly compiled into the program.
read a kira
formatted file. See the kiractl
Control
Command to modify the looks of the objects.
Defines/Selects a particular group number (N=1,2,3....) to an ALIAS. In
command mode you can use gN=ALIAS
. Any data following this command
will now belong to this group.
Select an existing group. Following data will now belong to this group.
Choose which data fields to
extract from binary sdb files (any of: mMcrogtxyzSn
) for subsequent
sbd
commands.
Read an SDB (binary) formatted file, with optional timestep number (0 based).
Draw a box, using any of the following formats:
xmin ymin zmin xmax ymax zmax
xmin,xmax ymin,ymax zmin,zmax
xcen,ycen,zcen xrad,yrad,zrad
[-t time] [-n boxno] [-l level] xcen,ycen,zcen xrad,yrad,zrad
level
determines color.
Object-to-world transformation. Either
tx ty tz rx ry rz or 16 numbers for 4x4 matrix.
(something> must contain *
a e r)
execute a Control Command.
Synonymous for eval
Synonymous for eval
A colon-separated list of directories in which datafiles, color maps, etc.
will be searched for. If preceded with the +
symbol,
this list will be appended to the current filepath.
By default, when polygons are drawn, they're parallel to the screen plane --
simple markers for the points. It's sometimes useful to give each
polygon a fixed 3-D orientation (as for disk galaxies). To do this,
provide 6 consecutive data fields, representing two 3-D orthogonal unit
vectors which span the plane of the disk. Then use
polyorivar
indexno
giving the data field number of the first of the 6 fields.
The vectors define the X and Y directions on the disk, respectively --
relevant if texturing is enabled.
Actually, unit vectors aren't essential; making them different lengths yields non-circular polygonal disks.
If polyorivar
is specified but some polygons should still lie in the
screen plane, use values 9 9 9 9 9 9
.
To make polygons be textured:
texture
data-commands to provide a table
of textures, each named by a small integer texture-index;texturevar
fieldno to specify which
data field that is.If a particle's texture-index field's value doesn't correspond to anything
defined by a texture
command, then its polygon is drawn as if
texturing were disabled.
Give names to multiple datasets in IEEEIO files (read with ieee
command).
indexno is an integer, 0 being the first dataset.
Name the variable in data field indexno. The first data field is index 0.
If provided, minval maxval supply the nominal range of that data variable;
some control commands (lum
, color
) need to know the range of data
values, and will use this instead of measuring the actual range.
Label subsequent data with this time (a non-negative integer).
These lines, with XYZ positions in the first 3 columns, will make up the bulk of the dataset. The 4th and subsequent columns contain the values of the datavariables as named with the datavar commands. Note that data variables are 0-based.