454
|
1 // tree-plot.h -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993, 1994 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_tree_plot_h) |
|
25 #define octave_tree_plot_h 1 |
|
26 |
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
|
31 class tree_plot_limits; |
|
32 class tree_plot_range; |
|
33 class tree_subplot; |
|
34 class tree_subplot_using; |
|
35 class tree_subplot_style; |
|
36 class tree_subplot_list; |
|
37 class tree_plot_command; |
|
38 |
|
39 class ostream; |
|
40 |
|
41 #include "tree-base.h" |
|
42 #include "tree.h" |
|
43 |
|
44 class |
|
45 tree_plot_command : public tree_command |
|
46 { |
|
47 public: |
|
48 tree_plot_command (void); |
|
49 tree_plot_command (tree_subplot_list *plt, int nd); |
|
50 tree_plot_command (tree_subplot_list *plt, tree_plot_limits *rng, int nd); |
|
51 |
|
52 ~tree_plot_command (void); |
|
53 |
|
54 tree_constant eval (int print); |
|
55 |
|
56 private: |
|
57 int ndim; |
|
58 tree_plot_limits *range; |
|
59 tree_subplot_list *plot_list; |
|
60 }; |
|
61 |
|
62 class |
|
63 tree_subplot_list : public tree |
|
64 { |
|
65 public: |
|
66 tree_subplot_list (void); |
|
67 tree_subplot_list (tree *data); |
|
68 tree_subplot_list (tree_subplot_list *t); |
|
69 tree_subplot_list (tree_subplot_using *u, tree *t, tree_subplot_style *s); |
|
70 |
|
71 ~tree_subplot_list (void); |
|
72 |
|
73 tree_subplot_list *set_data (tree *data); |
|
74 |
|
75 tree_subplot_list *chain (tree_subplot_list *t); |
|
76 |
|
77 tree_subplot_list *reverse (void); |
|
78 |
|
79 tree_subplot_list *next_elem (void); |
|
80 |
|
81 tree_constant eval (int print); |
|
82 // tree_constant *eval (int print, int nargout); |
|
83 |
|
84 int print (int ndim, ostrstream& plot_buf); |
|
85 |
|
86 private: |
|
87 tree *plot_data; |
|
88 tree_subplot_using *using; |
|
89 tree *title; |
|
90 tree_subplot_style *style; |
|
91 tree_subplot_list *next; |
|
92 }; |
|
93 |
|
94 class |
|
95 tree_plot_limits : public tree |
|
96 { |
|
97 public: |
|
98 tree_plot_limits (void); |
|
99 tree_plot_limits (tree_plot_range *xlim); |
|
100 tree_plot_limits (tree_plot_range *xlim, tree_plot_range *ylim); |
|
101 tree_plot_limits (tree_plot_range *xlim, tree_plot_range *ylim, |
|
102 tree_plot_range *zlim); |
|
103 |
|
104 ~tree_plot_limits (void); |
|
105 |
|
106 tree_constant eval (int print); |
|
107 |
|
108 void print (int print, ostrstream& plot_buf); |
|
109 |
|
110 private: |
|
111 tree_plot_range *x_range; |
|
112 tree_plot_range *y_range; |
|
113 tree_plot_range *z_range; |
|
114 }; |
|
115 |
|
116 class |
|
117 tree_plot_range : public tree |
|
118 { |
|
119 public: |
|
120 tree_plot_range (void); |
|
121 tree_plot_range (tree *l, tree *u); |
|
122 |
|
123 ~tree_plot_range (void); |
|
124 |
|
125 tree_constant eval (int print); |
|
126 |
|
127 void print (ostrstream& plot_buf); |
|
128 |
|
129 private: |
|
130 tree *lower; |
|
131 tree *upper; |
|
132 }; |
|
133 |
|
134 class |
|
135 tree_subplot_using : public tree |
|
136 { |
|
137 public: |
|
138 tree_subplot_using (void); |
|
139 tree_subplot_using (tree *fmt); |
|
140 |
|
141 ~tree_subplot_using (void); |
|
142 |
|
143 tree_subplot_using *set_format (tree *fmt); |
|
144 |
|
145 tree_subplot_using *add_qualifier (tree *t); |
|
146 |
|
147 tree_constant eval (int print); |
|
148 |
|
149 int print (int ndim, int n_max, ostrstream& plot_buf); |
|
150 |
|
151 private: |
|
152 int qualifier_count; |
|
153 tree *x[4]; |
|
154 tree *scanf_fmt; |
|
155 }; |
|
156 |
|
157 class |
|
158 tree_subplot_style : public tree |
|
159 { |
|
160 public: |
|
161 tree_subplot_style (void); |
|
162 tree_subplot_style (char *s); |
|
163 tree_subplot_style (char *s, tree *lt); |
|
164 tree_subplot_style (char *s, tree *lt, tree *pt); |
|
165 |
|
166 ~tree_subplot_style (void); |
|
167 |
|
168 tree_constant eval (int print); |
|
169 |
|
170 int print (ostrstream& plot_buf); |
|
171 |
|
172 private: |
|
173 char *style; |
|
174 tree *linetype; |
|
175 tree *pointtype; |
|
176 }; |
|
177 |
|
178 #endif |
|
179 |
|
180 /* |
|
181 ;;; Local Variables: *** |
|
182 ;;; mode: C++ *** |
|
183 ;;; page-delimiter: "^/\\*" *** |
|
184 ;;; End: *** |
|
185 */ |