isOverlaps method

bool isOverlaps(
  1. int dimensionOfGeometryA,
  2. int dimensionOfGeometryB
)

Returns true if this IntersectionMatrix is

  • T*T***T** (for two points or two surfaces)
  • 1*T***T** (for two curves)
.

@param dimensionOfGeometryA the dimension of the first Geometry @param dimensionOfGeometryB the dimension of the second Geometry @return true if the two Geometrys related by this IntersectionMatrix overlap. For this function to return true, the Geometrys must be two points, two curves or two surfaces.

Implementation

bool isOverlaps(int dimensionOfGeometryA, int dimensionOfGeometryB) {
  if ((dimensionOfGeometryA == Dimension.P &&
          dimensionOfGeometryB == Dimension.P) ||
      (dimensionOfGeometryA == Dimension.A &&
          dimensionOfGeometryB == Dimension.A)) {
    return isTrue(matrix[Location.INTERIOR][Location.INTERIOR]) &&
        isTrue(matrix[Location.INTERIOR][Location.EXTERIOR]) &&
        isTrue(matrix[Location.EXTERIOR][Location.INTERIOR]);
  }
  if (dimensionOfGeometryA == Dimension.L &&
      dimensionOfGeometryB == Dimension.L) {
    return matrix[Location.INTERIOR][Location.INTERIOR] == 1 &&
        isTrue(matrix[Location.INTERIOR][Location.EXTERIOR]) &&
        isTrue(matrix[Location.EXTERIOR][Location.INTERIOR]);
  }
  return false;
}