public NeighborsSegment( PolygonSegment polygonSegment, TypeNeighbor typeNeighbor ) : base(polygonSegment.FrontPoint, polygonSegment.MediumPoint, polygonSegment.BackPoint) { this.TypeNeighbor = typeNeighbor; }
public NeighborsSegment( AcGe.Point2d frontPoint, AcGe.Point2d mediumPoint, AcGe.Point2d backPoint, TypeNeighbor typeNeighbor ) : base(frontPoint, mediumPoint, backPoint) { this.TypeNeighbor = typeNeighbor; }
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; } )); }
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); }