示例#1
0
        public static double ReturnProjectDistance(IGlobe pGlobe, double dFromX, double dFromY, double dFromZ, double dToX, double dToY, double dToZ)
        {
            IPoint pPnt1 = new Point();
            IPoint pPnt2 = new Point();

            pPnt1.X = dFromX;
            pPnt1.Y = dFromY;
            MakeZAware(pPnt1);
            pPnt1.Z = dFromZ * 1000;
            pPnt1.SpatialReference = pGlobe.GlobeDisplay.Scene.SpatialReference;
            if (pPnt1.SpatialReference is IGeographicCoordinateSystem)
            {
                pPnt1 = ProjectGeometry(pPnt1) as IPoint;
            }

            pPnt2.X = dToX;
            pPnt2.Y = dToY;
            MakeZAware(pPnt2);
            pPnt2.Z = dToZ * 1000;
            pPnt2.SpatialReference = pGlobe.GlobeDisplay.Scene.SpatialReference;
            if (pPnt2.SpatialReference is IGeographicCoordinateSystem)
            {
                pPnt2 = ProjectGeometry(pPnt2) as IPoint;
            }

            IProximityOperator3D pProximityOperator3D = pPnt1 as IProximityOperator3D;

            return(pProximityOperator3D.ReturnDistance3D(pPnt2));
        }
示例#2
0
        private bool IsUnusal(IPolyline polyline, double gj, double qdgc, double zdgc, IPolyline polyline2, double gj2, double qdgc2, double zdgc2)
        {
            IGeometry            geometry            = CreateGeometry(gj, polyline, qdgc, zdgc);
            IGeometry            geometry2           = CreateGeometry(gj2, polyline2, qdgc2, zdgc2);
            IProximityOperator3D proximityOperator3D = geometry as IProximityOperator3D;
            double distance3D = proximityOperator3D.ReturnDistance3D(geometry2);

            return(distance3D <= 0);
        }