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