Esempio n. 1
0
            public void AdaptAssymetry(
                Dictionary <FeaturePoint, List <NeighboredSegmentsSubpart> > splittedParts)
            {
                foreach (KeyValuePair <FeaturePoint, List <NeighboredSegmentsSubpart> > pair in
                         splittedParts)
                {
                    var              cap          = new RoundCap();
                    FeaturePoint     p            = pair.Key;
                    SideRowsDistance rowsDistance =
                        _nearProvider.GetRowsDistance(p.Feature, p.TableIndex);
                    List <NeighboredSegmentsSubpart> splitted = pair.Value;
                    foreach (NeighboredSegmentsSubpart part in splitted)
                    {
                        foreach (SegmentParts segmentParts in part.SegmentNeighbors.Values)
                        {
                            foreach (SegmentPart segmentPart in segmentParts)
                            {
                                SegmentHull hull = CreateSegmentHull(
                                    (SegmentProxy)Assert.NotNull(
                                        segmentPart.SegmentProxy, "segmentproxy is null"),
                                    rowsDistance, cap, cap);

                                var segNbPart = (SegmentPartWithNeighbor)segmentPart;
                                AdaptAssymetry(rowsDistance, hull, segNbPart, cap);
                            }
                        }
                    }
                }

                Drop0LengthParts(EnumSegmentParts(splittedParts.Values));
            }
Esempio n. 2
0
            private void AdaptAssymetry([NotNull] SideRowsDistance rowsDistance,
                                        [NotNull] SegmentHull hull,
                                        [NotNull] SegmentPartWithNeighbor part,
                                        [NotNull] RoundCap cap)
            {
                SegmentHull nbHull = CreateNeighborSegmentHull(
                    (SegmentProxy)part.NeighborProxy, rowsDistance,
                    part.NeighborFeature,
                    part.NeighborTableIndex, cap, cap);

                if (hull.LeftOffset == nbHull.RightOffset &&
                    nbHull.LeftOffset == nbHull.RightOffset)
                {
                    return;
                }

                RecalcPart(part, hull, nbHull);
            }