Beispiel #1
0
        public static double CoincidenceEvaluation(Extent2D ext1, Extent2D ext2) // newly 20130402
        {
            double dist    = ext1.Center.DistTo(ext2.Center);
            double minArea = Math.Min(ext1.Area, ext2.Area);

            return(dist * dist / minArea);
        }
Beispiel #2
0
        // 20111014
        public Extent2D GetExtent()
        {
            Extent2D result = Extent2D.Null;

            points.ForEach(p => result.AddPoint(p));
            return(result);
        }
Beispiel #3
0
        public bool IsExtentsCross(Extent2D extents)
        {
            //Point2D p1 = new Point2D(min.x, max.y);
            //Point2D p2 = new Point2D(max.x, min.y);
            //return extents.IsPointIn(p1) || extents.IsPointIn(p2) || extents.IsPointIn(min) || extents.IsPointIn(max) || IsExtentsIn(extents) || extents.IsExtentsIn(this);

            Extent2D sum = this + extents;

            return((sum.XRange <= this.XRange + extents.XRange) && (sum.YRange <= this.YRange + extents.YRange));
        }
Beispiel #4
0
        private void Init()
        {
            foreach (Point2D p in Points)
            {
                BoxVisual3D box = new BoxVisual3D {
                    Center = new Point3D(p.x, p.y, BoxInitHeight / 2), Width = BoxSize, Length = BoxSize, Height = BoxInitHeight, Fill = System.Windows.Media.Brushes.Cyan
                };
                Boxes.Add(box);
                Viewport.Children.Add(box);
            }
            var center = new TongJi.Geometry.Extent2D(Points).Center;

            Viewport.LookAt(new System.Windows.Media.Media3D.Point3D(center.x, center.y, 0), new System.Windows.Media.Media3D.Vector3D(0, 1, -0.8), 500);
            Viewport.ZoomExtents(1000);
        }
Beispiel #5
0
 // 20111014
 public void Add(Extent2D ext)
 {
     if (this.IsNull)
     {
         min    = ext.min;
         max    = ext.max;
         IsNull = ext.IsNull;
     }
     else
     {
         if (ext.IsNull)
         {
             return;
         }
         min = new Point2D(Math.Min(min.x, ext.min.x), Math.Min(min.y, ext.min.y));
         max = new Point2D(Math.Max(max.x, ext.max.x), Math.Max(max.y, ext.max.y));
     }
 }
Beispiel #6
0
 public bool IsExtentsIn(Extent2D extents)
 {
     return(extents.min.x >= min.x && extents.min.y >= min.y && extents.max.x <= max.x && extents.max.y <= max.y);
 }
Beispiel #7
0
 public bool IsCoveredBy(Extent2D extents) // newly 20130328
 {
     return(extents.min.x >= min.x && extents.min.y >= min.y && extents.max.x <= max.x && extents.max.y <= max.y);
 }
        public bool IsExtentsCross(Extent2D extents)
        {
            Extent2D sum = this + extents;

            return((sum.XRange <= this.XRange + extents.XRange) && (sum.YRange <= this.YRange + extents.YRange));
        }