Exemple #1
0
 public ShortSubpartError([NotNull] SegmentsSubpart segmentsSubpart, double length,
                          double minLength)
 {
     SegmentsSubpart = segmentsSubpart;
     Length          = length;
     MinLength       = minLength;
 }
Exemple #2
0
 public AngleEndError([NotNull] SegmentsSubpart segmentsSubpart,
                      [NotNull] IPnt at,
                      [NotNull] IPnt otherEnd)
 {
     SegmentsSubpart = segmentsSubpart;
     At       = at;
     OtherEnd = otherEnd;
 }
Exemple #3
0
            private int VerifyAngle([NotNull] SegmentProxyInfo first,
                                    [NotNull] SegmentProxyInfo compare,
                                    double lineWidth,
                                    [NotNull] SegmentsSubpart subpart)
            {
                if (ReportAngledEndError == null)
                {
                    return(0);
                }

                double dir0;
                IPnt   pnt0;

                double dir1;
                IPnt   pnt1;

                if (first.SegmentProxy.SegmentIndex < compare.SegmentProxy.SegmentIndex)
                {
                    dir0 = first.SegmentProxy.GetDirectionAt(0);
                    pnt0 = first.SegmentProxy.GetPointAt(0);

                    dir1 = compare.SegmentProxy.GetDirectionAt(0);
                    pnt1 = compare.SegmentProxy.GetPointAt(0);
                }
                else
                {
                    dir0 = first.SegmentProxy.GetDirectionAt(1);
                    pnt0 = first.SegmentProxy.GetPointAt(1);

                    dir1 = compare.SegmentProxy.GetDirectionAt(1);
                    pnt1 = compare.SegmentProxy.GetPointAt(1);
                }

                // TODO revise length/angle calculation in case of intermittent segments
                double dx            = pnt0.X - pnt1.X;
                double dy            = pnt0.Y - pnt1.Y;
                double segmentLength = Math.Sqrt(dx * dx + dy * dy);

                return(HasInconsistentLineEnd(lineWidth, dir0, dir1, segmentLength)
                                               ? ReportAngledEndError(new AngleEndError(subpart, pnt1, pnt0))
                                               : 0);
            }