Skip to content

Commit

Permalink
Document mapprimitives used by SWIG
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Mar 2, 2021
1 parent 1dd7b07 commit 2d5cae1
Showing 1 changed file with 38 additions and 23 deletions.
61 changes: 38 additions & 23 deletions mapprimitive.h
Expand Up @@ -30,9 +30,15 @@
#ifndef MAPPRIMITIVE_H
#define MAPPRIMITIVE_H
/* feature primitives */
/**
A rectObj represents a rectangle or bounding box.
A rectObj may be a lone object or an attribute of another object and has no other associations.
*/
typedef struct {
double minx, miny, maxx, maxy;
double minx; ///< Minimum easting
double miny; ///< Minimum northing
double maxx; ///< Maximum easting
double maxy; ///< Maximum northing
} rectObj;

#ifndef SWIG
Expand All @@ -42,17 +48,21 @@ typedef struct {
} vectorObj;
#endif /*SWIG*/

/**
A :class:`pointObj` has an x, y and optionally z and m values.
A :class:`pointObj` instance may be associated with a :class:`lineObj`.
*/
typedef struct {
double x;
double y;
double x; ///< The x coordinate of the point
double y; ///< The y coordinate of the point
#ifdef USE_POINT_Z_M
double z;
double m;
double z; ///< The z (height) coordinate of the point
double m; ///< The m (measure) of the point, used for linear referencing
#endif
} pointObj;

/**
A lineObj is composed of one or more pointObj instances
A :class:`lineObj` is composed of one or more :class:`pointObj` instances
*/
typedef struct {
#ifdef SWIG
Expand All @@ -67,38 +77,43 @@ typedef struct {
#endif
} lineObj;

/**
Each feature of a layer's data is a :class:`shapeObj`. Each part of the shape is a closed :class:`lineObj`.
*/
typedef struct {

#ifndef SWIG
lineObj *line;
char **values;
void *geometry;
void *renderer_cache;
#endif

#ifdef SWIG
%immutable;
#endif
int numlines;
int numvalues;
#ifndef SWIG
lineObj *line;
char **values;
void *geometry;
void *renderer_cache;
#endif
int numlines; ///< Number of parts
int numvalues; ///< Number of shape attributes

#ifdef SWIG
%mutable;
#endif

rectObj bounds;
int type; /* MS_SHAPE_TYPE */
long index;
int tileindex;
int classindex;
char *text;
rectObj bounds; ///< Bounding box of shape
int type; ///< MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON, or MS_SHAPE_NULL
long index; ///< Feature index within the layer
int tileindex; ///< Index of tiled file for tile-indexed layers
int classindex; ///< The class index for features of a classified layer
char *text; ///< Shape annotation

int scratch;
int resultindex; /* index within a query result set */
int resultindex; ///< Index within a query result set
} shapeObj;

typedef lineObj multipointObj;

#ifndef SWIG
/* attribute primatives */
/* attribute primitives */
typedef struct {
char *name;
long type;
Expand Down

0 comments on commit 2d5cae1

Please sign in to comment.