SpatiaLite  3.0.0-stable
src/headers/spatialite/gg_mbr.h
Go to the documentation of this file.
00001 /*
00002  gg_mbr.h -- Gaia common support for geometries: MBR functions
00003   
00004  version 3.0, 2011 July 20
00005 
00006  Author: Sandro Furieri a.furieri@lqt.it
00007 
00008  ------------------------------------------------------------------------------
00009  
00010  Version: MPL 1.1/GPL 2.0/LGPL 2.1
00011  
00012  The contents of this file are subject to the Mozilla Public License Version
00013  1.1 (the "License"); you may not use this file except in compliance with
00014  the License. You may obtain a copy of the License at
00015  http://www.mozilla.org/MPL/
00016  
00017 Software distributed under the License is distributed on an "AS IS" basis,
00018 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00019 for the specific language governing rights and limitations under the
00020 License.
00021 
00022 The Original Code is the SpatiaLite library
00023 
00024 The Initial Developer of the Original Code is Alessandro Furieri
00025  
00026 Portions created by the Initial Developer are Copyright (C) 2008
00027 the Initial Developer. All Rights Reserved.
00028 
00029 Contributor(s):
00030 
00031 
00032 Alternatively, the contents of this file may be used under the terms of
00033 either the GNU General Public License Version 2 or later (the "GPL"), or
00034 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00035 in which case the provisions of the GPL or the LGPL are applicable instead
00036 of those above. If you wish to allow use of your version of this file only
00037 under the terms of either the GPL or the LGPL, and not to allow others to
00038 use your version of this file under the terms of the MPL, indicate your
00039 decision by deleting the provisions above and replace them with the notice
00040 and other provisions required by the GPL or the LGPL. If you do not delete
00041 the provisions above, a recipient may use your version of this file under
00042 the terms of any one of the MPL, the GPL or the LGPL.
00043  
00044 */
00045 
00046 
00053 #ifndef _GG_MBR_H
00054 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00055 #define _GG_MBR_H
00056 #endif
00057 
00058 #ifdef __cplusplus
00059 extern "C"
00060 {
00061 #endif
00062 
00063 /* function prototypes */
00064 
00070     GAIAGEO_DECLARE void gaiaMbrLinestring (gaiaLinestringPtr line);
00071 
00077     GAIAGEO_DECLARE void gaiaMbrRing (gaiaRingPtr rng);
00078 
00084     GAIAGEO_DECLARE void gaiaMbrPolygon (gaiaPolygonPtr polyg);
00085 
00091     GAIAGEO_DECLARE void gaiaMbrGeometry (gaiaGeomCollPtr geom);
00092 
00104     GAIAGEO_DECLARE int gaiaGetMbrMinX (const unsigned char *blob,
00105                                         unsigned int size, double *minx);
00106 
00118     GAIAGEO_DECLARE int gaiaGetMbrMaxX (const unsigned char *blob,
00119                                         unsigned int size, double *maxx);
00120 
00132     GAIAGEO_DECLARE int gaiaGetMbrMinY (const unsigned char *blob,
00133                                         unsigned int size, double *miny);
00134 
00146     GAIAGEO_DECLARE int gaiaGetMbrMaxY (const unsigned char *blob,
00147                                         unsigned int size, double *maxy);
00148 
00166     GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobMbr (const unsigned
00167                                                                char *blob,
00168                                                                unsigned int
00169                                                                size);
00170 
00182     GAIAGEO_DECLARE int gaiaMbrsContains (gaiaGeomCollPtr mbr1,
00183                                           gaiaGeomCollPtr mbr2);
00184 
00196     GAIAGEO_DECLARE int gaiaMbrsDisjoint (gaiaGeomCollPtr mbr1,
00197                                           gaiaGeomCollPtr mbr2);
00198 
00210     GAIAGEO_DECLARE int gaiaMbrsEqual (gaiaGeomCollPtr mbr1,
00211                                        gaiaGeomCollPtr mbr2);
00212 
00224     GAIAGEO_DECLARE int gaiaMbrsIntersects (gaiaGeomCollPtr mbr1,
00225                                             gaiaGeomCollPtr mbr2);
00226 
00238     GAIAGEO_DECLARE int gaiaMbrsOverlaps (gaiaGeomCollPtr mbr1,
00239                                           gaiaGeomCollPtr mbr2);
00240 
00252     GAIAGEO_DECLARE int gaiaMbrsTouches (gaiaGeomCollPtr mbr1,
00253                                          gaiaGeomCollPtr mbr2);
00254 
00266     GAIAGEO_DECLARE int gaiaMbrsWithin (gaiaGeomCollPtr mbr1,
00267                                         gaiaGeomCollPtr mbr2);
00268 
00289     GAIAGEO_DECLARE void gaiaBuildMbr (double x1, double y1, double x2,
00290                                        double y2, int srid,
00291                                        unsigned char **result, int *size);
00292 
00310     GAIAGEO_DECLARE void gaiaBuildCircleMbr (double x, double y, double radius,
00311                                              int srid, unsigned char **result,
00312                                              int *size);
00313 
00337     GAIAGEO_DECLARE void gaiaBuildFilterMbr (double x1, double y1, double x2,
00338                                              double y2, int mode,
00339                                              unsigned char **result, int *size);
00340 
00358     GAIAGEO_DECLARE int gaiaParseFilterMbr (unsigned char *result, int size,
00359                                             double *minx, double *miny,
00360                                             double *maxx, double *maxy,
00361                                             int *mode);
00362 
00372     GAIAGEO_DECLARE void gaiaZRangeLinestring (gaiaLinestringPtr line,
00373                                                double *min, double *max);
00374 
00384     GAIAGEO_DECLARE void gaiaZRangeRing (gaiaRingPtr rng, double *min,
00385                                          double *max);
00386 
00396     GAIAGEO_DECLARE void gaiaZRangePolygon (gaiaPolygonPtr polyg, double *min,
00397                                             double *max);
00398 
00408     GAIAGEO_DECLARE void gaiaZRangeGeometry (gaiaGeomCollPtr geom, double *min,
00409                                              double *max);
00410 
00420     GAIAGEO_DECLARE void gaiaMRangeLinestring (gaiaLinestringPtr line,
00421                                                double *min, double *max);
00422 
00432     GAIAGEO_DECLARE void gaiaMRangeRing (gaiaRingPtr rng, double *min,
00433                                          double *max);
00434 
00444     GAIAGEO_DECLARE void gaiaMRangePolygon (gaiaPolygonPtr polyg, double *min,
00445                                             double *max);
00446 
00456     GAIAGEO_DECLARE void gaiaMRangeGeometry (gaiaGeomCollPtr geom, double *min,
00457                                              double *max);
00458 
00459 
00460 #ifdef __cplusplus
00461 }
00462 #endif
00463 
00464 #endif                          /* _GG_MBR_H */
 All Data Structures Files Functions Variables Typedefs Defines