This is CurveView.h in view mode; [Download] [Up]
/* CurveView.h -- header file for CurveView class
* See CurveView.m for details.
* Izumi Ohzawa
*/
#import <appkit/appkit.h>
@interface CurveView:View
{
id bgImage; // NXImage bitmap cache for data points, coords, grid (NOT outlet)
int ncurves; // number of curves to store
int npoints; // number of points in curve
int ncin; // number of traces occupied -- will be ncurves in no time
int icurve; // index to the curve arrary for next entry
float pXmin, pXmax; // X bounds of view in points
float pYmin, pYmax; // Y bounds of view in points
float Xmin; // Real X minimum
float Ymin; // Real Y minimum
float RY2PY; // factor to convert Real Y -> Points Y
float RX2PX; // factor to convert Real X -> Points X
int Xscaled; // flag to indicate if X values are given
int ClearFlag;
int CacheOK; // non-zero if stuff is allocated
BOOL frameON; // frame drawing flag
id delegate;
int tag;
NXPoint p, pstart; // for drag-selection rectangle in points (View's unit)
// curve data storage
float **coords; /* coords[icurve][point] -- 2-d coords array for DPSDoUserPath() */
char *ops; /* operator array for DPSDoUserPath() */
float bbox[4]; /* also for DPSDoUserPath() */
// data point storage
float *xdata;
float *ydata;
BOOL *selected;
int ndata;
// Color/gray related stuff
NXColor *curveColor; /* color of each trace -- used if UseColor */
NXColor tempColor; /* temporary storage of color value for curves */
NXColor bgColor; /* color of background -- used if UseColor */
NXColor markerColor; /* color of data markers -- used if UseColor */
float markerSize; /* radius of marker in points */
char *comment, *comment012; // comment storage
}
// Mouse/Hit detection/dragging related methods.
- mouseDown:(NXEvent *)event;
- (int)dragMarker:(NXEvent *)event;
- (BOOL)acceptsFirstMouse;
- (BOOL)acceptsFirstResponder;
// Comments related methods
- setComment:(char *)cstr :(int)len;
- beginTailorGroupWithComments;
- endTailorGroup;
- endHeaderComments;
- endPrologue;
// Init/Alloc methods
- initFrame:(NXRect *)nf;
- free;
- allocTraceCache:(int)ncrvs :(int)npts;
- freeTraceCache;
- (float)RXtoPX:(float)rx;
- (float)RYtoPY:(float)ry;
- setFrameEnabled:(BOOL)yn;
- setCurveColor:(NXColor)color;
- setMarkerColor:(NXColor)color;
- setBgColor:(NXColor)color;
- setMarkerSize:(float)size;
- setXvalues: (float *)xa;
- setNewTrace: (float *)ya;
- setNewTraceXY:(float *)xa :(float *)ya;
- setDataPoints:(float *)xd :(float *)yd :(int)nnd;
- cacheDataPointsAndBackGround;
- drawDataPointsAndBackGround;
- clear:sender;
- drawIt:sender;
- autoScale;
- setScaleY:(float)ymin :(float)ymax;
- setScaleX:(float)xmin :(float)xmin;
- setXscalingEnable:(int)xse;
- copy:sender;
- copyPScode:sender;
- setDelegate:anObject;
- delegate;
- setTag:(int)t;
- (int) tag;
@end
// For delegate messages
@interface CurveViewDelegate: Object
{
}
// Sent when selection rectangle is specified.
- selectionRectDidMove:(int)viewtag :(float)xll :(float)yll :(float)xur :(float)yur :(int)drag;
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.