Exemplo n.º 1
0
        private int ResolveRows([NotNull] List <DirectedRow> connectedRows)
        {
            _errorCount = 0;
            // Errors are also produced in the eventhandler RingGeometryCompleted --> member variable

            int lineCount = connectedRows.Count;

            if (lineCount == 1)
            {
                const string description = "Dangling line";

                _errorCount += ReportError(description, connectedRows[0].FromPoint,
                                           Codes[Code.DanglingLine], null,
                                           connectedRows[0].Row.Row);
            }

            connectedRows.Sort(new DirectedRow.RowByLineAngleComparer());

            DirectedRow row0 = connectedRows[lineCount - 1];

            foreach (DirectedRow row1 in connectedRows)
            {
                _grower.Add(row0.Reverse(), row1);
                row0 = row1;
            }

            return(_errorCount);
        }
Exemplo n.º 2
0
        private int ResolveRows(List <DirectedRow> connectedRows)
        {
            var errorCount = 0;

            int lineCount = connectedRows.Count;

            if (lineCount == 1)
            {
                const string description = "Dangling line";
                errorCount += ReportError(description, connectedRows[0].FromPoint,
                                          Codes[Code.DanglingLine],
                                          TestUtils.GetShapeFieldName(
                                              connectedRows[0].Row.Row),
                                          connectedRows[0].Row.Row);
            }

            connectedRows.Sort(new DirectedRow.RowByLineAngleComparer());

            DirectedRow connectedRow = connectedRows[lineCount - 1];
            var         row0         = new DirectedRow(connectedRow.TopologicalLine,
                                                       !connectedRow.IsBackward);

            foreach (DirectedRow row1 in connectedRows)
            {
                _grower.Add(row0,
                            new DirectedRow(row1.TopologicalLine,
                                            row1.IsBackward));
                row0 = new DirectedRow(row1.TopologicalLine,
                                       !row1.IsBackward);
            }

            return(errorCount);
        }