home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Plotting / NXplot3d.3.2 / Source / DensView.h < prev    next >
Encoding:
Text File  |  1994-09-16  |  1.8 KB  |  58 lines

  1. /* DensView.h  Copyright 1992 Steve Ludtke */
  2. /* This object does a density plot of a 3d data set */
  3.  
  4. /* Connect "delegate" to an object that can recieve "zoomTo:xmin :ymin :xmax */
  5. /* :ymax   messages (or leave it disconnected). Send setData::::: messages   */
  6. /* to pass data and render image. Send display messages to redisplay rendered*/
  7. /* image. */
  8.  
  9. #import <appkit/View.h>
  10.  
  11. #define DM_DENSITY    1
  12. #define DM_CONTOUR    2
  13. #define DM_MESH        4
  14. #define DM_DMESH    8
  15. #define DM_LABEL    16
  16.  
  17. typedef struct { char *data; int n,al; } String;
  18.  
  19. @interface DensView:View
  20. {
  21. id delegate;    /* who to send -zoomTo messages to */
  22. id image;    /* image used to store the density plot */
  23. id tiffRes;        /* resolution for tiff saves */
  24. NXPoint point;    /* origin of image in view */
  25. NXSize size;    /* size of image */
  26. NXRect ticks;    /* Tick origin/spacing */
  27. float *data;    /* points to array of Z values to plot */
  28. RtColor *color;
  29. String buf;        /* postscript command buffer */
  30. int nx,ny;    /* number of data points = nx*ny */
  31. float Zlim[4]; /* used to determine max and min brightness */
  32. NXRect rec,rec2;    /* rec=limits of data, rec2=limits of "real" data */
  33. char mode,dmode;
  34. float lev0,lev1;    /* contour start and spacing */
  35. }
  36.  
  37. /* initialization */
  38. -initFrame:(NXRect *)myrect;
  39. /* composites the image to the screen */
  40. -drawSelf:(NXRect *)rects :(int)rectCount;
  41. /* resize the view */
  42. -superviewSizeChanged:(const NXSize *)oldsize;
  43. /* allows user to select zoom area */
  44. -mouseDown:(NXEvent *)oevent;
  45. -(int)acceptsFirstMouse;
  46.  
  47. /* This routine passes the actual data to be plotted to the DensView */
  48. /* It also does all of the actual drawing (into an Image) */
  49. -setData:(int)Nx :(int)Ny :(float *)Data :(float *)Zlim :(NXRect)Ticks :(NXRect)rec :(NXRect)rec2 :(float)Lev0 :(float)Lev1 :(RtColor *)color;
  50.  
  51. -setDenFlag:sender;
  52.  
  53. -saveTiff:sender;
  54. -savePS:sender;
  55. -printPSCode:sender;
  56. @end
  57.  
  58.