Exemple #1
0
        void axRenderControl1_RcMouseClickSelect(IPickResult PickResult, IPoint IntersectPoint, gviModKeyMask Mask, gviMouseSelectMode EventSender)
        {
            //获取水源点
            waterPoint = IntersectPoint;
            //设置参数
            this.numWaterHStart.Value = (decimal)IntersectPoint.Z;
            this.numWaterHEnd.Value   = (decimal)(IntersectPoint.Z + 30);
            //获取缓冲区bufPolygon\renderBufPolygon
            radius = (double)numBufferRadius.Value;
            ITopologicalOperator2D to = waterPoint as ITopologicalOperator2D;

            bufPolygon = to.Buffer2D(radius, gviBufferStyle.gviBufferCapround) as IPolygon;
            ISurfaceSymbol sf = new SurfaceSymbol();

            sf.Color = System.Drawing.Color.Yellow;
            ICurveSymbol cs = new CurveSymbol();

            cs.Color                     = System.Drawing.Color.Yellow;
            sf.BoundarySymbol            = cs;
            renderBufPolygon             = this.axRenderControl1.ObjectManager.CreateRenderPolygon(bufPolygon, sf, rootId);
            renderBufPolygon.HeightStyle = gviHeightStyle.gviHeightOnTerrain;

            this.axRenderControl1.InteractMode        = gviInteractMode.gviInteractNormal;
            this.axRenderControl1.RcMouseClickSelect -= new _IRenderControlEvents_RcMouseClickSelectEventHandler(axRenderControl1_RcMouseClickSelect);

            this.btnOnProcess.Enabled = true;
            this.btnSimulate.Enabled  = true;
        }
Exemple #2
0
        /// <summary>
        /// 获取缓冲多边形
        /// </summary>
        /// <param name="distance">缓冲半径</param>
        /// <returns>缓冲多边形</returns>
        private IPolygon GetBufferPolygon(double distance)
        {
            IPoint startPoint = _StartRenderPoint.GetFdeGeometry() as IPoint;

            if (startPoint == null)
            {
                return(null);
            }

            IPoint drawSource = startPoint.Clone2(gviVertexAttribute.gviVertexAttributeZ) as IPoint;
            ITopologicalOperator2D drawTopo = drawSource as ITopologicalOperator2D;
            IPolygon bufferPolygon          = drawTopo.Buffer2D(distance, gviBufferStyle.gviBufferCapround) as IPolygon;

            return(bufferPolygon);
        }
Exemple #3
0
        /// <summary>
        /// 获取缓冲多边形
        /// </summary>
        /// <param name="distance">缓冲半径</param>
        /// <returns>缓冲多边形</returns>
        private IPolygon GetBufferPolygon(double distance)
        {
            IPolyline startLine = renderPolyline.GetFdeGeometry() as IPolyline;

            if (startLine == null)
            {
                return(null);
            }

            IPolyline drawSource = startLine.Clone2(gviVertexAttribute.gviVertexAttributeZ) as IPolyline;

            //如果是球面需投影到平面再做缓冲区计算
            if (currentCRS.CrsType == gviCoordinateReferenceSystemType.gviCrsGeographic)
            {
                drawSource.Project(projectCRS);
            }
            ITopologicalOperator2D drawBufferLine = drawSource as ITopologicalOperator2D;
            IPolygon bufferPolygon = drawBufferLine.Buffer2D(distance, gviBufferStyle.gviBufferCapbutt) as IPolygon;

            bufferPolygon.SpatialCRS = drawSource.SpatialCRS;
            if (currentCRS.CrsType == gviCoordinateReferenceSystemType.gviCrsGeographic)
            {
                bufferPolygon.Project(currentCRS);
            }

            polygon = bufferPolygon;
            IPolygon ppolygon = bufferPolygon.Clone2(gviVertexAttribute.gviVertexAttributeZ) as IPolygon;  //设置三维坐标

            //不被地面遮挡
            for (int j = 0; j < ppolygon.ExteriorRing.PointCount; j++)
            {
                IPoint p = ppolygon.ExteriorRing.GetPoint(j);
                p.Z = 1;
                ppolygon.ExteriorRing.UpdatePoint(j, p);
            }
            return(ppolygon);
        }