Ejemplo n.º 1
0
        void axRenderControl1_RcObjectEditFinish()
        {
            IMultiPolygon multiPolygon = currentRenderGeometry.GetFdeGeometry() as IMultiPolygon;

            if (multiPolygon == null)
            {
                multiPolygon = geoFactory.CreateGeometry(gviGeometryType.gviGeometryMultiPolygon, gviVertexAttribute.gviVertexAttributeZ) as IMultiPolygon;
                IPolygon polygon = currentRenderGeometry.GetFdeGeometry() as IPolygon;
                multiPolygon.AddPolygon(polygon);
            }
            this.axRenderControl1.Terrain.SetOceanRegion(multiPolygon);
            currentRenderGeometry.VisibleMask     = gviViewportMask.gviViewNone;
            currentRenderGeometry.ViewingDistance = 10000;
            this.axRenderControl1.Camera.FlyToObject(currentRenderGeometry.Guid, gviActionCode.gviActionFollowAbove);
            this.axRenderControl1.InteractMode = gviInteractMode.gviInteractNormal;
        }
Ejemplo n.º 2
0
        private void DoFillCut()
        {
            TerrainAnalyse ta = new TerrainAnalyse();

            ta.Processing += OnProcessing;
            IMultiPolygon CutmPolygon  = geoFactory.CreateGeometry(gviGeometryType.gviGeometryMultiPolygon, gviVertexAttribute.gviVertexAttributeZ) as IMultiPolygon;
            IMultiPolygon FillmPolygon = geoFactory.CreateGeometry(gviGeometryType.gviGeometryMultiPolygon, gviVertexAttribute.gviVertexAttributeZ) as IMultiPolygon;
            double        CutVolume    = 0;
            double        FillVolume   = 0;

            ta.CalculateCutFill(currentRenderGeometry.GetFdeGeometry() as IPolygon, (double)numSampling.Value, (double)numHeight.Value, ref CutmPolygon, ref FillmPolygon, ref CutVolume, ref FillVolume);
            if (CutVolume != 0)
            {
                ISurfaceSymbol sf = new SurfaceSymbol();
                sf.Color = System.Drawing.Color.FromArgb(Convert.ToInt32("0xbbFF0000", 16));
                ICurveSymbol cs = new CurveSymbol();
                cs.Color           = System.Drawing.Color.FromArgb(Convert.ToInt32("0xcc0000cc", 16));
                sf.BoundarySymbol  = cs;
                cutrmp             = this.axRenderControl1.ObjectManager.CreateRenderMultiPolygon(CutmPolygon, sf, rootId);
                cutrmp.HeightStyle = gviHeightStyle.gviHeightOnTerrain;
                txtCutVolume.Text  = Math.Round(CutVolume, 4).ToString();
            }
            if (FillVolume != 0)
            {
                ISurfaceSymbol sf = new SurfaceSymbol();
                sf.Color = System.Drawing.Color.FromArgb(Convert.ToInt32("0xbb0000FF", 16));
                ICurveSymbol cs = new CurveSymbol();
                cs.Color            = System.Drawing.Color.FromArgb(Convert.ToInt32("0xcc0000cc", 16));
                sf.BoundarySymbol   = cs;
                fillrmp             = this.axRenderControl1.ObjectManager.CreateRenderMultiPolygon(FillmPolygon, sf, rootId);
                fillrmp.HeightStyle = gviHeightStyle.gviHeightOnTerrain;
                txtFillVolume.Text  = Math.Round(FillVolume, 4).ToString();
            }
        }