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 <string>
00024
00025 #include <geos/inline.h>
00026
00027 namespace geos {
00028 namespace geom {
00029
00051 class IntersectionMatrix {
00052
00053 public:
00054
00061 IntersectionMatrix();
00062
00071 IntersectionMatrix(const std::string& elements);
00072
00080 IntersectionMatrix(const IntersectionMatrix &other);
00081
00092 bool matches(const std::string& requiredDimensionSymbols) const;
00093
00106 static bool matches(int actualDimensionValue,
00107 char requiredDimensionSymbol);
00108
00121 static bool matches(const std::string& actualDimensionSymbols,
00122 const std::string& requiredDimensionSymbols);
00123
00134 void add(IntersectionMatrix* other);
00135
00146 void set(int row, int column, int dimensionValue);
00147
00156 void set(const std::string& dimensionSymbols);
00157
00170 void setAtLeast(int row, int column, int minimumDimensionValue);
00171
00192 void setAtLeastIfValid(int row, int column, int minimumDimensionValue);
00193
00204 void setAtLeast(std::string minimumDimensionSymbols);
00205
00214 void setAll(int dimensionValue);
00215
00229 int get(int row, int column) const;
00230
00237 bool isDisjoint() const;
00238
00245 bool isIntersects() const;
00246
00259 bool isTouches(int dimensionOfGeometryA, int dimensionOfGeometryB)
00260 const;
00261
00279 bool isCrosses(int dimensionOfGeometryA, int dimensionOfGeometryB)
00280 const;
00281
00287 bool isWithin() const;
00288
00294 bool isContains() const;
00295
00305 bool isEquals(int dimensionOfGeometryA, int dimensionOfGeometryB)
00306 const;
00307
00321 bool isOverlaps(int dimensionOfGeometryA, int dimensionOfGeometryB)
00322 const;
00323
00332 bool isCovers() const;
00333
00334
00343 bool isCoveredBy() const;
00344
00353 IntersectionMatrix* transpose();
00354
00362 std::string toString() const;
00363
00364 private:
00365
00366 static const int firstDim;
00367
00368 static const int secondDim;
00369
00370
00371 int matrix[3][3];
00372
00373 };
00374
00375 std::ostream& operator<< (std::ostream&os, const IntersectionMatrix& im);
00376
00377
00378 }
00379 }
00380
00381
00382
00383
00384
00385 #endif // ndef GEOS_GEOM_INTERSECTIONMATRIX_H
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407