home *** CD-ROM | disk | FTP | other *** search
/ Nebula / nebula.bin / SourceCode / Classes / ContourView / contour.h < prev    next >
Text File  |  1992-12-02  |  1KB  |  42 lines

  1. /* contour.h */
  2.  
  3. #import <appkit/color.h>
  4.  
  5.  
  6. #define epsilon .0002
  7.  
  8. /* Each contour path found is stored in this structure */
  9. typedef struct contour_path {
  10.     struct contour_path *next;    /* pointer to next contour path */
  11.     float  *x;            /* X coordinate array */
  12.     float  *y;            /* Y coordinate array */
  13.     float  level;            /* contour's level */
  14.     int    num_pts;            /* # of points in this path */
  15.     int    closed;            /* non-zero if contour is closed */
  16.     int    levelindex;        /* levelindex-th contour level */
  17.     int    hi_inside;        /* non-zero if inside contour is going up */
  18. } ContourPath;
  19.  
  20.  
  21.  
  22. /* User specified attribute for each contour level */
  23. typedef struct contour_attribute {
  24.     float    level;    /* value of contour level */
  25.     float    linewidth;    /* line width */
  26.     int    dash;        /* dash type */
  27.     int    anotate;    /* non-zero if this contour should be annotated */
  28.     NXColor    linecolor;    /* color of contour line */
  29.     NXColor fillcolor_hi;    /* color of fill when inside is higher */
  30.     NXColor fillcolor_lo;    /* color of fill when inside is lower */
  31. } CntrAttribute;
  32.  
  33.  
  34.  
  35. int computeContour(id vObj, int nx, int ny, float *x, float *y, float *f,
  36.         int ncont, CntrAttribute *cAttr);
  37.  
  38. void sort_contourList(ContourPath *cntrList, float xxmin, float xxmax, float yymin, float yymax,
  39.             int nContours, ContourPath **SCntrPtr);
  40. int non_zero_winding(float xp, float yp, float *x, float *y, int n_path);
  41.  
  42.