1 /******************************************************************************
2  * $Id$
3  *
4  * Project:  MapServer
5  * Purpose:  Declarations for rectObj, pointObj, lineObj, shapeObj, etc.
6  * Author:   Steve Lime and the MapServer team.
7  *
8  ******************************************************************************
9  * Copyright (c) 1996-2005 Regents of the University of Minnesota.
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included in
19  * all copies of this Software or works derived from this Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  ****************************************************************************/
29 
30 #ifndef MAPPRIMITIVE_H
31 #define MAPPRIMITIVE_H
32 
33 /* feature primitives */
34 typedef struct {
35   double minx, miny, maxx, maxy;
36 } rectObj;
37 
38 #ifndef SWIG
39 typedef struct {
40   double x;
41   double y;
42 } vectorObj;
43 #endif /*SWIG*/
44 
45 typedef struct {
46   double x;
47   double y;
48 #ifdef USE_POINT_Z_M
49   double z;
50   double m;
51 #endif
52 } pointObj;
53 
54 typedef struct {
55 #ifdef SWIG
56   %immutable;
57 #endif
58   int numpoints;
59 #ifndef SWIG
60   pointObj *point;
61 #endif
62 #ifdef SWIG
63   %mutable;
64 #endif
65 } lineObj;
66 
67 typedef struct {
68 #ifdef SWIG
69   %immutable;
70 #endif
71   int numlines;
72   int numvalues;
73 #ifndef SWIG
74   lineObj *line;
75   char **values;
76   void *geometry;
77   void *renderer_cache;
78 #endif
79 
80 #ifdef SWIG
81   %mutable;
82 #endif
83 
84   rectObj bounds;
85   int type; /* MS_SHAPE_TYPE */
86   long index;
87   int tileindex;
88   int classindex;
89   char *text;
90 
91   int scratch;
92   int resultindex; /* index within a query result set */
93 } shapeObj;
94 
95 typedef lineObj multipointObj;
96 
97 #ifndef SWIG
98 /* attribute primatives */
99 typedef struct {
100   char *name;
101   long type;
102   int index;
103   int size;
104   short numdecimals;
105 } itemObj;
106 #endif
107 
108 #ifndef SWIG
109 typedef struct {
110   int  need_geotransform;
111   double rotation_angle;
112   double geotransform[6];    /* Pixel/line to georef. */
113   double invgeotransform[6]; /* georef to pixel/line */
114 } geotransformObj;
115 #endif
116 
117 #endif /* MAPPRIMITIVE_H */
118