Beispiel #1
0
        private static bool MustIntersect(IntersectionConstraint constraint,
                                          out Dimension maximumDimension)
        {
            switch (constraint)
            {
            case IntersectionConstraint.MustNotIntersect:
            case IntersectionConstraint.NotChecked:
                maximumDimension = Dimension.Any;
                return(false);

            case IntersectionConstraint.MustIntersect:
                maximumDimension = Dimension.Any;
                return(true);

            case IntersectionConstraint.MustIntersectWithMaxDimension0:
                maximumDimension = Dimension.Dim0;
                return(true);

            case IntersectionConstraint.MustIntersectWithMaxDimension1:
                maximumDimension = Dimension.Dim1;
                return(true);

            case IntersectionConstraint.MustIntersectWithMaxDimension2:
                maximumDimension = Dimension.Dim2;
                return(true);

            default:
                throw new ArgumentOutOfRangeException(nameof(constraint));
            }
        }
Beispiel #2
0
        private static IntersectionConstraint[,] CreateMatrix(string matrixString)
        {
            var matrix = new IntersectionConstraint[3, 3];

            // first row
            matrix[_interior, _interior] = GetConstraint(matrixString[0]);
            matrix[_interior, _boundary] = GetConstraint(matrixString[1]);
            matrix[_interior, _exterior] = GetConstraint(matrixString[2]);

            // second row
            matrix[_boundary, _interior] = GetConstraint(matrixString[3]);
            matrix[_boundary, _boundary] = GetConstraint(matrixString[4]);
            matrix[_boundary, _exterior] = GetConstraint(matrixString[5]);

            // third row
            matrix[_exterior, _interior] = GetConstraint(matrixString[6]);
            matrix[_exterior, _boundary] = GetConstraint(matrixString[7]);
            matrix[_exterior, _exterior] = GetConstraint(matrixString[8]);

            return(matrix);
        }
Beispiel #3
0
        private static bool MustIntersect(IntersectionConstraint constraint)
        {
            Dimension dimension;

            return(MustIntersect(constraint, out dimension));
        }