This is ContourView.h in view mode; [Download] [Up]
/* ContourView.h -- header file for ContourView class
* Start 92-05-18 -- See ContourView.m for version and history information.
* Izumi Ohzawa
*/
#import <objc/objc.h> /* for BOOL values YES, NO */
#import <appkit/View.h>
#import <appkit/color.h>
#import <dpsclient/dpsfriends.h>
#import "contour.h"
@interface ContourView:View
{
NXImage *imageCache; // NXImage bitmap cache (NOT outlet)
int cacheOK; // non-zero if something has been written to imageCache
// storage for moused GUI elements in this view.
float pX_Vline; // X position of movable vertical line in points
float pY_Hline; // Y position of movable horizontal line in points
float lastx, lasty;
BOOL printCrossHair; // flag to indicate that crosshair should be printed/copied.
BOOL continuousNotify; // if yes, drag will continuously generate delegate messages
id delegate;
int tag;
// storage for scaling factors
float pXmin, pXmax; // X bounds of view in points
float pYmin, pYmax; // Y bounds of view in points
float ppxu; // pixels(points) per unit of X
float ppyu; // pixels(points) per unit of Y
float smallx, smally; // for deciding contour closure
float xdmin, xdmax; // min, max values of X data
float ydmin, ydmax; // min, max values of Y data
float fdmin, fdmax; // min, max values of Value
int nclevels; // # of contour levels
CntrAttribute *cA; // Array of Contour attribute structures
int numContours; /* number of contours in contourList */
ContourPath *contourList; /* contour path list */
ContourPath **SortedCntrPtr; /* sorted index: array of pointers to contourList */
// grid and value data storage
int ndata; // total number of data points = jdim*kdim
int nx; // expanded (nx1+N6) (possibly interpolated grid size)
int ny; // (ny1+N6)
int nx1; // non-expanded (but possibly interpolated grid size)
int ny1;
int nxraw; // non interpolated (raw grid size)
int nyraw;
float *xd; // x coordinate array for grid points
float *yd; // y coordinate array for gird points
float *fd; // value at grid point (x[i], y[i]), i=(0 .. ndata-1)
float *xt, *yt; /* temporary input arrays for interpolation */
float **f2;
float **fd2a; // used for 2-d interpolation of RF map.
int bipolar; // =1 if data are pos/neg, =0 if monopolar
float basevalue; // value to set to margin regions of expanded array for contour closure
char *comment, *comment012; // comment storage
// Flags
// int ClearFlag;
BOOL enabled;
BOOL invertY;
BOOL debug;
BOOL doFill;
BOOL doContourStroke;
BOOL frameON; // Draw bounds frame
BOOL axisON; // Draw axis
BOOL gridON; // Draw grid
BOOL ticksON; // Draw ticks
float frameLineWidth;
float axisLineWidth;
float gridLineWidth;
float tickLineWidth, tickLength;
float axisX, axisY; // where to draw axis
float gridXstep, gridYstep; // spacing of grid
int minNumPoints; // minimum mumber of points for a contour
float griddash[2]; // for allocated array of grid
// Attributes of contour lines and fills
NXColor positiveColor; // color of maximum positive (or max monopolar)
NXColor negativeColor; // color of extreme negative
NXColor backgroundColor; // color of background
NXColor contourLineColor; // color of contour lines
NXColor frameColor; // color of frame rectangle (when enabled)
NXColor axisColor;
NXColor gridColor;
NXColor tickColor;
float minorContourLineWidth; // linewidth of contour lines
float majorContourLineWidth; // major contour's line width
float *ncontdash; // for allocated array of negative contour dash
int Nncdash; // array size specifying neg contour dash
}
- initFrame:(NXRect *)nf;
- free;
- (BOOL)acceptsFirstMouse;
- (BOOL)acceptsFirstResponder;
// Mouse/Hit detection/dragging related methods.
- mouseDown:(NXEvent *)event;
- (int) isHit:(const NXPoint *) p;
- dragMarker:(int)mk :(NXEvent *)event;
- enablePrintCrossHair:(BOOL)yn;
- enableContinuousNotify:(BOOL)yn;
- fakeMakerMovedFor:(int)mk;
- setMarkerPositionFor:(int)mk to:(float)pos;
- setScaleXY;
- setEnabled:(BOOL)yn;
- setComment:(char *)cstr :(int)len;
- setBipolar:(BOOL)yn;
- findMinMax:(float *)x :(int)npts :(float *)vmin :(float *)vmax;
- setInvertY:(BOOL)invy;
- setDebugEnable:(BOOL)de;
- setFillEnable:(BOOL)fe;
- setContourStrokeEnable:(BOOL)fe;
- setNumberOfContourLevels:(int)nl;
- setMinMaxOfContourLevels:(float)min :(float)max;
- setContourAttributeArray:(CntrAttribute *)caa :(int)nl;
- setDefaultContourAttributes;
- setContourLineColor:(NXColor)clc;
- setFrameColor:(NXColor)fc;
- setTickColor:(NXColor)fc;
- setGridColor:(NXColor)fc;
- setAxisColor:(NXColor)fc;
- setBackgroundColor:(NXColor)bc;
- setFillColors:(NXColor)pe :(NXColor)ne;
- horizCrossSectionAtY:(float)fy :(int)np forXs:(float *)fx :(float *)fcurve;
- vertCrossSectionAtX:(float)fx :(int)np forYs:(float *)fy :(float *)fcurve;
- setCartesianGridData:(float *)f :(float)xmin :(float)xmax
:(float)ymin :(float)ymax
ofSize:(int)nnx :(int)nny
withInterpolationTo:(int)n1x :(int)n1y;
- xMinMax:(float *)xmin :(float *)xmax;
- yMinMax:(float *)ymin :(float *)ymax;
- zMinMax:(float *)zmin :(float *)zmax;
- setGridAndValueData:(float *)x :(float *)y :(float *)f ofSize:(int)nnx :(int)nny;
- setFrameEnable:(BOOL)fflag lineWidth:(float)fw;
- setAxisEnable:(BOOL)fflag;
- setGridEnable:(BOOL)fflag;
- setTicksEnable:(BOOL)fflag;
- setAxisLineWidth:(float)alw position:(float)x :(float)y;
- setGridLineWidth:(float)glw spacing:(float)xs :(float)ys;
- setNumXgrid:(int)numXgrid;
- setTickLineWidth:(float)tlw length:(float)tll;
- setContourLineWidthMinor:(float)clw andMajor:(float)clwm;
- setGridDash:(float)lmark: (float)lspace;
- setContourDash:(float *)darray :(int)nd;
- setMinNumberOfPointsPerContour:(int)mnp;
- clear:sender;
- copy:sender;
- copyPScode:sender;
- beginTailorGroupWithComments;
- endTailorGroup;
- endHeaderComments;
- endPrologue;
// Drawing
- drawMarkers;
- updateImageCache;
- drawAll;
- drawSelf:(const NXRect *)r:(int)count;
- (int)saveEPStoFile:(const char *)fileName;
- plotContour:(ContourPath *)cntr :(DPSContext)cContext;
- findInsideHighLow:(ContourPath *)cntr;
- (BOOL)pointInDomain:(float)xx :(float)yy;
- freeContourList;
// Call back method messaged from computeContour() function.
- accumContour:(int)icont :(int)np :(float *)xc :(float *)yc;
- setDelegate:anObject;
- delegate;
- setTag:(int)t;
- (int) tag;
@end
// For delegate messages
@interface ContourViewDelegate: Object
{
}
// Sent when a contraint is moved.
- markerDidMove:(int)viewtag :(int)marker :(float)x :(float)y :(int)mup;
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.