Skip to content
Snippets Groups Projects
partibrains.c 201 KiB
Newer Older
slevy's avatar
 
slevy committed
static char local_id[] = "$Id$";
slevy's avatar
slevy committed
static char copyright[] = "Copyright (c) 2002 NCSA, University of Illinois Urbana-Champaign";

/*
 * Brains of partiview: carrying and displaying data, parsing commands.
 * Stuart Levy, slevy@ncsa.uiuc.edu
 * National Center for Supercomputing Applications,
 * University of Illinois 2001.
slevy's avatar
slevy committed
 * This file is part of partiview, released under the
 * Illinois Open Source License; see the file LICENSE.partiview for details.
slevy's avatar
 
slevy committed
/*
 * $Log$
 * Revision 1.112  2005/02/08 20:10:59  slevy
 * Force using oldopengl (no glInterleavedArrays()/glDrawElements()) on MacOS X --
 * it seems to get the data completely wrong (most X's = 0, etc.).
 * If someone ever figures out why, I'd be curious to know.
 *
 * Revision 1.111  2004/10/19 01:52:27  slevy
 * Give specks_ieee_server() the right type to be an sproc function.
 * Need config.h early.
 * Initialize "oldopengl".
 * More digits for "where".
 *
slevy's avatar
slevy committed
 * Revision 1.110  2004/10/06 05:35:19  slevy
 * Add 3-D texturing.
 *
 * Revision 1.109  2004/07/26 16:44:50  slevy
 * specks_set_byvariable() now correctly fails on 0-length names.
 *
 * Revision 1.108  2004/07/26 04:33:01  slevy
 * Use vertex arrays for drawing points, if available.
 * Allow dyndata processors to switch themselves off with st->dyn.enabled = -1.
 *
 * Revision 1.107  2004/07/23 20:57:12  slevy
 * Move alloca boilerplate (ugh) earlier.
 * Use HAVE_SQRTF.
 *
 * Revision 1.106  2004/07/06 23:06:22  slevy
 * Make use of multiple timesteps even if we have a dyndata handler.
 *
 * Revision 1.105  2004/04/19 21:04:12  slevy
 * Un-CONST-ify most of what had been constified.  It's just too messy.
 *
 * Revision 1.104  2004/04/19 17:42:42  slevy
 * Use AC_FUNC_ALLOCA and the autoconf-standard alloca boilerplate
 * in each of the files that uses alloca.
 *
 * Revision 1.103  2004/04/12 19:09:54  slevy
 * Crank up default specular highlights.
 * CONSTify getfloats().
 *
 * Revision 1.102  2004/01/14 02:03:41  slevy
 * Add Chromatek color-coding of depth, contributed by Carl Hultquist
 * (chultquist@smuts.uct.ac.za, student of Anthony Fairall), as part of his
 * Computer Science Honours project.  Works with Chromatek glasses,
 * which make red things look nearby, blue things far away.
 * New commands:
 *    chromadepth {on|off}
 * 	replaces colors of points and polygons with depth-coded colors
 *    chromaparams ZSTART ZRANGE
 * 	sets Z-range (distance from camera plane) over which
 * 	colormapping applies.  Z=ZSTART maps to first entry,
 * 	Z=ZSTART+ZRANGE maps to last entry in colormap.
 *    chromacmap  FILE.CMAP
 * 	Specifies colormap.
 * See example files data/chromadepth.cmap and data/hipchroma.
 *
 * Revision 1.101  2004/01/09 13:32:06  slevy
 * Parse lum command correctly again...
 *
slevy's avatar
slevy committed
 * Revision 1.100  2004/01/09 04:54:46  slevy
 * Add lum options:
 *    "all"  - revert to autoranging
 *    "abs [base]"  - lum = scalefactor * abs(value - base)
 *    "lin"  - default behavior (unsets any "abs")
 *
 * Revision 1.99  2003/12/10 19:38:05  slevy
 * Add "pb" datacommand to read partadv-style .pb files.  Finally, a general-purpose
 * binary particle format!
 *
 * Revision 1.98  2003/11/03 17:06:55  smarx
 * small additions/changes to make os x and windows buildable and functional. open issues on windows time motion widgets and terminating cleanly.
 *
 * Revision 1.97  2003/10/26 16:20:22  slevy
 * Merge Steve Marx's many improvements -- generic slider,
 * MacOS X port, "home" command/button, lots of bug fixes -- into main branch!
 *
slevy's avatar
slevy committed
 * Revision 1.96  2003/10/25 00:42:52  slevy
 * Add "echo" data+control command.
 * Try to add pthread-based USE_IEEEIO.  Don't know if this works yet,
 * but it compiles.
 *
 * Revision 1.95  2003/09/30 08:44:37  slevy
 * Make waveobj accept objects made of line segments.
 * Revision 1.94.2.1  2003/05/15 14:58:57  smarx
 * rel_0_7_04 upgrades to fltk-1.1.3, build support for os x, os x middle mouse button keyboard simulation, os x workaround for partiview/fltk issues with proper redraw. this release is using a recent fltk-1.1.3 cvs upgrade - not the standard release - to resolve OpenGL bugs that will be in fltk-1.1.4. Note that this release of partiview requires fltk-1.1.x support which precludes use of the old file chooser
 * Revision 1.94  2003/02/15 06:55:57  slevy
 * Add "slvalid" flag to struct dyndata.  Don't just use currealtime as
 * the validity test.
 *
 * Revision 1.93  2002/10/04 00:50:21  slevy
 * Fix CAVE-text-alignment hack for non-CAVE case.
 *
 * Revision 1.92  2002/10/02 07:00:04  slevy
 * Change text orientation in THIEBAUX_VIRDIR (often multipipe CAVE)
 * mode.  Rather than having text be oriented per-graphics-window,
 * we choose the orientation of the master pipe.
 *
 * Revision 1.91  2002/07/20 15:53:03  slevy
 * Make wavefront .obj models work with (or without) texture coordinates
 * and/or vertex normals.
 *
 * Revision 1.90  2002/07/20 05:03:39  slevy
 * Support textures and per-vertex normals from "waveobj" files.
 *
 * Revision 1.89  2002/07/10 22:51:59  slevy
 * Allow ``only= field > value'' etc.
 *
 * Revision 1.88  2002/06/18 21:43:52  slevy
 * Report copyright when "version" requested.
 *
slevy's avatar
slevy committed
 * Revision 1.87  2002/06/18 21:24:36  slevy
 * Add copyright string.
 * Add Illinois-open-source-license reference to LICENSE.partiview file.
 *
 * Revision 1.86  2002/06/05 01:13:31  slevy
 * Ha -- when reading tfm's, remember to initialize has_scl!
 *
 * Revision 1.85  2002/06/04 23:06:07  slevy
 * Use parti_idof(), not parti_object( NULL, &st, 0 ), to turn object into id.
 *
 * Revision 1.84  2002/04/22 17:58:49  slevy
 * Allow "w" option to "bound" command: compute bounding box in world
 * instead of object coordinates.
 *
 * Revision 1.83  2002/04/17 20:47:58  slevy
 * Add a not-quite-proprietary notice to all source files.
 * Once we pick a license this might change, but
 * in the mean time, at least the NCSA UIUC origin is noted.
 *
 * Revision 1.82  2002/04/16 18:40:26  slevy
 * Move tokenize() and rejoinargs() into findfile.c,
 * and out of this overstuffed piece of junk.
 *
 * Revision 1.81  2002/04/12 05:50:20  slevy
 * Fix (?) "only=" etc. commands, broken since I added the selection stuff last July!
 *
 * Revision 1.80  2002/03/31 22:40:32  slevy
 * "tfm" command -- only print full matrices if "tfm -v" given,
 * otherwise just x y z rx ry rz scale; print matrices in %g format for
 * full precision; accept 7th parameter as scale factor on input
 * just as we print it on output.
 *
slevy's avatar
slevy committed
 * Revision 1.79  2002/03/14 18:14:58  slevy
 * Peel out a bit more CAVE code,
 * and refer specifically to Marcus Thiebaux's virdir
 * since there's now also a Matt Hall version.
 *
 * Revision 1.78  2002/03/14 04:54:09  slevy
 * Strip out a bunch of virdir-specific CAVE menu clutter,
 * now moved into partimenu.c.
 *
 * Revision 1.77  2002/03/11 22:31:23  slevy
 * Move virdir-specific parti_seto2w() and specks_display() to partiview.cc.
 * "rawdata -a" particle-dump includes position, color, brightness too.
 *
 * Revision 1.76  2002/02/02 04:13:07  slevy
 * Unless PARTIMENU explicitly set, just get rid of the blasted menus.
 *
 * Revision 1.75  2002/01/27 00:38:19  slevy
 * Add "setenv name value" data command.
 *
 * Revision 1.74  2002/01/23 03:56:34  slevy
 * Add "timealign", "skipblanktimes" commands.
 * Default change: no longer skip blank times!
 * Per-data time ranges now extend overall clock range,
 * don't replace it.
 * Reset material properties (shininess, specular, ambient)
 * when drawing a lighted mesh.
 *
 * Revision 1.73  2001/12/28 07:23:57  slevy
 * Move plugins (kira, warp, ieeeio) off to separate source files.
 * "where" command gives full-precision values, and reports jump-pos with scale.
 * Allow for model-specific render function (initially for Maya models).
 * env TXDEBUG.
 *
 * Revision 1.72  2001/11/09 05:27:53  slevy
 * In specks_set_timestep(), don't set clock's range if we only have
 * a single timestep ourselves!
 *
slevy's avatar
slevy committed
 * Revision 1.71  2001/11/08 06:32:52  slevy
 * Extract async code into async.c.
 * Add pointsize metering, normally #ifdef USE_PTRACK'ed out.
 *
 * Revision 1.70  2001/11/06 06:20:30  slevy
 * Centralize test for nonempty timestep slot: specks_nonempty_timestep().
 * Fix tokenize() for case of "quoted" or 'quoted' arg strings.
Loading
Loading full blame...