home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / Car / DataView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-17  |  2.5 KB  |  112 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import <appkit/View.h>
  5. #import <objc/objc.h>
  6. #import <objc/Storage.h>
  7.  
  8. struct plotData
  9.     {
  10.     float x;
  11.     float y;
  12.     float logx;
  13.     float logy;
  14.     };
  15.  
  16. #define PLOTDATA_DESCRIPTION "{ffff}"
  17.  
  18. #define DATA_ONLY 0
  19. #define CURVE_ONLY 1
  20. #define DATA_AND_CURVE 2
  21.  
  22. @interface DataView:View
  23. {
  24.   Storage *data;    //THE PLOT DATA
  25.   Storage *curve;       //A CURVE TO PLOT
  26.   int plotMode;
  27.   BOOL zeroLines;
  28.   id cache;
  29.   BOOL cacheUpToDate;
  30.   id topScale;        //THE VIEW SUBCLASS THAT CONTAINS THE TOP SCALE
  31.   id bottomScale;    //THE VIEW SUBCLASS THAT CONTAINS THE BOTTOM SCALE
  32.   id leftScale;        //THE VIEW SUBCLASS THAT CONTAINS THE LEFT SCALE
  33.   id rightScale;    //THE VIEW SUBCLASS THAT CONTAINS THE RIGHT SCALE
  34.   BOOL loggedx;        //YES IF X-AXIS IS LOGGED
  35.   BOOL loggedy;        //YES IF Y-AXIS IS LOGGED
  36.   BOOL logxCalculated;    //YES IF THE LOGGED X VALUES HAVE BEEN CALCULATED
  37.   BOOL logyCalculated;    //YES IF THE LOGGED Y VALUES HAVE BEEN CALCULATED
  38.   BOOL lockedx;        //YES IF THIS PLOT IS LOCKED TO ANOTHER SET OF DATA WITH THE SAME X
  39.   id masterx;        //THE DATAVIEW INSTANCE WITH THE MASTER SET OF X DATA
  40.   BOOL isMasterx;    //YES IF THIS DATAVIEW IS THE MASTER
  41.   id children;        //A LIST CONTAINING THE CHILDREN OF THIS MASTER, IF THIS IS ONE
  42.   float xmax;
  43.   float xmin;
  44.   float ymax;
  45.   float ymin;
  46.   float xmaxLog;
  47.   float xminLog;
  48.   float ymaxLog;
  49.   float yminLog;
  50.   float xscale;
  51.   float yscale;
  52.   BOOL scaleOnTop;
  53.   BOOL scaleOnBottom;
  54.   BOOL scaleOnLeft;
  55.   BOOL scaleOnRight;
  56.   float lineTypeArray[10];
  57.   float lineTypeOffset;
  58.   float linewidth;
  59.  
  60.   // These are just temporary.
  61.   id xmintext;
  62.   id xmaxtext;
  63.   id ymintext;
  64.   id ymaxtext;
  65. }
  66.  
  67. // Override methods:
  68. - initFrame:(const NXRect *)frameRect;
  69. - drawSelf:(NXRect *)rects :(int)rectCount;
  70. - free;
  71. - setFrame:(NXRect *)frameRect;
  72. - moveTo:(NXCoord)x :(NXCoord)y;
  73. - sizeTo:(NXCoord)width :(NXCoord)height;
  74.  
  75. // This Class' methods:
  76. - addData:(struct plotData *)datum;
  77. - drawInCache;
  78. - setPlotMode:(int)mode;
  79. - setZeroLines:(BOOL)mode;
  80. - (float)xscale;
  81. - (float)yscale;
  82. - (float)xmin;
  83. - setxmin:(float)aNumber;
  84. - (float)xmax;
  85. - setxmax:(float)aNumber;
  86. - (float)ymin;
  87. - setymin:(float)aNumber;
  88. - (float)ymax;
  89. - setymax:(float)aNumber;
  90.  
  91. - data;
  92. - setData:anObject;
  93. - setCurve:anObject;
  94. - setCurveFromArray:(float *)coefficients count:(int)anInt;
  95. - rescaleForCurveWithRange:(float)newxmin :(float)newxmax checkInterval:(float)interval;
  96. - (float)integral;
  97. - (float)integrateWithLimits:(float)start :(float)end;
  98.  
  99. // This is temporary
  100. - drawLimits;
  101. @end
  102.  
  103. float evaluatePolynomial(float *coefficients,int number,float x);
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.