| 1 | /* | 
|---|
| 2 | * $Id: contour.h,v 1.1.1.1 2001-12-19 18:01:18 perderos Exp $ | 
|---|
| 3 | */ | 
|---|
| 4 |  | 
|---|
| 5 | /* GNUPLOT - contour.h */ | 
|---|
| 6 |  | 
|---|
| 7 | /*[ | 
|---|
| 8 | * Copyright 1999   Thomas Williams, Colin Kelley | 
|---|
| 9 | * | 
|---|
| 10 | * Permission to use, copy, and distribute this software and its | 
|---|
| 11 | * documentation for any purpose with or without fee is hereby granted, | 
|---|
| 12 | * provided that the above copyright notice appear in all copies and | 
|---|
| 13 | * that both that copyright notice and this permission notice appear | 
|---|
| 14 | * in supporting documentation. | 
|---|
| 15 | * | 
|---|
| 16 | * Permission to modify the software is granted, but not the right to | 
|---|
| 17 | * distribute the complete modified source code.  Modifications are to | 
|---|
| 18 | * be distributed as patches to the released version.  Permission to | 
|---|
| 19 | * distribute binaries produced by compiling modified sources is granted, | 
|---|
| 20 | * provided you | 
|---|
| 21 | *   1. distribute the corresponding source modifications from the | 
|---|
| 22 | *    released version in the form of a patch file along with the binaries, | 
|---|
| 23 | *   2. add special version identification to distinguish your version | 
|---|
| 24 | *    in addition to the base release version number, | 
|---|
| 25 | *   3. provide your name and address as the primary contact for the | 
|---|
| 26 | *    support of your modified version, and | 
|---|
| 27 | *   4. retain our contact information in regard to use of the base | 
|---|
| 28 | *    software. | 
|---|
| 29 | * Permission to distribute the released version of the source code along | 
|---|
| 30 | * with corresponding source modifications in the form of a patch file is | 
|---|
| 31 | * granted with same provisions 2 through 4 for binary distributions. | 
|---|
| 32 | * | 
|---|
| 33 | * This software is provided "as is" without express or implied warranty | 
|---|
| 34 | * to the extent permitted by applicable law. | 
|---|
| 35 | ]*/ | 
|---|
| 36 |  | 
|---|
| 37 | #ifndef GNUPLOT_CONTOUR_H | 
|---|
| 38 | # define GNUPLOT_CONTOUR_H | 
|---|
| 39 |  | 
|---|
| 40 | /* #if... / #include / #define collection: */ | 
|---|
| 41 |  | 
|---|
| 42 | /*** | 
|---|
| 43 | #include "syscfg.h" | 
|---|
| 44 | ***/ | 
|---|
| 45 | #include "gp_types.h" | 
|---|
| 46 |  | 
|---|
| 47 | #include "dynarray.h" | 
|---|
| 48 | #include "graph3d.h" | 
|---|
| 49 | #include "mymisc.h" | 
|---|
| 50 | #include <math.h> | 
|---|
| 51 |  | 
|---|
| 52 | #define DEFAULT_CONTOUR_LEVELS 5 | 
|---|
| 53 | #define DEFAULT_NUM_APPROX_PTS 5 | 
|---|
| 54 | #define DEFAULT_CONTOUR_ORDER  4 | 
|---|
| 55 | #define MAX_BSPLINE_ORDER      10 | 
|---|
| 56 |  | 
|---|
| 57 | /* Type definitions */ | 
|---|
| 58 |  | 
|---|
| 59 | typedef enum en_contour_kind { | 
|---|
| 60 | /* Method of drawing the contour lines found */ | 
|---|
| 61 | CONTOUR_KIND_LINEAR, | 
|---|
| 62 | CONTOUR_KIND_CUBIC_SPL, | 
|---|
| 63 | CONTOUR_KIND_BSPLINE | 
|---|
| 64 | } t_contour_kind; | 
|---|
| 65 |  | 
|---|
| 66 | typedef enum en_contour_levels_kind { | 
|---|
| 67 | /* How contour levels are set */ | 
|---|
| 68 | LEVELS_AUTO,                /* automatically selected */ | 
|---|
| 69 |  | 
|---|
| 70 | LEVELS_INCREMENTAL,         /* user specified start & incremnet */ | 
|---|
| 71 | LEVELS_DISCRETE,            /* user specified discrete levels */ | 
|---|
| 72 | LEVELS_NUM                  /* User sets contour number - AJOUT OP */ | 
|---|
| 73 |  | 
|---|
| 74 | } t_contour_levels_kind; | 
|---|
| 75 |  | 
|---|
| 76 |  | 
|---|
| 77 | /* Used to allocate the tri-diag matrix. */ | 
|---|
| 78 | typedef double tri_diag[3]; | 
|---|
| 79 |  | 
|---|
| 80 | /* Variables of contour.c needed by other modules: */ | 
|---|
| 81 |  | 
|---|
| 82 | extern char contour_format[]; | 
|---|
| 83 | extern t_contour_kind contour_kind; | 
|---|
| 84 | extern t_contour_levels_kind contour_levels_kind; | 
|---|
| 85 | extern int contour_levels; | 
|---|
| 86 | extern int contour_order; | 
|---|
| 87 | extern int contour_pts; | 
|---|
| 88 |  | 
|---|
| 89 | /* storage for z levels to draw contours at */ | 
|---|
| 90 | extern dynarray dyn_contour_levels_list; | 
|---|
| 91 | /*#define contour_levels_list ((double *)dyn_contour_levels_list.v) */ | 
|---|
| 92 | extern double * contour_levels_list; | 
|---|
| 93 |  | 
|---|
| 94 | /* Prototypes of functions exported by contour.c */ | 
|---|
| 95 |  | 
|---|
| 96 | struct gnuplot_contours *contour(int num_isolines, struct iso_curve *iso_lines); | 
|---|
| 97 | int solve_tri_diag(tri_diag m[], double r[], double x[], int n); | 
|---|
| 98 | int Get_Num_Of_Z_Levels(); | 
|---|
| 99 |  | 
|---|
| 100 | #endif /* GNUPLOT_CONTOUR_H */ | 
|---|