home *** CD-ROM | disk | FTP | other *** search
- /* Plot3dView.h Copyright 1992 Steve Ludtke */
- #import <appkit/View.h>
-
- #define SS .01 /* symbol size. 1.0 would cause the symbols to be */
- /* as large as the view */
- #define MAXSETS 5 /* maximum number of sets, changing this number */
- /* requires IB changes as well */
- #define NFN 5 /* currently this is redundant. Number of active */
- /* data sets */
- #define TIMESTEP .1 /* Time in sec between updates */
-
- /* 3d point structure */
- typedef struct {
- float x,y,z;
- } Point;
-
- /* data set preferences structure (incudes pointer to actual data) */
- typedef struct {
- char sym; /* -1 means don't plot, else 0<=sym<=6 */
- NXColor color; /* color of this set */
- Point *fileData; /* data from a file, NULL if equation mode */
- Point *data; /* data to be displayed. In file mode it */
- /* contains the visible subset of the data */
- int nfdata; /* # points in file data */
- int ndata; /* # points in data */
- id expr; /* points to the Expression (formula eval.) */
- } SetPref;
-
- /* timer for spinning, etc ... */
- DPSTimedEntry timer;
- void itstime(DPSTimedEntry entry,double now,id call);
-
- @interface Plot3DView:View
- {
- id grids; /* number of points in x and y */
- id mode; /* mouse mode selector */
- id controller; /* points to PControl */
- float chi,theta,dchi; /* viewing angles/speeds */
- float minX,maxX; /* current min/max values */
- float minY,maxY;
- float minZ,maxZ;
- char pscom[1000]; /* postscript buffer for DPSUserPath */
- float pspath[3000]; /* increases drawing speed substantially */
- float psbbox[4];
- char zMode; /* current value of mouse mode */
- int psc; /* counter for user path */
- char initflag; /* flag so timer knows the first time it's called */
- int Tgrids; /* last verified value of grids */
- SetPref pref[MAXSETS]; /* preferences for data sets */
- }
-
-
- -initFrame:(NXRect *)myrect;
- -free;
-
- /* rescales coord. system after size chaged */
- -superviewSizeChanged:(const NXSize *)oldsize;
-
- /* draw 3d plot */
- -drawSelf:(NXRect *)myrect :(int)rectCount;
-
- /* change viewing angle */
- -setAng:(float)chi :(float)theta;
-
- /* used to do mouse zooming and spinning */
- -mouseDown:(NXEvent *)event;
-
- /* points to controller object, usually set with IB instead */
- -setcontroller:del;
-
- /* called by timer to do one time step */
- -step;
-
- /* change mouse mode */
- -setMode:sender;
-
- -(int)acceptsFirstMouse;
-
- /* recalculate and display plot (and density plot, via controller) */
- -zoom:sender;
-
- /* change min/max values */
- -zoomTo:(float)minx :(float)miny :(float)maxx :(float)maxy;
-
- /* toggles dchi=0 on and off */
- -togFreeze:sender;
- @end
-