00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef QGIS_H
00020 #define QGIS_H
00021 #include <QEvent>
00022 #include <QString>
00023 #include <cfloat>
00024
00028 class CORE_EXPORT QGis
00029 {
00030 public:
00031
00032
00033
00034 static const char* QGIS_VERSION;
00035
00036 static const int QGIS_VERSION_INT;
00037
00038 static const char* QGIS_RELEASE_NAME;
00039
00040 static const char* QGIS_SVN_VERSION;
00041
00042
00043
00044
00046
00047 enum WkbType
00048 {
00049 WKBUnknown = 0,
00050 WKBPoint = 1,
00051 WKBLineString,
00052 WKBPolygon,
00053 WKBMultiPoint,
00054 WKBMultiLineString,
00055 WKBMultiPolygon,
00056 WKBNoGeometry = 100,
00057 WKBPoint25D = 0x80000001,
00058 WKBLineString25D,
00059 WKBPolygon25D,
00060 WKBMultiPoint25D,
00061 WKBMultiLineString25D,
00062 WKBMultiPolygon25D,
00063 };
00064 enum GeometryType
00065 {
00066 Point,
00067 Line,
00068 Polygon,
00069 UnknownGeometry,
00070 NoGeometry
00071 };
00072
00073
00074 static const char *qgisVectorGeometryType[];
00075
00077 static const char *qgisFeatureTypes[];
00078
00082 enum UnitType
00083 {
00084 Meters = 0,
00085 Feet = 1,
00086 Degrees = 2,
00087 DecimalDegrees = 2,
00088 DegreesMinutesSeconds = 4,
00089 DegreesDecimalMinutes = 5,
00090 UnknownUnit = 3
00091 } ;
00092
00094 enum UserEvent
00095 {
00096
00097
00099 ProviderExtentCalcEvent = ( QEvent::User + 1 ),
00100
00102 ProviderCountCalcEvent
00103 };
00104
00105 static const double DEFAULT_IDENTIFY_RADIUS;
00106 };
00107
00108
00109
00110
00111
00112 inline void ( *cast_to_fptr( void *p ) )()
00113 {
00114 union
00115 {
00116 void *p;
00117 void ( *f )();
00118 } u;
00119
00120 u.p = p;
00121 return u.f;
00122 }
00123
00124
00125
00126
00127 inline bool doubleNear( double a, double b, double epsilon = 4 * DBL_EPSILON )
00128 {
00129 const double diff = a - b;
00130 return diff > -epsilon && diff <= epsilon;
00131 }
00132
00134 const QString GEOWkt =
00135 "GEOGCS[\"WGS 84\", "
00136 " DATUM[\"WGS_1984\", "
00137 " SPHEROID[\"WGS 84\",6378137,298.257223563, "
00138 " AUTHORITY[\"EPSG\",7030]], "
00139 " TOWGS84[0,0,0,0,0,0,0], "
00140 " AUTHORITY[\"EPSG\",6326]], "
00141 " PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",8901]], "
00142 " UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",9108]], "
00143 " AXIS[\"Lat\",NORTH], "
00144 " AXIS[\"Long\",EAST], "
00145 " AUTHORITY[\"EPSG\",4326]]";
00147 const QString GEOPROJ4 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
00149 const long GEOSRID = 4326;
00151 const long GEOCRS_ID = 3452;
00153 const long GEO_EPSG_CRS_ID = 4326;
00155 const QString GEO_EPSG_CRS_AUTHID = "EPSG:4326";
00157 const int PROJ_PREFIX_LEN = 6;
00159 const int ELLPS_PREFIX_LEN = 7;
00161 const int LAT_PREFIX_LEN = 7;
00164 const int USER_CRS_START_ID = 100000;
00165
00166
00167
00168
00169
00171 const double MINIMUM_POINT_SIZE = 0.1;
00173 const double DEFAULT_POINT_SIZE = 2.0;
00174 const double DEFAULT_LINE_WIDTH = 0.26;
00175
00176
00177 #ifndef QGISEXTERN
00178 #ifdef WIN32
00179 # define QGISEXTERN extern "C" __declspec( dllexport )
00180 # ifdef _MSC_VER
00181
00182 # pragma warning(disable:4190)
00183 # endif
00184 #else
00185 # define QGISEXTERN extern "C"
00186 #endif
00187 #endif
00188
00189 #endif