1 /*
2 * Automatically generated - DO NOT EDIT!
3 */
4
5 #ifndef __objectClass
6 #define __objectClass
7 /***********************************************************************/
8 /* Open Visualization Data Explorer */
9 /* (C) Copyright IBM Corp. 1989,1999 */
10 /* ALL RIGHTS RESERVED */
11 /* This code licensed under the */
12 /* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */
13 /***********************************************************************/
14
15 /*
16 \section{Object class}
17
18 Every object begins with an object preamble, which contains the class
19 number and a reference count.
20 */
21
22 #include <dx/dx.h>
23
24 /* the following make ANSI compilers happier */
25 struct shade;
26 struct buffer;
27 struct tile;
28 struct gather;
29 struct survey;
30 struct count;
31
32 struct _root {
33 int size;
34 Class class;
35 char *name;
36 };
37 #define CLASS_SIZE(x) (((struct _root *)(x))->size)
38 #define CLASS_CLASS(x) (((struct _root *)(x))->class)
39 #define CLASS_NAME(x) (((struct _root *)(x))->name)
40
41
42 extern struct object_class _dxdobject_class;
43 Error _dxfDelete(Object);
44 Error _dxfno_Delete(Object);
45 Error _dxfShade(Object, struct shade *);
46 Error _dxfno_Shade(Object, struct shade *);
47 Object _dxfBoundingBox(Object, Point*, Matrix*, int);
48 Object _dxfno_BoundingBox(Object, Point*, Matrix*, int);
49 Object _dxfPaint(Object, struct buffer *, int, struct tile *);
50 Object _dxfno_Paint(Object, struct buffer *, int, struct tile *);
51 Object _dxfGather(Object, struct gather *, struct tile *);
52 Object _dxfno_Gather(Object, struct gather *, struct tile *);
53 Error _dxfPartition(Object, int*, int, Object*, int);
54 Error _dxfno_Partition(Object, int*, int, Object*, int);
55 Object _dxfGetType(Object, Type*, Category*, int*, int*);
56 Object _dxfno_GetType(Object, Type*, Category*, int*, int*);
57 Object _dxfCopy(Object, enum _dxd_copy);
58 Object _dxfno_Copy(Object, enum _dxd_copy);
59 Error _dxfObject_Delete(Object);
60 Object _dxfObject_BoundingBox(Object, Point*, Matrix*, int);
61 Error _dxfObject_Shade(Object, struct shade *);
62
63 #define NATTRIBUTES 2 /* number of attributes in object */
64
65 struct object { /* object preamble */
66 struct object_class *class; /* class vector */
67 Class class_id; /* class id (for debugging only!) */
68 lock_type lock; /* for Reference and Delete */
69 int count; /* reference count */
70 int tag; /* object tag */
71 struct attribute { /* object attributes */
72 char *name; /* attribute name */
73 Object value; /* attribue value */
74 } local[NATTRIBUTES], *attributes; /* the attributes */
75 int nattributes; /* number of attributes */
76 int attr_alloc; /* allocated space for attributes */
77 };
78
79 #if 0 /* was if OPTIMIZED */
80 #define CHECK(obj, cls) { \
81 if (!obj) \
82 return ERROR; \
83 }
84 #else
85 #define CHECK(obj, cls) { \
86 if (!obj) \
87 return ERROR; \
88 if (DXGetObjectClass((Object)(obj)) != cls) \
89 DXErrorReturn(ERROR_BAD_CLASS, "called with object of wrong class"); \
90 }
91 #endif
92 /**
93 This macro eases the task of checking argument class. Note: This is not needed
94 when a method implementation is called, because {\tt o} and its class will
95 both have been checked by the method.
96 **/
97
98 Object _dxf_NewObject(struct object_class *class);
99 /**
100 This internal routine is called only by other {\tt New...} routines to
101 create and initialize the object preamble.
102 **/
103
104 Object _dxf_CopyObject(Object new, Object old, enum _dxd_copy copy);
105 /**
106 Copies the portion of the data of {\tt old} managed by the {\tt
107 Object} class to {\tt new}. This is provided for subclasses of {\tt Object}
108 to use in their copy routines. Copying works something like creating
109 an object. Every class {\tt X} that implements copying should provide
110 an {\tt \_CopyX} routine that copies relevant data from an old object
111 to a new object, so that subclass copy routines may call this routine
112 to copy the superclass's data. The {\tt CopyX} routine just creates a
113 new object of the appropriate type and then calls {\tt \_CopyX} to copy
114 the data.
115 **/
116 #endif
117 #ifndef __groupClass
118 #define __groupClass
119 /***********************************************************************/
120 /* Open Visualization Data Explorer */
121 /* (C) Copyright IBM Corp. 1989,1999 */
122 /* ALL RIGHTS RESERVED */
123 /* This code licensed under the */
124 /* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */
125 /***********************************************************************/
126 /*
127 \section{Group class}
128 */
129
130
131
132 extern struct group_class _dxdgroup_class;
133 Error _dxfGroup_Delete(Group);
134 Object _dxfGroup_GetType(Group, Type*, Category*, int*, int*);
135 Object _dxfGroup_Copy(Group, enum _dxd_copy);
136 Object _dxfGroup_BoundingBox(Group, Point*, Matrix*, int);
137 Object _dxfGroup_Gather(Group, struct gather *, struct tile *);
138 Object _dxfGroup_Paint(Group, struct buffer *, int, struct tile *);
139 Error _dxfGroup_Shade(Group, struct shade *);
140 Group _dxfSetMember(Group, char *, Object);
141 Group _dxfno_SetMember(Group, char *, Object);
142 Group _dxfSetEnumeratedMember(Group, int, Object);
143 Group _dxfno_SetEnumeratedMember(Group, int, Object);
144 Group _dxfGroup_SetMember(Group, char *, Object);
145 Group _dxfGroup_SetEnumeratedMember(Group, int, Object);
146
147
148 extern struct series_class _dxdseries_class;
149 Group _dxfSeries_SetMember(Series, char *, Object);
150 Group _dxfSeries_SetEnumeratedMember(Series, int, Object);
151 Object _dxfSeries_Copy(Series, enum _dxd_copy);
152
153
154 extern struct compositefield_class _dxdcompositefield_class;
155 Group _dxfCompositeField_SetMember(CompositeField, char *, Object);
156 Group _dxfCompositeField_SetEnumeratedMember(CompositeField, int, Object);
157 Object _dxfCompositeField_BoundingBox(CompositeField, Point*, Matrix*, int);
158
159
160 extern struct multigrid_class _dxdmultigrid_class;
161 Group _dxfMultiGrid_SetMember(MultiGrid, char *, Object);
162 Group _dxfMultiGrid_SetEnumeratedMember(MultiGrid, int, Object);
163
164 struct group {
165
166 struct object object; /* object preamble */
167 lock_type lock; /* for Set(Enumerated)Member only */
168
169 /* the members */
170 struct member { /* the members */
171 char *name; /* the member name */
172 Object value; /* the member */
173 float position; /* position on series axis for series group */
174 } *members; /* the members */
175 int nmembers; /* number of members */
176 int alloc; /* space allocated */
177
178 /* SetGroupType()/GetType() */
179 int typed; /* whether type was set */
180 Type type; /* the type */
181 Category category; /* the category */
182 int rank; /* rank */
183 int *shape; /* shape */
184 };
185
186 struct series { /* series object */
187 struct group group; /* group preamble */
188 };
189
190 struct compositefield { /* composite field object */
191 struct group group; /* group preamble */
192 };
193
194 struct multigrid { /* multigrid object */
195 struct group group; /* group preamble */
196 };
197
198 Group _dxf_NewGroup(struct group_class *class);
199
200 Group _dxf_SetEnumeratedMember(Group g, int n, double position, Object value);
201 /**
202 Internal routine to support both {\tt SetEnumeratedMember()} and
203 {\tt SetSeriesMember()}.
204 **/
205
206 Object _dxf_GetEnumeratedMember(Group g, int n, float *position, char **name);
207 /**
208 Internal routine to support both {\tt GetEnumeratedMember()} and
209 {\tt GetSeriesMember()}.
210 **/
211
212 #endif
213
214 struct object_class {
215 struct _root root;
216 Class class;
217 char *name;
218 Error (*Delete)();
219 Error (*Shade)();
220 Object (*BoundingBox)();
221 Object (*Paint)();
222 Object (*Gather)();
223 Error (*Partition)();
224 Object (*GetType)();
225 Object (*Copy)();
226 };
227
228 struct group_class {
229 struct object_class super;
230 Class class;
231 char *name;
232 Group (*SetMember)();
233 Group (*SetEnumeratedMember)();
234 };
235
_dxfno_SetMember(Group a,char * b,Object c)236 Group _dxfno_SetMember(Group a, char * b, Object c) {
237 char *name;
238 name = (*(struct group_class **)a)->name;
239 DXSetError(ERROR_BAD_PARAMETER, "#12130", "DXSetMember", name);
240 return NULL;
241 }
242
_dxfno_SetEnumeratedMember(Group a,int b,Object c)243 Group _dxfno_SetEnumeratedMember(Group a, int b, Object c) {
244 char *name;
245 name = (*(struct group_class **)a)->name;
246 DXSetError(ERROR_BAD_PARAMETER, "#12130", "DXSetEnumeratedMember", name);
247 return NULL;
248 }
249
250 struct group_class _dxdgroup_class = {
251 sizeof(struct group),
252 CLASS_GROUP,
253 "group",
254 CLASS_GROUP,
255 "group",
256 _dxfGroup_Delete,
257 _dxfGroup_Shade,
258 _dxfGroup_BoundingBox,
259 _dxfGroup_Paint,
260 _dxfGroup_Gather,
261 _dxfno_Partition,
262 _dxfGroup_GetType,
263 _dxfGroup_Copy,
264 CLASS_GROUP,
265 "group",
266 _dxfGroup_SetMember,
267 _dxfGroup_SetEnumeratedMember,
268 };
269
_dxfSetMember(Group a,char * b,Object c)270 Group _dxfSetMember(Group a, char * b, Object c) {
271 if (!a)
272 return NULL;
273 return (*(struct group_class **)a)->SetMember((Group)a,b,c);
274 }
275
_dxfSetEnumeratedMember(Group a,int b,Object c)276 Group _dxfSetEnumeratedMember(Group a, int b, Object c) {
277 if (!a)
278 return NULL;
279 return (*(struct group_class **)a)->SetEnumeratedMember((Group)a,b,c);
280 }
281
DXGetGroupClass(Group o)282 Class DXGetGroupClass(Group o) {
283 return o? (*(struct group_class **)o)->class: CLASS_MIN;
284 }
285
286 struct series_class {
287 struct group_class super;
288 Class class;
289 char *name;
290 };
291
292 struct series_class _dxdseries_class = {
293 sizeof(struct series),
294 CLASS_SERIES,
295 "series",
296 CLASS_GROUP,
297 "group",
298 _dxfGroup_Delete,
299 _dxfGroup_Shade,
300 _dxfGroup_BoundingBox,
301 _dxfGroup_Paint,
302 _dxfGroup_Gather,
303 _dxfno_Partition,
304 _dxfGroup_GetType,
305 _dxfSeries_Copy,
306 CLASS_SERIES,
307 "series",
308 _dxfSeries_SetMember,
309 _dxfSeries_SetEnumeratedMember,
310 CLASS_SERIES,
311 "series",
312 };
313
DXGetSeriesClass(Series o)314 Class DXGetSeriesClass(Series o) {
315 return o? (*(struct series_class **)o)->class: CLASS_MIN;
316 }
317
318 struct compositefield_class {
319 struct group_class super;
320 Class class;
321 char *name;
322 };
323
324 struct compositefield_class _dxdcompositefield_class = {
325 sizeof(struct compositefield),
326 CLASS_COMPOSITEFIELD,
327 "compositefield",
328 CLASS_GROUP,
329 "group",
330 _dxfGroup_Delete,
331 _dxfGroup_Shade,
332 _dxfCompositeField_BoundingBox,
333 _dxfGroup_Paint,
334 _dxfGroup_Gather,
335 _dxfno_Partition,
336 _dxfGroup_GetType,
337 _dxfGroup_Copy,
338 CLASS_COMPOSITEFIELD,
339 "compositefield",
340 _dxfCompositeField_SetMember,
341 _dxfCompositeField_SetEnumeratedMember,
342 CLASS_COMPOSITEFIELD,
343 "compositefield",
344 };
345
DXGetCompositeFieldClass(CompositeField o)346 Class DXGetCompositeFieldClass(CompositeField o) {
347 return o? (*(struct compositefield_class **)o)->class: CLASS_MIN;
348 }
349
350 struct multigrid_class {
351 struct group_class super;
352 Class class;
353 char *name;
354 };
355
356 struct multigrid_class _dxdmultigrid_class = {
357 sizeof(struct multigrid),
358 CLASS_MULTIGRID,
359 "multigrid",
360 CLASS_GROUP,
361 "group",
362 _dxfGroup_Delete,
363 _dxfGroup_Shade,
364 _dxfGroup_BoundingBox,
365 _dxfGroup_Paint,
366 _dxfGroup_Gather,
367 _dxfno_Partition,
368 _dxfGroup_GetType,
369 _dxfGroup_Copy,
370 CLASS_MULTIGRID,
371 "multigrid",
372 _dxfMultiGrid_SetMember,
373 _dxfMultiGrid_SetEnumeratedMember,
374 CLASS_MULTIGRID,
375 "multigrid",
376 };
377
DXGetMultiGridClass(MultiGrid o)378 Class DXGetMultiGridClass(MultiGrid o) {
379 return o? (*(struct multigrid_class **)o)->class: CLASS_MIN;
380 }
381
382