Пример #1
0
 public PlaneVerticalHelper([NotNull] SegmentsPlane segmentsPlane,
                            [NotNull] IIndexedMultiPatch indexedMultipatch)
     : base(segmentsPlane)
 {
     Assert.ArgumentNotNull(indexedMultipatch, nameof(indexedMultipatch));
     // not yet used
 }
 public NonPlanarError(
     [NotNull] string message,
     double maximumOffset,
     [NotNull] SegmentsPlane segmentsPlane)
 {
     Message       = message;
     MaximumOffset = maximumOffset;
     SegmentsPlane = segmentsPlane;
 }
Пример #3
0
        private int ReportInvalidPlane([NotNull] string description,
                                       [NotNull] SegmentsPlane segmentsPlane,
                                       [NotNull] IFeature feature)
        {
            IGeometry errorGeometry = GetErrorGeometry(feature.Shape.GeometryType,
                                                       segmentsPlane.Segments);

            return(ReportError(description, errorGeometry,
                               Codes[Code.FaceDoesNotDefineValidPlane],
                               null,
                               feature));
        }
        private static IEnumerable <IIntersectionPoint> GetIntersectionPoints(
            [NotNull] SegmentsPlane segmentsPlane,
            [NotNull] IGeometry vertices)
        {
            // TODO ignore intersections with points that are too far outside of the ring footprint

            // NOTE for efficiency, this should only be calculated if an error would otherwise be reported
            // (requires reconstruction of the ring geometry)
            // -> add method to IIntersectionPoint to measure the actual distance to the ring (0 if inside)
            return((IEnumerable <IIntersectionPoint>)GetPoints(vertices)
                   .Select(v => GetIntersectionPoint(segmentsPlane.Plane, v)));
        }
Пример #5
0
            public static PlaneHelper Create(
                [NotNull] SegmentsPlane segmentsPlane,
                [NotNull] IIndexedMultiPatch indexedMultipatch,
                [NotNull] QaMpVertexNotNearFace parent)
            {
                if (parent.CheckMethod != OffsetMethod.Vertical)
                {
                    throw new NotImplementedException();
                }

                PlaneHelper planeHelper =
                    new PlaneVerticalHelper(segmentsPlane, indexedMultipatch);

                planeHelper._parent = parent;

                return(planeHelper);
            }
        private static bool IsCoplanar([NotNull] SegmentsPlane segmentsPlane,
                                       [NotNull] IFeature planarFeature,
                                       double coplanarityTolerance,
                                       out double maximumOffset)
        {
            maximumOffset = GetMaximumOffset(segmentsPlane);
            if (maximumOffset <= coplanarityTolerance)
            {
                return(true);
            }

            var sref = Assert.NotNull(DatasetUtils.GetSpatialReference(planarFeature));

            var xyResolution = SpatialReferenceUtils.GetXyResolution(sref);
            var zResolution  = SpatialReferenceUtils.GetZResolution(sref);

            return(maximumOffset <= GeomUtils.AdjustCoplanarityTolerance(
                       segmentsPlane.Plane, coplanarityTolerance, zResolution,
                       xyResolution));
        }
Пример #7
0
 protected PlaneHelper([NotNull] SegmentsPlane segmentsPlane)
 {
     SegmentsPlane = segmentsPlane;
     _minOffset    = 1;
     _maxOffset    = -1;
 }
 private static double GetMaximumOffset([NotNull] SegmentsPlane segmentsPlane) =>
 segmentsPlane
 .GetPoints()
 .Select(p => segmentsPlane.Plane.GetDistanceAbs(p.X, p.Y, p.Z))
 .Max();