Newer
Older
* Revision 1.27 2001/03/04 16:47:35 slevy
* Make "add" and "eval" behave consistently.
* polyorivar and texturevar now accept field names as well as numbers.
*
* Revision 1.25 2001/02/19 22:01:16 slevy
* Satisfy windows C compiler: pull enum FadeModel outside struct speck, etc.
*
* Revision 1.24 2001/02/19 20:50:33 slevy
* Oops, "object" should always invoke parti_object() whether there's an
* alias or not!
*
* Revision 1.23 2001/02/17 22:02:54 slevy
* Enlarge polygons so that unit circle is inscribed, not circumscribed.
* Then "txscale .5" always shows entire texture regardless of polysides.
* Add new "ptsize" command -- makes more sense than "fast". "fast" still works.
*
* Revision 1.22 2001/02/17 17:44:05 slevy
* For polygons, rotate circle of vertices by 1/2 step.
* Then, for "polysides 4" and "txscale .707",
* the vertices coincide with the corners of the 0..1 texture.
*
* Revision 1.21 2001/02/17 05:39:45 slevy
* Allow (in data language) "object gN=NAME".
*
* Revision 1.20 2001/02/15 05:41:12 slevy
* new textcmap, textcment commands. Regularize color-gamma-mapping.
* Object aliases: "object gN=ALIAS", or in command mode, "gN=ALIAS".
* Accept "ellipsoid" data tag; not yet implemented.
*
* Revision 1.19 2001/02/05 00:41:52 slevy
* Accept "time" as synonym for "step".
* Add "pickrange".
* Mention jump, center in help msg.
* Revision 1.17 2001/02/03 16:49:42 slevy
* Update cookedcmap when "cment" changes cmap.
*
* Revision 1.15 2001/02/03 14:50:44 slevy
* Add "setgamma" (abbr. "setgam" or "cgam") command to adjust colors.
* Add "kira tree {off|on|cross|tick} [tickscale]" subcommand
* for showing tree structure of interacting groups.
*
* Revision 1.14 2001/01/31 17:11:54 slevy
* Ensure that, for starlab, clock is always in "continuous" mode.
*
* Revision 1.13 2001/01/31 17:07:12 slevy
* Add RCS Id and Log strings.
*
*/
#define __USE_MISC /* makes <math.h> define sqrtf() on GNU libc */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#if !sgi && !defined(sqrtf)
# define sqrtf(x) sqrt(x) /* if no sqrtf() */
#endif
#undef isspace /* hack for irix 6.5 back-compat */
#undef isdigit
#undef isalnum
#if unix
# include <unistd.h>
# include <sys/types.h>
# include <netinet/in.h> /* for htonl */
# ifndef WORDS_BIGENDIAN
# include "config.h" /* for WORDS_BIGENDIAN */
# endif
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#define RGBALPHA(rgb, alpha) ((rgb) | (alpha))
#define RGBWHITE 0xFFFFFF00
#define PACKRGBA(r,g,b,a) ((r)<<24 | (g)<<16 | (b)<<8 | (a))
#define THRESHBIT PACKRGBA(0,0,0,1)
#else
#define RGBALPHA(rgb, alpha) ((rgb) | ((alpha)<<24))
#define RGBWHITE 0x00FFFFFF
#define PACKRGBA(r,g,b,a) ((a)<<24 | (b)<<16 | (g)<<8 | (r))
#define THRESHBIT PACKRGBA(0,0,0,1)
#endif
#if CAVE
# define CAVEMENU 1
#endif
#include "geometry.h"
#include <GL/gl.h>
#if CAVEMENU
#include <cave_ogl.h>
#include "cavemenu.h"
#include "vd_util.h"
#define IFMENU(x) (x)
#else
#define IFMENU(x)
#endif
#include "shmem.h" /* NewN(), etc. */
#include "futil.h"
#include "specks.h"
#include "textures.h"
#include "findfile.h"
#include "partiviewc.h"
#include "sfont.h"
#include <sys/types.h>
#include <signal.h>
#ifdef sgi
#include <malloc.h> /* for mallinfo(), amallinfo() */
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#endif
/* Star Renderer (.sdb) structure -- from stardef.h */
typedef enum {ST_POINT, ST_BRIGHT_CLOUD ,ST_DARK_CLOUD, ST_BOTH_CLOUD, OFF} stype;
typedef struct {
float x, y, z;
float dx, dy, dz;
float magnitude, radius;
float opacity;
int num;
unsigned short color;
unsigned char group;
unsigned char type;
} db_star;
typedef struct hrec { float t; int num;} hrec_t;
typedef struct mrec { float mass, x, y, z, vx, vy, vz, rho, temp, sfr, gasmass;
int id, token;} mrec_t;
/* end Star Renderer */
#define VDOT( v1, v2 ) ( (v1)->x[0]*(v2)->x[0] + (v1)->x[1]*(v2)->x[1] + (v1)->x[2]*(v2)->x[2] )
#if CAVEMENU
int parti_menuwall, parti_menubox[4];
static MenuHead *pmenu = NULL;
static MenuHead *stubmenu = NULL;
struct ments {
MenuEnt *alpha, *point, *poly, *label, *psize, *polysize, *fog;
MenuEnt *step, *fwd, *lumvar, *slum, *colorvar, *where[4];
MenuEnt *viewall, *setscale, *speed, *fspeed, *every;
MenuEnt *seedata, *box, *boxlevel[12];
MenuEnt *annot;
MenuEnt *tknob[3];
MenuEnt *menu;
} ment;
struct boxleveler {
struct stuff *st;
int level;
};
void set_tknob( float val, MenuEnt *me, void *st );
void set_psize( float psize, MenuEnt *me, void *st );
void set_polysize( float psize, MenuEnt *me, void *st );
void set_alpha( float alpha, MenuEnt *me, void *st );
void set_point( int on, MenuEnt *me, void *st );
void set_poly( int on, MenuEnt *me, void *st );
void set_label( int on, MenuEnt *me, void *st );
void set_step( float time0, MenuEnt *me, void *st );
void set_fwd( int fwd, MenuEnt *me, void *st );
void set_slum( float slum, MenuEnt *me, void *st );
void set_lumvar( int which, MenuEnt *me, void *st );
void set_colorvar( int which, MenuEnt *me, void *st );
void set_seedata( int which, MenuEnt *me, void *st );
Loading
Loading full blame...