00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_GEOM_INTERSECTIONMATRIX_H
00021 #define GEOS_GEOM_INTERSECTIONMATRIX_H
00022
00023 #include <geos/export.h>
00024 #include <string>
00025
00026 #include <geos/inline.h>
00027
00028 namespace geos {
00029 namespace geom {
00030
00052 class GEOS_DLL IntersectionMatrix {
00053
00054 public:
00055
00062 IntersectionMatrix();
00063
00072 IntersectionMatrix(const std::string& elements);
00073
00081 IntersectionMatrix(const IntersectionMatrix &other);
00082
00093 bool matches(const std::string& requiredDimensionSymbols) const;
00094
00107 static bool matches(int actualDimensionValue,
00108 char requiredDimensionSymbol);
00109
00122 static bool matches(const std::string& actualDimensionSymbols,
00123 const std::string& requiredDimensionSymbols);
00124
00135 void add(IntersectionMatrix* other);
00136
00147 void set(int row, int column, int dimensionValue);
00148
00157 void set(const std::string& dimensionSymbols);
00158
00171 void setAtLeast(int row, int column, int minimumDimensionValue);
00172
00193 void setAtLeastIfValid(int row, int column, int minimumDimensionValue);
00194
00205 void setAtLeast(std::string minimumDimensionSymbols);
00206
00215 void setAll(int dimensionValue);
00216
00230 int get(int row, int column) const;
00231
00238 bool isDisjoint() const;
00239
00246 bool isIntersects() const;
00247
00260 bool isTouches(int dimensionOfGeometryA, int dimensionOfGeometryB)
00261 const;
00262
00280 bool isCrosses(int dimensionOfGeometryA, int dimensionOfGeometryB)
00281 const;
00282
00288 bool isWithin() const;
00289
00295 bool isContains() const;
00296
00306 bool isEquals(int dimensionOfGeometryA, int dimensionOfGeometryB)
00307 const;
00308
00322 bool isOverlaps(int dimensionOfGeometryA, int dimensionOfGeometryB)
00323 const;
00324
00333 bool isCovers() const;
00334
00335
00344 bool isCoveredBy() const;
00345
00354 IntersectionMatrix* transpose();
00355
00363 std::string toString() const;
00364
00365 private:
00366
00367 static const int firstDim;
00368
00369 static const int secondDim;
00370
00371
00372 int matrix[3][3];
00373
00374 };
00375
00376 std::ostream& operator<< (std::ostream&os, const IntersectionMatrix& im);
00377
00378
00379 }
00380 }
00381
00382
00383
00384
00385
00386 #endif // ndef GEOS_GEOM_INTERSECTIONMATRIX_H
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408