1 /*
2  gg_const.h -- Gaia common support for geometries: constants
3 
4  version 5.0, 2020 August 1
5 
6  Author: Sandro Furieri a.furieri@lqt.it
7 
8  ------------------------------------------------------------------------------
9 
10  Version: MPL 1.1/GPL 2.0/LGPL 2.1
11 
12  The contents of this file are subject to the Mozilla Public License Version
13  1.1 (the "License"); you may not use this file except in compliance with
14  the License. You may obtain a copy of the License at
15  http://www.mozilla.org/MPL/
16 
17 Software distributed under the License is distributed on an "AS IS" basis,
18 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19 for the specific language governing rights and limitations under the
20 License.
21 
22 The Original Code is the SpatiaLite library
23 
24 The Initial Developer of the Original Code is Alessandro Furieri
25 
26 Portions created by the Initial Developer are Copyright (C) 2008-2021
27 the Initial Developer. All Rights Reserved.
28 
29 Contributor(s):
30 Klaus Foerster klaus.foerster@svg.cc
31 
32 Alternatively, the contents of this file may be used under the terms of
33 either the GNU General Public License Version 2 or later (the "GPL"), or
34 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
35 in which case the provisions of the GPL or the LGPL are applicable instead
36 of those above. If you wish to allow use of your version of this file only
37 under the terms of either the GPL or the LGPL, and not to allow others to
38 use your version of this file under the terms of the MPL, indicate your
39 decision by deleting the provisions above and replace them with the notice
40 and other provisions required by the GPL or the LGPL. If you do not delete
41 the provisions above, a recipient may use your version of this file under
42 the terms of any one of the MPL, the GPL or the LGPL.
43 
44 */
45 
46 
47 /**
48  \file gg_const.h
49 
50  Geometry constants and macros
51  */
52 
53 #ifndef _GG_CONST_H
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55 #define _GG_CONST_H
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif
62 
63 /* constant values for getVectorLayersList modes */
64 
65 /** mode: FAST (QGIS data-provider) */
66 #define GAIA_VECTORS_LIST_FAST	0
67 
68 /** mode: OPTIMISTIC */
69 #define GAIA_VECTORS_LIST_OPTIMISTIC	1
70 
71 /** mode: PESSIMISTIC */
72 #define GAIA_VECTORS_LIST_PESSIMISTIC	2
73 
74 /* constant values for Vector Layer Types */
75 
76 /** Vector Layer: unknown type */
77 #define GAIA_VECTOR_UNKNOWN	-1
78 /** Vector Layer: Spatial Table */
79 #define GAIA_VECTOR_TABLE	1
80 /** Vector Layer: Spatial View */
81 #define GAIA_VECTOR_VIEW	2
82 /** Vector Layer: Virtual Shape */
83 #define GAIA_VECTOR_VIRTUAL	3
84 
85 /* constant values for Vector Layer Geometry Types */
86 
87 /** Vector Layer Geometry: Geometry */
88 #define GAIA_VECTOR_GEOMETRY		0
89 /** Vector Layer Geometry: Point */
90 #define GAIA_VECTOR_POINT		1
91 /** Vector Layer Geometry: Linestring */
92 #define GAIA_VECTOR_LINESTRING		2
93 /** Vector Layer Geometry: Polygon */
94 #define GAIA_VECTOR_POLYGON		3
95 /** Vector Layer Geometry: MultiPoint */
96 #define GAIA_VECTOR_MULTIPOINT		4
97 /** Vector Layer Geometry: MultiLinestring */
98 #define GAIA_VECTOR_MULTILINESTRING	5
99 /** Vector Layer Geometry: MultiPolygon */
100 #define GAIA_VECTOR_MULTIPOLYGON	6
101 /** Vector Layer Geometry: GeometryCollection */
102 #define GAIA_VECTOR_GEOMETRYCOLLECTION	7
103 
104 /* constant values for Spatial Index */
105 
106 /** Vector Layer: no Spatial Index */
107 #define GAIA_SPATIAL_INDEX_NONE		0
108 /** Vector Layer: Spatial Index RTree */
109 #define GAIA_SPATIAL_INDEX_RTREE	1
110 /** Vector Layer: Spatial Index MbrCache */
111 #define GAIA_SPATIAL_INDEX_MBRCACHE	2
112 
113 /* constant values for generic geometry classes */
114 
115 /** WKT parser: unknown Geometry type */
116 #define GAIA_TYPE_NONE		0
117 /** WKT parser: Point Geometry type */
118 #define GAIA_TYPE_POINT		1
119 /** WKT parser: Linestring Geometry type */
120 #define GAIA_TYPE_LINESTRING	2
121 /** WKT parser: Polygon Geometry type */
122 #define GAIA_TYPE_POLYGON	3
123 
124 /* constants that defines byte storage order  */
125 /** Big-Endian marker */
126 #define GAIA_BIG_ENDIAN		0
127 /** Little-Endian marker */
128 #define GAIA_LITTLE_ENDIAN	1
129 /** TinyPoint Big-Endian marker */
130 #define GAIA_TINYPOINT_BIG_ENDIAN		0x80
131 /** TinyPoint Little-Endian marker */
132 #define GAIA_TINYPOINT_LITTLE_ENDIAN	0x81
133 
134 /* constants that defines special markers used for encoding of SpatiaLite internal BLOB geometries  */
135 /** BLOB-Geometry internal marker: START */
136 #define GAIA_MARK_START		0x00
137 /** BLOB-Geometry internal marker: END */
138 #define GAIA_MARK_END		0xFE
139 /** BLOB-Geometry internal marker: MBR */
140 #define GAIA_MARK_MBR		0x7C
141 /** BLOB-Geometry internal marker: ENTITY */
142 #define GAIA_MARK_ENTITY	0x69
143 
144 /* constants that defines GEOMETRY CLASSes */
145 /** BLOB-Geometry CLASS: unknown */
146 #define GAIA_UNKNOWN			0
147 /** BLOB-Geometry CLASS: POINT */
148 #define GAIA_POINT			1
149 /** BLOB-Geometry CLASS: LINESTRING */
150 #define GAIA_LINESTRING			2
151 /** BLOB-Geometry CLASS: POLYGON */
152 #define GAIA_POLYGON			3
153 /** BLOB-Geometry CLASS: MULTIPOINT */
154 #define GAIA_MULTIPOINT			4
155 /** BLOB-Geometry CLASS: MULTILINESTRING */
156 #define GAIA_MULTILINESTRING		5
157 /** BLOB-Geometry CLASS: MULTIPOLYGON */
158 #define GAIA_MULTIPOLYGON		6
159 /** BLOB-Geometry CLASS: GEOMETRYCOLLECTION */
160 #define GAIA_GEOMETRYCOLLECTION		7
161 /** BLOB-Geometry CLASS: POINT Z */
162 #define GAIA_POINTZ			1001
163 /** BLOB-Geometry CLASS: LINESTRING Z */
164 #define GAIA_LINESTRINGZ		1002
165 /** BLOB-Geometry CLASS: POLYGON Z */
166 #define GAIA_POLYGONZ			1003
167 /** BLOB-Geometry CLASS: MULTIPOINT Z */
168 #define GAIA_MULTIPOINTZ		1004
169 /** BLOB-Geometry CLASS: MULTILINESTRING Z */
170 #define GAIA_MULTILINESTRINGZ		1005
171 /** BLOB-Geometry CLASS: MULTIPOLYGON Z */
172 #define GAIA_MULTIPOLYGONZ		1006
173 /** BLOB-Geometry CLASS: GEOMETRYCOLLECTION Z */
174 #define GAIA_GEOMETRYCOLLECTIONZ	1007
175 /** BLOB-Geometry CLASS: POINT M */
176 #define GAIA_POINTM			2001
177 /** BLOB-Geometry CLASS: LINESTRING M */
178 #define GAIA_LINESTRINGM		2002
179 /** BLOB-Geometry CLASS: POLYGON M */
180 #define GAIA_POLYGONM			2003
181 /** BLOB-Geometry CLASS: MULTIPOINT M */
182 #define GAIA_MULTIPOINTM		2004
183 /** BLOB-Geometry CLASS: MULTILINESTRING M */
184 #define GAIA_MULTILINESTRINGM		2005
185 /** BLOB-Geometry CLASS: MULTIPOLYGON M */
186 #define GAIA_MULTIPOLYGONM		2006
187 /** BLOB-Geometry CLASS: GEOMETRYCOLLECTION M */
188 #define GAIA_GEOMETRYCOLLECTIONM	2007
189 /** BLOB-Geometry CLASS: POINT ZM */
190 #define GAIA_POINTZM			3001
191 /** BLOB-Geometry CLASS: LINESTRING ZM */
192 #define GAIA_LINESTRINGZM		3002
193 /** BLOB-Geometry CLASS: POLYGON ZM */
194 #define GAIA_POLYGONZM			3003
195 /** BLOB-Geometry CLASS: MULTIPOINT ZM */
196 #define GAIA_MULTIPOINTZM		3004
197 /** BLOB-Geometry CLASS: MULTILINESTRING ZM */
198 #define GAIA_MULTILINESTRINGZM		3005
199 /** BLOB-Geometry CLASS: MULTIPOLYGON ZM */
200 #define GAIA_MULTIPOLYGONZM		3006
201 /** BLOB-Geometry CLASS: GEOMETRYCOLLECTION ZM */
202 #define GAIA_GEOMETRYCOLLECTIONZM	3007
203 
204 /* constants that defines TinyPoint Types */
205 /** BLOB-TinyPoint Type: POINT XY */
206 #define GAIA_TINYPOINT_XY		0x01
207 /** BLOB-TinyPoint Type: POINT XYZ */
208 #define GAIA_TINYPOINT_XYZ		0x02
209 /** BLOB-TinyPoint Type: POINT XYM */
210 #define GAIA_TINYPOINT_XYM		0x03
211 /** BLOB-TinyPoint Type: POINT XYZM */
212 #define GAIA_TINYPOINT_XYZM		0x04
213 
214 /* constants that defines Compressed GEOMETRY CLASSes */
215 /** BLOB-Geometry CLASS: compressed LINESTRING */
216 #define GAIA_COMPRESSED_LINESTRING		1000002
217 /** BLOB-Geometry CLASS: compressed POLYGON */
218 #define GAIA_COMPRESSED_POLYGON			1000003
219 /** BLOB-Geometry CLASS: compressed LINESTRING Z */
220 #define GAIA_COMPRESSED_LINESTRINGZ		1001002
221 /** BLOB-Geometry CLASS: compressed POLYGON Z */
222 #define GAIA_COMPRESSED_POLYGONZ		1001003
223 /** BLOB-Geometry CLASS: compressed LINESTRING M */
224 #define GAIA_COMPRESSED_LINESTRINGM		1002002
225 /** BLOB-Geometry CLASS: compressed POLYGON M */
226 #define GAIA_COMPRESSED_POLYGONM		1002003
227 /** BLOB-Geometry CLASS: compressed LINESTRING ZM */
228 #define GAIA_COMPRESSED_LINESTRINGZM		1003002
229 /** BLOB-Geometry CLASS: compressed POLYGON ZM */
230 #define GAIA_COMPRESSED_POLYGONZM		1003003
231 
232 /* constants that defines GEOS-WKB 3D CLASSes */
233 /** GEOS-WKB 3D CLASS: POINT Z */
234 #define GAIA_GEOSWKB_POINTZ			-2147483647
235 /** GEOS-WKB 3D CLASS: LINESTRING Z */
236 #define GAIA_GEOSWKB_LINESTRINGZ		-2147483646
237 /** GEOS-WKB 3D CLASS: POLYGON Z */
238 #define GAIA_GEOSWKB_POLYGONZ			-2147483645
239 /** GEOS-WKB 3D CLASS: MULTIPOINT Z */
240 #define GAIA_GEOSWKB_MULTIPOINTZ		-2147483644
241 /** GEOS-WKB 3D CLASS: MULTILINESTRING Z */
242 #define GAIA_GEOSWKB_MULTILINESTRINGZ		-2147483643
243 /** GEOS-WKB 3D CLASS: MULTIPOLYGON Z */
244 #define GAIA_GEOSWKB_MULTIPOLYGONZ		-2147483642
245 /** GEOS-WKB 3D CLASS: POINT Z */
246 #define GAIA_GEOSWKB_GEOMETRYCOLLECTIONZ	-2147483641
247 
248 /* constants that defines multitype values */
249 /** DBF data type: NULL */
250 #define GAIA_NULL_VALUE		0
251 /** DBF data type: TEXT */
252 #define GAIA_TEXT_VALUE		1
253 /** DBF data type: INT */
254 #define GAIA_INT_VALUE		2
255 /** DBF data type: DOUBLE */
256 #define GAIA_DOUBLE_VALUE	3
257 
258 /* constants that defines POINT index for LINESTRING */
259 /** Linestring/Ring functions: START POINT */
260 #define GAIA_START_POINT	1
261 /** Linestring/Ring functions: END POINT */
262 #define GAIA_END_POINT		2
263 /** Linestring/Ring functions: POINTN */
264 #define GAIA_POINTN		3
265 
266 /* constants that defines MBRs spatial relationships */
267 /** MBR relationships: CONTAINS */
268 #define GAIA_MBR_CONTAINS	1
269 /** MBR relationships: DISJOINT */
270 #define GAIA_MBR_DISJOINT	2
271 /** MBR relationships: EQUAL */
272 #define GAIA_MBR_EQUAL		3
273 /** MBR relationships: INTERSECTS */
274 #define GAIA_MBR_INTERSECTS	4
275 /** MBR relationships: OVERLAP */
276 #define GAIA_MBR_OVERLAPS	5
277 /** MBR relationships: TOUCHES */
278 #define GAIA_MBR_TOUCHES	6
279 /** MBR relationships: WITHIN */
280 #define GAIA_MBR_WITHIN		7
281 
282 /* constants used for FilterMBR */
283 /** FilerMBR relationships: WITHIN */
284 #define GAIA_FILTER_MBR_WITHIN		74
285 /** FilerMBR relationships: CONTAINS */
286 #define GAIA_FILTER_MBR_CONTAINS	77
287 /** FilerMBR relationships: INTERSECTS */
288 #define GAIA_FILTER_MBR_INTERSECTS	79
289 /** FilerMBR relationships: DECLARE */
290 #define GAIA_FILTER_MBR_DECLARE		89
291 
292 /* constants defining SVG default values */
293 /** SVG precision: RELATIVE */
294 #define GAIA_SVG_DEFAULT_RELATIVE 	0
295 /** SVG precision: DEFAULT */
296 #define GAIA_SVG_DEFAULT_PRECISION	6
297 /** SVG precision: MAX */
298 #define GAIA_SVG_DEFAULT_MAX_PRECISION 15
299 
300 /* constants used for VirtualNetwork */
301 /** VirtualNetwork internal markers: START */
302 #define GAIA_NET_START		0x67
303 /** VirtualNetwork internal markers: 64 bit START */
304 #define GAIA_NET64_START	0x68
305 /** VirtualNetwork internal markers: A-Stat START */
306 #define GAIA_NET64_A_STAR_START	0x69
307 /** VirtualNetwork internal markers: END */
308 #define GAIA_NET_END		0x87
309 /** VirtualNetwork internal markers: HEADER */
310 #define GAIA_NET_HEADER		0xc0
311 /** VirtualNetwork internal markers: CODE */
312 #define GAIA_NET_CODE		0xa6
313 /** VirtualNetwork internal markers: ID */
314 #define GAIA_NET_ID		0xb5
315 /** VirtualNetwork internal markers: NODE */
316 #define GAIA_NET_NODE		0xde
317 /** VirtualNetwork internal markers: ARC */
318 #define GAIA_NET_ARC		0x54
319 /** VirtualNetwork internal markers: TABLE */
320 #define GAIA_NET_TABLE		0xa0
321 /** VirtualNetwork internal markers: FROM */
322 #define GAIA_NET_FROM		0xa1
323 /** VirtualNetwork internal markers: TO */
324 #define GAIA_NET_TO		0xa2
325 /** VirtualNetwork internal markers: GEOM */
326 #define GAIA_NET_GEOM		0xa3
327 /** VirtualNetwork internal markers: NAME */
328 #define GAIA_NET_NAME		0xa4
329 /** VirtualNetwork internal markers: COEFF */
330 #define GAIA_NET_A_STAR_COEFF	0xa5
331 /** VirtualNetwork internal markers: BLOCK */
332 #define GAIA_NET_BLOCK		0xed
333 
334 /* constants used for Coordinate Dimensions */
335 /** Coordinate Dimensions: XY */
336 #define GAIA_XY		0x00
337 /** Coordinate Dimensions: XYZ */
338 #define GAIA_XY_Z	0x01
339 /** Coordinate Dimensions: XYM */
340 #define GAIA_XY_M	0x02
341 /** Coordinate Dimensions: XYZM */
342 #define GAIA_XY_Z_M	0x03
343 
344 /* constants used for length unit conversion */
345 /** Length unit conversion: Kilometer */
346 #define GAIA_KM		0
347 /** Length unit conversion: Meter */
348 #define GAIA_M		1
349 /** Length unit conversion: Decimeter */
350 #define GAIA_DM		2
351 /** Length unit conversion: Centimeter */
352 #define GAIA_CM		3
353 /** Length unit conversion: Millimeter */
354 #define GAIA_MM		4
355 /** Length unit conversion: International Nautical Mile */
356 #define GAIA_KMI	5
357 /** Length unit conversion: Inch */
358 #define GAIA_IN		6
359 /** Length unit conversion: Feet */
360 #define GAIA_FT		7
361 /** Length unit conversion: Yard */
362 #define GAIA_YD		8
363 /** Length unit conversion: Mile */
364 #define GAIA_MI		9
365 /** Length unit conversion: Fathom */
366 #define GAIA_FATH	10
367 /** Length unit conversion: Chain */
368 #define GAIA_CH		11
369 /** Length unit conversion: Link */
370 #define GAIA_LINK	12
371 /** Length unit conversion: US Inch */
372 #define GAIA_US_IN	13
373 /** Length unit conversion: US Feet */
374 #define GAIA_US_FT	14
375 /** Length unit conversion: US Yard */
376 #define GAIA_US_YD	15
377 /** Length unit conversion: US Chain */
378 #define GAIA_US_CH	16
379 /** Length unit conversion: US Mile */
380 #define GAIA_US_MI	17
381 /** Length unit conversion: Indian Yard */
382 #define GAIA_IND_YD	18
383 /** Length unit conversion: Indian Feet */
384 #define GAIA_IND_FT	19
385 /** Length unit conversion: Indian Chain */
386 #define GAIA_IND_CH	20
387 /** Length unit conversion: MIN */
388 #define GAIA_MIN_UNIT	GAIA_KM
389 /** Length unit conversion: MAX */
390 #define GAIA_MAX_UNIT	GAIA_IND_CH
391 
392 /* constants used for SHAPES */
393 /** SHP shape: unknown */
394 #define GAIA_SHP_NULL		0
395 /** SHP shape: POINT */
396 #define GAIA_SHP_POINT		1
397 /** SHP shape: POLYLINE */
398 #define GAIA_SHP_POLYLINE	3
399 /** SHP shape: POLYGON */
400 #define GAIA_SHP_POLYGON	5
401 /** SHP shape: MULTIPOINT */
402 #define GAIA_SHP_MULTIPOINT	8
403 /** SHP shape: POINT Z */
404 #define GAIA_SHP_POINTZ		11
405 /** SHP shape: POLYLINE Z */
406 #define GAIA_SHP_POLYLINEZ	13
407 /** SHP shape: POLYGON Z */
408 #define GAIA_SHP_POLYGONZ	15
409 /** SHP shape: MULTIPOINT Z */
410 #define GAIA_SHP_MULTIPOINTZ	18
411 /** SHP shape: POINT M */
412 #define GAIA_SHP_POINTM		21
413 /** SHP shape: POLYLINE M */
414 #define GAIA_SHP_POLYLINEM	23
415 /** SHP shape: POLYGON M */
416 #define GAIA_SHP_POLYGONM	25
417 /** SHP shape: MULTIPOINT M */
418 #define GAIA_SHP_MULTIPOINTM	28
419 
420 /* constants used for Clone Special modes */
421 /** Clone Special Mode: Same Order as input */
422 #define GAIA_SAME_ORDER		0
423 /** Clone Special Mode: Reversed Order */
424 #define GAIA_REVERSE_ORDER	-1
425 /** Clone Special Mode: apply Clockwise Rule to Polygon Rings */
426 #define GAIA_CW_ORDER		-2
427 /** Clone Special Mode: apply Counter-Clockwise Rule to Polygon Rings */
428 #define GAIA_CCW_ORDER		-3
429 
430 /* constants used for DBF column-names case */
431 /** Leave all DBF column-names as they are */
432 #define GAIA_DBF_COLNAME_CASE_IGNORE	0
433 /** Convert all DBF column names to LowerCase */
434 #define GAIA_DBF_COLNAME_LOWERCASE	1
435 /** Convert all DBF column names to UpperCase */
436 #define GAIA_DBF_COLNAME_UPPERCASE	2
437 
438 /* constants used for PROJ.6 WKT styles */
439 /** WKT style is ISO-2018 */
440 #define GAIA_PROJ_WKT_ISO_2018	1
441 /** WKT style is ISO-2015 */
442 #define GAIA_PROJ_WKT_ISO_2015	2
443 /** WKT style is GDAL */
444 #define GAIA_PROJ_WKT_GDAL	3
445 /** WKT style is ESRI */
446 #define GAIA_PROJ_WKT_ESRI	4
447 
448 /* macros */
449 /**
450  macro extracting XY coordinates
451 
452  \param xy pointer [const void *] to COORD mem-array
453  \param v [int] point index [first point has index 0]
454  \param x [double *] X coordinate
455  \param y [double *] Y coordinate
456 
457  \sa gaiaLineGetPoint, gaiaRingGetPoint
458 
459  \note using this macro on behalf of COORDs not of [XY] dims may cause serious
460  problems
461  */
462 #define gaiaGetPoint(xy,v,x,y)	\
463 				{*x = xy[(v) * 2]; \
464 				 *y = xy[(v) * 2 + 1];}
465 
466 /**
467  macro setting XY coordinates
468 
469  \param xy pointer [const void *] to COORD mem-array
470  \param v [int] point index [first point has index 0]
471  \param x [double] X coordinate
472  \param y [double] Y coordinate
473 
474  \sa gaiaLineSetPoint, gaiaRingSetPoint
475 
476  \note using this macro on behalf on COORDs not of [XY] dims may cause
477  serious problems
478  */
479 #define gaiaSetPoint(xy,v,x,y)	\
480 				{xy[(v) * 2] = x; \
481 				 xy[(v) * 2 + 1] = y;}
482 
483 /**
484  macro extracting XYZ coordinates
485 
486  \param xyz pointer [const void *] to COORD mem-array
487  \param v [int] point index [first point has index 0]
488  \param x [double *] X coordinate
489  \param y [double *] Y coordinate
490  \param z [double *] Z coordinate
491 
492  \sa gaiaLineGetPoint, gaiaRingGetPoint
493 
494  \note using this macro on behalf of COORDs not of [XYZ] dims may cause serious
495  problems
496  */
497 #define gaiaGetPointXYZ(xyz,v,x,y,z)	\
498 				{*x = xyz[(v) * 3]; \
499 				 *y = xyz[(v) * 3 + 1]; \
500 				 *z = xyz[(v) * 3 + 2];}
501 
502 /**
503  macro setting XYZ coordinates
504 
505  \param xyz pointer [const void *] to COORD mem-array
506  \param v [int] point index [first point has index 0]
507  \param x [double] X coordinate
508  \param y [double] Y coordinate
509  \param z [double] Z coordinate
510 
511  \sa gaiaLineSetPoint, gaiaRingSetPoint
512 
513  \note using this macro on behalf on COORDs not of [XYZ] dims may cause
514  serious problems
515  */
516 #define gaiaSetPointXYZ(xyz,v,x,y,z)	\
517 				{xyz[(v) * 3] = x; \
518 				 xyz[(v) * 3 + 1] = y; \
519 				 xyz[(v) * 3 + 2] = z;}
520 
521 /**
522  macro extracting XYM coordinates
523 
524  \param xym pointer [const void *] to COORD mem-array
525  \param v [int] point index [first point has index 0]
526  \param x [double *] X coordinate
527  \param y [double *] Y coordinate
528  \param m [double *] M measure
529 
530  \sa gaiaLineGetPoint, gaiaRingGetPoint
531 
532  \note using this macro on behalf of COORDs not of [XYM] dims may cause serious
533  problems
534  */
535 #define gaiaGetPointXYM(xym,v,x,y,m)	\
536 				{*x = xym[(v) * 3]; \
537 				 *y = xym[(v) * 3 + 1]; \
538 				 *m = xym[(v) * 3 + 2];}
539 
540 /**
541  macro setting XYM coordinates
542 
543  \param xym pointer [const void *] to COORD mem-array
544  \param v [int] point index [first point has index 0]
545  \param x [double] X coordinate
546  \param y [double] Y coordinate
547  \param m [double] M measure
548 
549  \sa gaiaLineSetPoint, gaiaRingSetPoint
550 
551  \note using this macro on behalf on COORDs not of [XYM] dims may cause
552  serious problems
553  */
554 #define gaiaSetPointXYM(xym,v,x,y,m)	\
555 				{xym[(v) * 3] = x; \
556 				 xym[(v) * 3 + 1] = y; \
557 				 xym[(v) * 3 + 2] = m;}
558 
559 /**
560  macro extracting XYZM coordinates
561 
562  \param xyzm pointer [const void *] to COORD mem-array
563  \param v [int] point index [first point has index 0]
564  \param x [double *] X coordinate
565  \param y [double *] Y coordinate
566  \param z [double *] Z coordinate
567  \param m [double *] M measure
568 
569  \sa gaiaLineGetPoint, gaiaRingGetPoint
570 
571  \note using this macro on behalf of COORDs not of [XYZM] dims may cause serious
572  problems
573  */
574 #define gaiaGetPointXYZM(xyzm,v,x,y,z,m)	\
575 				{*x = xyzm[(v) * 4]; \
576 				 *y = xyzm[(v) * 4 + 1]; \
577 				 *z = xyzm[(v) * 4 + 2]; \
578 				 *m = xyzm[(v) * 4 + 3];}
579 
580 /**
581  macro setting XYZM coordinates
582 
583  \param xyzm pointer [const void *] to COORD mem-array
584  \param v [int] point index [first point has index 0]
585  \param x [double] X coordinate
586  \param y [double] Y coordinate
587  \param z [double] Z coordinate
588  \param m [double] M measure
589 
590  \sa gaiaLineSetPoint, gaiaRingSetPoint
591 
592  \note using this macro on behalf on COORDs not of [XYZM] dims may cause
593  serious problems
594  */
595 #define gaiaSetPointXYZM(xyzm,v,x,y,z,m)	\
596 				{xyzm[(v) * 4] = x; \
597 				 xyzm[(v) * 4 + 1] = y; \
598 				 xyzm[(v) * 4 + 2] = z; \
599 				 xyzm[(v) * 4 + 3] = m;}
600 
601 
602 #ifdef __cplusplus
603 }
604 #endif
605 
606 #endif				/* _GG_CONST_H */
607