Пример #1
0
 public NeighborsSegment(
     PolygonSegment polygonSegment,
     TypeNeighbor typeNeighbor
     ) :
     base(polygonSegment.FrontPoint, polygonSegment.MediumPoint, polygonSegment.BackPoint)
 {
     this.TypeNeighbor = typeNeighbor;
 }
Пример #2
0
 public NeighborsSegment(
     AcGe.Point2d frontPoint,
     AcGe.Point2d mediumPoint,
     AcGe.Point2d backPoint,
     TypeNeighbor typeNeighbor
     ) :
     base(frontPoint, mediumPoint, backPoint)
 {
     this.TypeNeighbor = typeNeighbor;
 }
Пример #3
0
        public List <NeighborsSegment> GetCommonNeighborSegmentsByType(LandPolygon polygonNeighbor, TypeNeighbor typeNeighbor)
        {
            List <NeighborsSegment> neighborSegments = this.GetCommonNeighborSegments(polygonNeighbor);

            if (!this.IsAllPointsParcelCommonNeighbor(polygonNeighbor))
            {
                neighborSegments = ServiceNeighborsSegments.JoinAdjoiningSegments(neighborSegments, false);
            }

            return(neighborSegments.FindAll
                   (
                       delegate(NeighborsSegment segment)
            {
                return segment.TypeNeighbor == typeNeighbor;
            }
                   ));
        }
Пример #4
0
        public NeighborsSegment JoinAdjoiningSegmentNeighbor(NeighborsSegment segment)
        {
            NeighborsSegment newSegment = this;
            TypeNeighbor     type       = TypeNeighbor.Undefined;

            if (
                (this.TypeNeighbor == TypeNeighbor.Starting && segment.TypeNeighbor == TypeNeighbor.Ending) ||
                (this.TypeNeighbor == TypeNeighbor.Ending && segment.TypeNeighbor == TypeNeighbor.Starting)
                )
            {
                type = TypeNeighbor.Intermediate;
            }
            else if (this.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Outside && segment.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Outside)
            {
                type = TypeNeighbor.OnlyOnePoint_Outside;
            }
            else if (this.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Inside && segment.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Inside)
            {
                type = TypeNeighbor.OnlyOnePoint_Inside;
            }
            else if (
                (this.TypeNeighbor == TypeNeighbor.Starting && segment.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Outside) ||
                (this.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Outside && segment.TypeNeighbor == TypeNeighbor.Starting) ||
                (this.TypeNeighbor == TypeNeighbor.Starting && segment.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Inside) ||
                (this.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Inside && segment.TypeNeighbor == TypeNeighbor.Starting)
                )
            {
                type = TypeNeighbor.Starting;
            }
            else if (
                (this.TypeNeighbor == TypeNeighbor.Ending && segment.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Outside) ||
                (this.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Outside && segment.TypeNeighbor == TypeNeighbor.Ending) ||
                (this.TypeNeighbor == TypeNeighbor.Ending && segment.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Inside) ||
                (this.TypeNeighbor == TypeNeighbor.OnlyOnePoint_Inside && segment.TypeNeighbor == TypeNeighbor.Ending)
                )
            {
                type = TypeNeighbor.Ending;
            }


            if (
                this.CompareSegments(segment).FrontPoint == CoincidencePoints.Coincides_With_Nothing &&
                this.CompareSegments(segment).MediumPoint == CoincidencePoints.Coincides_With_Medium &&
                this.CompareSegments(segment).BackPoint == CoincidencePoints.Coincides_With_Front
                )
            {
                newSegment.BackPoint = segment.BackPoint;
            }
            else if (
                this.CompareSegments(segment).FrontPoint == CoincidencePoints.Coincides_With_Back &&
                this.CompareSegments(segment).MediumPoint == CoincidencePoints.Coincides_With_Medium &&
                this.CompareSegments(segment).BackPoint == CoincidencePoints.Coincides_With_Nothing
                )
            {
                newSegment.FrontPoint = segment.FrontPoint;
            }
            else
            {
                return(null);
            }

            newSegment.TypeNeighbor = type;

            return(newSegment);
        }