home *** CD-ROM | disk | FTP | other *** search
-
- /* Generated by Interface Builder */
-
- #include <math.h>
- #include <stdio.h>
- #include <sys/file.h>
-
- #import <dpsclient/wraps.h>
-
- #import <streams/streams.h>
-
- #import <appkit/Matrix.h>
- #import <appkit/Form.h>
- #import <appkit/Button.h>
- #import <appkit/NXColorWell.h>
- #import <appkit/TextField.h>
- #import <appkit/Slider.h>
- #import <appkit/color.h>
- #import <appkit/nextstd.h>
- #import <appkit/Pasteboard.h>
- #import <appkit/SavePanel.h>
- #import <appkit/Panel.h>
- #import <appkit/NXBitmapImageRep.h>
-
- #include "headers.h" /* for Voronoi */
-
- typedef enum { OP_PRIM_MST,OP_KRUSKAL_MST,OP_JARVIS_HULL, OP_GRAHAM_HULL,
- OP_VORONOI_DIAGRAM,OP_DELAUNAY_TRIANGULATION, OP_GABRIEL_GRAPH,
- OP_RELATIVE_NEIGHBORHOOD_GRAPH,
- OP_TSP_STUPID_NEIGHBOR,
- OP_TSP_CHEAPEST_INSERTION,
- OP_TSP_NEAREST_NEIGHBOR,
- OP_TSP_NEAREST_ADDITION,
- OP_TSP_FARTHEST_INSERTION} op;
-
- typedef enum { DISP_PTS_ONLY, DISP_PTS_RESULTS } displayFlagType;
- /* handy macros */
- #define X(i) data[(i)*2]
- #define Y(i) data[(i)*2+1]
-
- /* when we want to refer to a 2D point by `name' (in cost function calls) */
- #define XY(i) &data[(i)*2]
-
- /* extern */
- extern long random();
- extern void srandom(int);
-
- @interface TwoDView: View
- {
- float *data; /* data[i*2+j], j=0,1, i=1..numPoints (dynamic) */
- int numPoints;
- op operation;
- BOOL instanceMode;
- int autoUpdate;
- float width;
-
- id numPointsForm;
- id bgColorWell;
- id fgColorWell;
- id lineWidthText;
- id lineWidthSlider;
- id optimalValueFormCell;
- id timeSlider;
- id timeField;
- id optimizeButton; /* to run the Optimization routines */
-
- /* storange must be allocated for some output data structures.
- Specifically, we need to allocate an array of indices for the
- MST edges ((numPoints-1)*2 integers), an array of (numPoints)
- integers for the convex hull edges (worst case).
-
- We don't need any visible storage for the voronoi/Delaunay data
- structure because the libvoronoi routines allocate memory for that
- stuff internally. */
-
- BOOL mstExists;
- int *mst_edge;
- BOOL chExists;
- int *ch_vertex;
- int nch_vertices;
- BOOL vorExists; /* voronoi OK => Delaunay OK */
- BOOL dtExists;
- int *dt_edge;
- int ndt_edge;
- BOOL ggExists;
- int *gg_edge;
- int ngg_edge;
- BOOL rngExists;
- int *rng_edge;
- int nrng_edge;
- /* TSP data WGR */
- int *tsp_edges;
- @public
- id statusText;
- long drawTime; // time in Usec to wait between drawings
- id highColorWell;
- displayFlagType displayFlag;
- id optimalValueField; // value of optimal Path.
- }
-
- + newFrame:(NXRect *)frameRect;
-
- - setFgColorWell:sender;
- - setBgColorWell:sender;
- - setHighColorWell:sender;
- - setAutoUpdate:sender;
- - setOperation:sender;
- - timeValue: sender; // in tsp category.
- - appDidInit: sender; // do some initialization.
- - doOptimize: sender; // do the optimize routines.
- - random:sender;
- - animThenDisp:sender;
- - disp:sender;
- - (BOOL)acceptsFirstResponder;
- - mouseDown:(NXEvent *)theEvent;
- - free;
- - doPrimMST;
- - doKruskalMST;
- - doJarvisHull;
- - doGrahamHull;
- - erase;
- - drawEdge:(float)x1:(float)y1:(float)x2:(float)y2;
- - drawDT;
- - drawGG;
- - drawRNG;
- - drawSelf:(NXRect *)rects:(int) rectCount;
- - doVoronoiDiagram;
- - doDelaunayTriangulation;
- - doGabrielGraph;
- - doRelativeNeighborhoodGraph;
-
- -saveTIFF:sender;
- -saveEPS:sender;
-
- -openData:sender;
- -saveData:sender;
- -close:sender;
-
- -copy:sender;
-
- -lineWidthChanged:sender;
- -(BOOL)acceptsFirstMouse;
- @end
-
-